testFail.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /*============================================================================
  2. KWSys - Kitware System Library
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #include <stdio.h>
  11. #include <stdlib.h>
  12. #include <string.h>
  13. int testFail(int argc, char* argv[])
  14. {
  15. char* env = getenv("DASHBOARD_TEST_FROM_CTEST");
  16. int oldCtest = 0;
  17. if(env)
  18. {
  19. if(strcmp(env, "1") == 0)
  20. {
  21. oldCtest = 1;
  22. }
  23. printf("DASHBOARD_TEST_FROM_CTEST = %s\n", env);
  24. }
  25. printf("%s: This test intentionally fails\n", argv[0]);
  26. if(oldCtest)
  27. {
  28. printf("The version of ctest is not able to handle intentionally failing tests, so pass.\n");
  29. return 0;
  30. }
  31. return argc;
  32. }