Imported Upstream version 2.8.11.2
[platform/upstream/cmake.git] / Tests / CompileDefinitions / runtest.c
1 #include <string.h>
2 #include <stdio.h>
3 #include <ctype.h>
4
5 #ifndef BUILD_CONFIG_NAME
6 # error "BUILD_CONFIG_NAME not defined!"
7 #endif
8
9 int main()
10 {
11   char build_config_name[] = BUILD_CONFIG_NAME;
12   char* c;
13   for(c = build_config_name; *c; ++c)
14     {
15     *c = (char)tolower((int)*c);
16     }
17   fprintf(stderr, "build_config_name=\"%s\"\n", build_config_name);
18 #ifdef TEST_CONFIG_DEBUG
19   if(strcmp(build_config_name, "debug") != 0)
20     {
21     fprintf(stderr, "build_config_name is not \"debug\"\n");
22     return 1;
23     }
24 #endif
25 #ifdef TEST_CONFIG_RELEASE
26   if(strcmp(build_config_name, "release") != 0)
27     {
28     fprintf(stderr, "build_config_name is not \"release\"\n");
29     return 1;
30     }
31 #endif
32 #ifdef TEST_CONFIG_MINSIZEREL
33   if(strcmp(build_config_name, "minsizerel") != 0)
34     {
35     fprintf(stderr, "build_config_name is not \"minsizerel\"\n");
36     return 1;
37     }
38 #endif
39 #ifdef TEST_CONFIG_RELWITHDEBINFO
40   if(strcmp(build_config_name, "relwithdebinfo") != 0)
41     {
42     fprintf(stderr, "build_config_name is not \"relwithdebinfo\"\n");
43     return 1;
44     }
45 #endif
46   return 0;
47 }