summaryrefslogtreecommitdiff
path: root/Tests/CTestTestUpload
diff options
context:
space:
mode:
authorZach Mullen <zach.mullen@kitware.com>2011-02-18 12:11:51 -0500
committerBrad King <brad.king@kitware.com>2011-03-15 15:07:37 -0400
commit350546db3aa956e34487bd38dd048fe9a0689e4a (patch)
tree3f0bda38ef56ddba39d93cb172e5cec8e6fb3fe7 /Tests/CTestTestUpload
parent0554e5e50f6eb3117b4e207f4b01876dbe5a75a4 (diff)
downloadcmake-350546db3aa956e34487bd38dd048fe9a0689e4a.tar.gz
Implement ctest_upload command
Diffstat (limited to 'Tests/CTestTestUpload')
-rw-r--r--Tests/CTestTestUpload/CMakeLists.txt4
-rw-r--r--Tests/CTestTestUpload/CTestConfig.cmake7
-rw-r--r--Tests/CTestTestUpload/sleep.c21
-rw-r--r--Tests/CTestTestUpload/test.cmake.in17
4 files changed, 49 insertions, 0 deletions
diff --git a/Tests/CTestTestUpload/CMakeLists.txt b/Tests/CTestTestUpload/CMakeLists.txt
new file mode 100644
index 0000000000..bc164b10c6
--- /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 0000000000..89c5b94746
--- /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 0000000000..b5896474b1
--- /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 0000000000..2ab98d79d4
--- /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()