85 lines
1.8 KiB
C++
Raw Normal View History

2013-11-03 12:27:13 +02:00
#ifndef TEST_DEFINE
2018-08-09 18:06:22 +02:00
# error Expected definition TEST_DEFINE
2013-11-03 12:27:13 +02:00
#endif
#ifndef NEEDS_ESCAPE
2018-08-09 18:06:22 +02:00
# error Expected definition NEEDS_ESCAPE
2013-11-03 12:27:13 +02:00
#endif
#ifdef DO_GNU_TESTS
2018-08-09 18:06:22 +02:00
# ifndef TEST_DEFINE_GNU
# error Expected definition TEST_DEFINE_GNU
# endif
2019-11-11 23:01:05 +01:00
# ifndef TEST_DEFINE_CXX_AND_GNU
# error Expected definition TEST_DEFINE_CXX_AND_GNU
# endif
2016-07-09 11:21:54 +02:00
#endif
2018-08-09 18:06:22 +02:00
#ifndef NO_DEF_TESTS
# ifndef DEF_A
# error Expected definition DEF_A
# endif
# ifndef DEF_B
# error Expected definition DEF_B
# endif
# ifndef DEF_C
# error Expected definition DEF_C
# endif
# ifndef DEF_D
# error Expected definition DEF_D
# endif
# ifndef DEF_STR
# error Expected definition DEF_STR
# endif
2013-11-03 12:27:13 +02:00
#endif
2021-09-14 00:13:48 +02:00
#ifdef DO_FLAG_TESTS
# if FLAG_A != 2
# error "FLAG_A is not 2"
# endif
# if FLAG_B != 2
# error "FLAG_B is not 2"
# endif
# if FLAG_C != 2
# error "FLAG_C is not 2"
# endif
# if FLAG_D != 2
# error "FLAG_D is not 2"
# endif
# if defined(FLAG_E) && FLAG_E != 2
# error "FLAG_E is not 2"
# endif
#endif
2013-11-03 12:27:13 +02:00
#include <string.h>
int main()
{
return (strcmp(NEEDS_ESCAPE, "E$CAPE") == 0
2015-04-27 22:25:09 +02:00
#ifdef TEST_OCTOTHORPE
2016-07-09 11:21:54 +02:00
&& strcmp(TEST_OCTOTHORPE, "#") == 0
2018-08-09 18:06:22 +02:00
#endif
#ifndef NO_DEF_TESTS
&& strcmp(DEF_STR, "string with spaces") == 0
2015-04-27 22:25:09 +02:00
#endif
2016-07-09 11:21:54 +02:00
&&
strcmp(EXPECTED_C_COMPILER_VERSION, TEST_C_COMPILER_VERSION) == 0 &&
2019-11-11 23:01:05 +01:00
strcmp(EXPECTED_CXX_COMPILER_VERSION, TEST_CXX_COMPILER_VERSION) == 0
#ifdef TEST_FORTRAN
&& strcmp(EXPECTED_Fortran_COMPILER_VERSION,
TEST_Fortran_COMPILER_VERSION) == 0
#endif
&& TEST_C_COMPILER_VERSION_EQUALITY == 1 &&
TEST_CXX_COMPILER_VERSION_EQUALITY == 1
#ifdef TEST_FORTRAN
&& TEST_Fortran_COMPILER_VERSION_EQUALITY == 1
#endif
)
2016-07-09 11:21:54 +02:00
? 0
: 1;
2013-11-03 12:27:13 +02:00
}