diff options
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLists.txt | 10 | ||||
-rw-r--r-- | Tests/CTestTestUpload/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Tests/CTestTestUpload/CTestConfig.cmake | 7 | ||||
-rw-r--r-- | Tests/CTestTestUpload/sleep.c | 21 | ||||
-rw-r--r-- | Tests/CTestTestUpload/test.cmake.in | 17 |
5 files changed, 59 insertions, 0 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 6da06f6..eb15fdb 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1443,6 +1443,16 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ PASS_REGULAR_EXPRESSION "Could not find executable" FAIL_REGULAR_EXPRESSION "SegFault") + CONFIGURE_FILE( + "${CMake_SOURCE_DIR}/Tests/CTestTestUpload/test.cmake.in" + "${CMake_BINARY_DIR}/Tests/CTestTestUpload/test.cmake" + @ONLY ESCAPE_QUOTES) + ADD_TEST(CTestTestUpload ${CMAKE_CTEST_COMMAND} + -S "${CMake_BINARY_DIR}/Tests/CTestTestUpload/test.cmake" -V + --output-log "${CMake_BINARY_DIR}/Tests/CTestTestUpload/testOut.log" + ) + SET_TESTS_PROPERTIES(CTestTestUpload PROPERTIES + PASS_REGULAR_EXPRESSION "Upload\\.xml") # Use macro, not function so that build can still be driven by CMake 2.4. # After 2.6 is required, this could be a function without the extra 'set' diff --git a/Tests/CTestTestUpload/CMakeLists.txt b/Tests/CTestTestUpload/CMakeLists.txt new file mode 100644 index 0000000..bc164b1 --- /dev/null +++ b/Tests/CTestTestUpload/CMakeLists.txt @@ -0,0 +1,4 @@ +cmake_minimum_required (VERSION 2.6) +PROJECT(CTestTestUpload) + +add_executable (Sleep sleep.c) diff --git a/Tests/CTestTestUpload/CTestConfig.cmake b/Tests/CTestTestUpload/CTestConfig.cmake new file mode 100644 index 0000000..89c5b94 --- /dev/null +++ b/Tests/CTestTestUpload/CTestConfig.cmake @@ -0,0 +1,7 @@ +set (CTEST_PROJECT_NAME "CTestTestUpload") +set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") +set (CTEST_DART_SERVER_VERSION "2") +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/CTestTestUpload/sleep.c b/Tests/CTestTestUpload/sleep.c new file mode 100644 index 0000000..b589647 --- /dev/null +++ b/Tests/CTestTestUpload/sleep.c @@ -0,0 +1,21 @@ +#if defined(_WIN32) +# include <windows.h> +#else +# include <unistd.h> +#endif + +/* sleeps for n seconds, where n is the argument to the program */ +int main(int argc, char** argv) +{ + int time; + if(argc > 1) + { + time = atoi(argv[1]); + } +#if defined(_WIN32) + Sleep(time * 1000); +#else + sleep(time); +#endif + return 0; +} diff --git a/Tests/CTestTestUpload/test.cmake.in b/Tests/CTestTestUpload/test.cmake.in new file mode 100644 index 0000000..2ab98d7 --- /dev/null +++ b/Tests/CTestTestUpload/test.cmake.in @@ -0,0 +1,17 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.1) + +# Settings: +SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +SET(CTEST_SITE "@SITE@") +SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Upload") + +SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestUpload") +SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestUpload") +SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") + +CTEST_START(Experimental) +CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_UPLOAD("${CTEST_SOURCE_DIRECTORY}/sleep.c" "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt") +CTEST_SUBMIT() |