| 1 |
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying |
| 2 |
file Copyright.txt or https://cmake.org/licensing#kwsys for details. */ |
| 3 |
#include <stdio.h> |
| 4 |
#include <stdlib.h> |
| 5 |
#include <string.h> |
| 6 |
|
| 7 |
int testFail(int argc, char* argv[]) |
| 8 |
{ |
| 9 |
char* env = getenv("DASHBOARD_TEST_FROM_CTEST"); |
| 10 |
int oldCtest = 0; |
| 11 |
if (env) { |
| 12 |
if (strcmp(env, "1") == 0) { |
| 13 |
oldCtest = 1; |
| 14 |
} |
| 15 |
printf("DASHBOARD_TEST_FROM_CTEST = %s\n", env); |
| 16 |
} |
| 17 |
printf("%s: This test intentionally fails\n", argv[0]); |
| 18 |
if (oldCtest) { |
| 19 |
printf("The version of ctest is not able to handle intentionally failing " |
| 20 |
"tests, so pass.\n"); |
| 21 |
return 0; |
| 22 |
} |
| 23 |
return argc; |
| 24 |
} |