summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/ctest_test/OutputJUnit-check.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/ctest_test/OutputJUnit-check.cmake')
-rw-r--r--Tests/RunCMake/ctest_test/OutputJUnit-check.cmake24
1 files changed, 24 insertions, 0 deletions
diff --git a/Tests/RunCMake/ctest_test/OutputJUnit-check.cmake b/Tests/RunCMake/ctest_test/OutputJUnit-check.cmake
new file mode 100644
index 0000000..00310a4
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/OutputJUnit-check.cmake
@@ -0,0 +1,24 @@
+file(GLOB junit_xml_file "${RunCMake_TEST_BINARY_DIR}/junit.xml")
+if(junit_xml_file)
+ file(READ "${junit_xml_file}" junit_xml LIMIT 4096)
+ if(NOT "${junit_xml}" MATCHES "tests=\"1\"")
+ set(RunCMake_TEST_FAILED "tests=\"1\" not found when expected")
+ endif()
+ if(NOT "${junit_xml}" MATCHES "failures=\"0\"")
+ set(RunCMake_TEST_FAILED "failures=\"0\" not found when expected")
+ endif()
+ if(NOT "${junit_xml}" MATCHES "disabled=\"0\"")
+ set(RunCMake_TEST_FAILED "disabled=\"0\" not found when expected")
+ endif()
+ if(NOT "${junit_xml}" MATCHES "skipped=\"0\"")
+ set(RunCMake_TEST_FAILED "skipped=\"0\" not found when expected")
+ endif()
+ if(NOT "${junit_xml}" MATCHES "<testcase name=\"RunCMakeVersion\" classname=\"RunCMakeVersion\"")
+ set(RunCMake_TEST_FAILED "RunCMakeVersion not found when expected")
+ endif()
+ if(NOT "${junit_xml}" MATCHES "<system-out>cmake version")
+ set(RunCMake_TEST_FAILED "<system-out>cmake version not found when expected")
+ endif()
+else()
+ set(RunCMake_TEST_FAILED "junit.xml not found")
+endif()