MathTestExec.cxx 760 B

123456789101112131415161718192021222324
  1. #include <stdio.h>
  2. #define TEST_EXPRESSION(x, y) \
  3. if ((x) != (y)) { \
  4. printf("Problem with EXPR: Expression: \"%s\" in C returns %d while in " \
  5. "CMake returns: %d\n", \
  6. #x, (x), (y)); \
  7. res++; \
  8. }
  9. int main(int argc, char* argv[])
  10. {
  11. if (argc > 1) {
  12. printf("Usage: %s\n", argv[0]);
  13. return 1;
  14. }
  15. int res = 0;
  16. #include "MathTestTests.h"
  17. if (res != 0) {
  18. printf("%s: %d math tests failed\n", argv[0], res);
  19. return 1;
  20. }
  21. return 0;
  22. }