runtest.c 1.0 KB

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