summaryrefslogtreecommitdiffstats
path: root/Tests/CTestSubmitLargeOutput
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2010-03-08 17:14:47 (GMT)
committerDavid Cole <david.cole@kitware.com>2010-03-08 18:25:58 (GMT)
commita61c5ab6e59a458ad34383e64d0679a7fe898c61 (patch)
tree48b29a4098c425fcd826bb63aee3c23bfca4adf9 /Tests/CTestSubmitLargeOutput
parenta9ac761938441fc2e86314c8200f7f39a3c2c6c3 (diff)
downloadCMake-a61c5ab6e59a458ad34383e64d0679a7fe898c61.zip
CMake-a61c5ab6e59a458ad34383e64d0679a7fe898c61.tar.gz
CMake-a61c5ab6e59a458ad34383e64d0679a7fe898c61.tar.bz2
Add CMAKE_TESTS_CDASH_SERVER variable and CTestSubmitLargeOutput test.
If defined and non-empty, the value of CMAKE_TESTS_CDASH_SERVER should point to a CDash server willing to accept submissions for a project named PublicDashboard. On machines that also run a CDash dashboard, set this variable to "http://localhost/CDash-trunk-Testing" so that the CMake tests that submit dashboards do not have to send those submissions over the wire. The CTestSubmitLargeOutput test runs a dashboard that has a test that produces very large amount of output on stdout/stderr. Since we do not even want to attempt to send such large output over the wire, this test is off by default unless the CMAKE_TESTS_CDASH_SERVER server is localhost. This test is expected to cause a submission failure when sent to CDash. It passes if the submit results contain error output. It fails if the submit succeeds. CMAKE_TESTS_CDASH_SERVER: CDash server used by CMake/Tests. If not defined or "", this variable defaults to the server at http://www.cdash.org/CDash. If set explicitly to "NOTFOUND", curl tests and ctest tests that use the network are skipped. If set to something starting with "http://localhost/", the CDash is expected to be an instance of CDash used for CDash testing, pointing to a cdash4simpletest database. In these cases, the CDash dashboards should be run first.
Diffstat (limited to 'Tests/CTestSubmitLargeOutput')
-rw-r--r--Tests/CTestSubmitLargeOutput/CMakeLists.txt8
-rw-r--r--Tests/CTestSubmitLargeOutput/CTestConfig.cmake6
-rw-r--r--Tests/CTestSubmitLargeOutput/GenerateRandomOutput.cmake31
-rw-r--r--Tests/CTestSubmitLargeOutput/test.cmake.in26
4 files changed, 71 insertions, 0 deletions
diff --git a/Tests/CTestSubmitLargeOutput/CMakeLists.txt b/Tests/CTestSubmitLargeOutput/CMakeLists.txt
new file mode 100644
index 0000000..6c30e7a
--- /dev/null
+++ b/Tests/CTestSubmitLargeOutput/CMakeLists.txt
@@ -0,0 +1,8 @@
+cmake_minimum_required(VERSION 2.8)
+project(SubmitLargeOutput NONE)
+
+include(CTest)
+
+add_test(GenerateRandomOutput ${CMAKE_COMMAND}
+ -P ${CMAKE_CURRENT_SOURCE_DIR}/GenerateRandomOutput.cmake
+ )
diff --git a/Tests/CTestSubmitLargeOutput/CTestConfig.cmake b/Tests/CTestSubmitLargeOutput/CTestConfig.cmake
new file mode 100644
index 0000000..ffd6efc
--- /dev/null
+++ b/Tests/CTestSubmitLargeOutput/CTestConfig.cmake
@@ -0,0 +1,6 @@
+set(CTEST_PROJECT_NAME "SubmitLargeOutput")
+set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "www.cdash.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestSubmitLargeOutput/GenerateRandomOutput.cmake b/Tests/CTestSubmitLargeOutput/GenerateRandomOutput.cmake
new file mode 100644
index 0000000..c7f4f29
--- /dev/null
+++ b/Tests/CTestSubmitLargeOutput/GenerateRandomOutput.cmake
@@ -0,0 +1,31 @@
+#
+# This script generates random lines of output.
+#
+# By default, it generates 100M of output (a million lines of 100 bytes each),
+# but you can override that by passing in -D line_count and/or -D line_size...
+#
+
+# Default values:
+#
+if(NOT DEFINED line_count)
+ set(line_count 1000000)
+endif()
+
+if(NOT DEFINED line_size)
+ set(line_size 100)
+endif()
+
+if(NOT DEFINED random_seed)
+ set(random_seed 1987)
+endif()
+
+# Use RANDOM_SEED once before the loop:
+#
+string(RANDOM LENGTH ${line_size} RANDOM_SEED ${random_seed} s)
+
+# Emit line_count lines of random output:
+#
+foreach(i RANGE 1 ${line_count})
+ string(RANDOM LENGTH ${line_size} s)
+ message(${s})
+endforeach()
diff --git a/Tests/CTestSubmitLargeOutput/test.cmake.in b/Tests/CTestSubmitLargeOutput/test.cmake.in
new file mode 100644
index 0000000..bc094b0
--- /dev/null
+++ b/Tests/CTestSubmitLargeOutput/test.cmake.in
@@ -0,0 +1,26 @@
+SET(CTEST_SITE "@SITE@")
+SET(CTEST_BUILD_NAME "LargeOutput-@BUILDNAME@")
+SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+SET(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
+
+SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestSubmitLargeOutput")
+SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestSubmitLargeOutput/build")
+SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+
+CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
+
+CTEST_START(Experimental)
+CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_READ_CUSTOM_FILES("${CTEST_BINARY_DIRECTORY}")
+CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+
+SET(CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE 1000000000)
+SET(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 1000000000)
+
+CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+
+set(CTEST_DROP_METHOD "@protocol@")
+set(CTEST_DROP_SITE "@server@")
+set(CTEST_DROP_LOCATION "@path@/submit.php?project=PublicDashboard")
+
+CTEST_SUBMIT(RETURN_VALUE res)