testFail.c 521 B

123456789101112131415161718192021222324
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. int main(int argc, char* argv[])
  5. {
  6. char* env = getenv("DASHBOARD_TEST_FROM_CTEST");
  7. int oldCtest = 0;
  8. if(env)
  9. {
  10. if(strcmp(env, "1") == 0)
  11. {
  12. oldCtest = 1;
  13. }
  14. printf("DASHBOARD_TEST_FROM_CTEST = %s\n", env);
  15. }
  16. printf("%s: This test intentionally fails\n", argv[0]);
  17. if(oldCtest)
  18. {
  19. printf("The version of ctest is not able to handle intentionally failing tests, so pass.\n");
  20. return 0;
  21. }
  22. return argc;
  23. }