diff options
Diffstat (limited to 'Tests')
47 files changed, 218 insertions, 11 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index dea30e4..3aecd9b 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1247,6 +1247,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release if(CMake_TEST_FindGSL) add_subdirectory(FindGSL) endif() + if(CMake_TEST_FindJsonCpp) + add_subdirectory(FindJsonCpp) + endif() find_package(GTK2 QUIET) if(GTK2_FOUND) diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index a276f36..ef37dcb 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -51,6 +51,17 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" ) endif() +if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro) + list(REMOVE_ITEM CXX_non_features + cxx_attribute_deprecated + cxx_contextual_conversions + cxx_extended_friend_declarations + cxx_long_long_type + cxx_sizeof_member + cxx_variadic_macros + ) +endif() + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) # The cxx_constexpr feature happens to work (for *this* testcase) with @@ -197,6 +208,13 @@ if (CMAKE_CXX_COMPILE_FEATURES) -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 ) endif() + elseif (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro") + add_definitions( + -DEXPECT_OVERRIDE_CONTROL=1 + -DEXPECT_INHERITING_CONSTRUCTORS=1 + -DEXPECT_FINAL=1 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=1 + ) endif() add_executable(CompileFeaturesGenex genex_test.cpp) diff --git a/Tests/CompileFeatures/cxx_auto_type.cpp b/Tests/CompileFeatures/cxx_auto_type.cpp index 7dbf04f..1f36a79 100644 --- a/Tests/CompileFeatures/cxx_auto_type.cpp +++ b/Tests/CompileFeatures/cxx_auto_type.cpp @@ -1,5 +1,12 @@ +double foo_ = 3.14; + +double& foo() +{ + return foo_; +} + void someFunc() { - auto x = 3.14; + auto& x = foo(); } diff --git a/Tests/CompileFeatures/cxx_inheriting_constructors.cpp b/Tests/CompileFeatures/cxx_inheriting_constructors.cpp index a83b624..cfce880 100644 --- a/Tests/CompileFeatures/cxx_inheriting_constructors.cpp +++ b/Tests/CompileFeatures/cxx_inheriting_constructors.cpp @@ -13,6 +13,6 @@ struct B : public A void someFunc() { - int i; + int i = 0; B b(i); } diff --git a/Tests/CompileFeatures/cxx_variadic_templates.cpp b/Tests/CompileFeatures/cxx_variadic_templates.cpp index a80e157..e1f641b 100644 --- a/Tests/CompileFeatures/cxx_variadic_templates.cpp +++ b/Tests/CompileFeatures/cxx_variadic_templates.cpp @@ -1,21 +1,30 @@ +#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) < 407) +#define OLD_GNU +#endif + +#ifdef OLD_GNU template<int... Is> struct Interface; +#endif -template<int I> -struct Interface<I> +template<int I, int... Is> +struct Interface +#ifdef OLD_GNU + <I, Is...> +#endif { static int accumulate() { - return I; + return I + Interface<Is...>::accumulate(); } }; -template<int I, int... Is> -struct Interface<I, Is...> +template<int I> +struct Interface<I> { static int accumulate() { - return I + Interface<Is...>::accumulate(); + return I; } }; diff --git a/Tests/FindJsonCpp/CMakeLists.txt b/Tests/FindJsonCpp/CMakeLists.txt new file mode 100644 index 0000000..9a1fa38 --- /dev/null +++ b/Tests/FindJsonCpp/CMakeLists.txt @@ -0,0 +1,10 @@ +add_test(NAME FindJsonCpp.Test COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindJsonCpp/Test" + "${CMake_BINARY_DIR}/Tests/FindJsonCpp/Test" + ${build_generator_args} + --build-project TestFindJsonCpp + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) diff --git a/Tests/FindJsonCpp/Test/CMakeLists.txt b/Tests/FindJsonCpp/Test/CMakeLists.txt new file mode 100644 index 0000000..4e1e271 --- /dev/null +++ b/Tests/FindJsonCpp/Test/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.1) +project(TestFindJsonCpp CXX) +include(CTest) + +find_package(JsonCpp REQUIRED) + +add_executable(test_jsoncpp_tgt main.cxx) +target_link_libraries(test_jsoncpp_tgt JsonCpp::JsonCpp) +add_test(NAME test_jsoncpp_tgt COMMAND test_jsoncpp_tgt) + +add_executable(test_jsoncpp_var main.cxx) +target_include_directories(test_jsoncpp_var PRIVATE ${JsonCpp_INCLUDE_DIRS}) +target_link_libraries(test_jsoncpp_var PRIVATE ${JsonCpp_LIBRARIES}) +add_test(NAME test_jsoncpp_var COMMAND test_jsoncpp_var) diff --git a/Tests/FindJsonCpp/Test/main.cxx b/Tests/FindJsonCpp/Test/main.cxx new file mode 100644 index 0000000..0fefe32 --- /dev/null +++ b/Tests/FindJsonCpp/Test/main.cxx @@ -0,0 +1,8 @@ +#include <json/json.h> + +int main() +{ + int zero = 0; + Json::Value value(zero); + return value.asInt(); +} diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index 5849417..b5e46c0 100644 --- a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt +++ b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt @@ -11,7 +11,7 @@ get_property(c_known_features GLOBAL PROPERTY CMAKE_C_KNOWN_FEATURES) write_compiler_detection_header( FILE "${CMAKE_CURRENT_BINARY_DIR}/test_compiler_detection.h" PREFIX TEST - COMPILERS GNU Clang AppleClang + COMPILERS GNU Clang AppleClang SunPro VERSION 3.1 PROLOG "// something" EPILOG "// more" @@ -60,7 +60,8 @@ endmacro() if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" - OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" + OR CMAKE_CXX_COMPILER_ID STREQUAL "SunPro") # False for C++98 mode. list(APPEND false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) @@ -83,7 +84,7 @@ write_compiler_detection_header( PREFIX MULTI OUTPUT_FILES_VAR multi_files OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/compiler_multi_files/compiler_support" - COMPILERS GNU Clang AppleClang + COMPILERS GNU Clang AppleClang SunPro VERSION 3.1 FEATURES ${cxx_known_features} ${c_known_features} diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 1697025..3a61751 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -52,6 +52,7 @@ add_RunCMake_test(CMP0053) add_RunCMake_test(CMP0054) add_RunCMake_test(CMP0055) add_RunCMake_test(CTest) +add_RunCMake_test(CTestSubmit) if(NOT CMake_TEST_EXTERNAL_CMAKE) add_RunCMake_test(CTestMemcheck diff --git a/Tests/RunCMake/CTestSubmit/BadArg-result.txt b/Tests/RunCMake/CTestSubmit/BadArg-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/BadArg-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/BadArg-stderr.txt b/Tests/RunCMake/CTestSubmit/BadArg-stderr.txt new file mode 100644 index 0000000..68812ab --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/BadArg-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at .*/Tests/RunCMake/CTestSubmit/BadArg/test.cmake:[0-9]+ \(ctest_submit\): + ctest_submit called with unknown argument "bad-arg". diff --git a/Tests/RunCMake/CTestSubmit/BadFILES-result.txt b/Tests/RunCMake/CTestSubmit/BadFILES-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/BadFILES-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/BadFILES-stderr.txt b/Tests/RunCMake/CTestSubmit/BadFILES-stderr.txt new file mode 100644 index 0000000..703224b --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/BadFILES-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at .*/Tests/RunCMake/CTestSubmit/BadFILES/test.cmake:[0-9]+ \(ctest_submit\): + File "bad-file" does not exist. Cannot submit a non-existent file. diff --git a/Tests/RunCMake/CTestSubmit/BadPARTS-result.txt b/Tests/RunCMake/CTestSubmit/BadPARTS-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/BadPARTS-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/BadPARTS-stderr.txt b/Tests/RunCMake/CTestSubmit/BadPARTS-stderr.txt new file mode 100644 index 0000000..4e491a9 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/BadPARTS-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at .*/Tests/RunCMake/CTestSubmit/BadPARTS/test.cmake:[0-9]+ \(ctest_submit\): + Part name "bad-part" is invalid. diff --git a/Tests/RunCMake/CTestSubmit/CMakeLists.txt.in b/Tests/RunCMake/CTestSubmit/CMakeLists.txt.in new file mode 100644 index 0000000..96e6c13 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CMakeLists.txt.in @@ -0,0 +1,4 @@ +cmake_minimum_required(VERSION 3.1) +project(CTestSubmit@CASE_NAME@ NONE) +include(CTest) +add_test(NAME RunCMakeVersion COMMAND "${CMAKE_COMMAND}" --version) diff --git a/Tests/RunCMake/CTestSubmit/CTestConfig.cmake.in b/Tests/RunCMake/CTestSubmit/CTestConfig.cmake.in new file mode 100644 index 0000000..378a85a --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CTestConfig.cmake.in @@ -0,0 +1,6 @@ +set(CTEST_PROJECT_NAME "CTestSubmit@CASE_NAME@") + +# Intentionally leave out other upload-related CTestConfig.cmake settings +# so that any ctest_submit calls fail with an error message. +set(CTEST_DROP_METHOD "@CASE_DROP_METHOD@") +set(CTEST_DROP_SITE "@CASE_DROP_SITE@") diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-cp-result.txt b/Tests/RunCMake/CTestSubmit/FailDrop-cp-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/FailDrop-cp-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-cp-stderr.txt b/Tests/RunCMake/CTestSubmit/FailDrop-cp-stderr.txt new file mode 100644 index 0000000..b451315 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/FailDrop-cp-stderr.txt @@ -0,0 +1,4 @@ +Missing arguments for submit via cp: +.* + Problems when submitting via CP +Error in read script: .*/Tests/RunCMake/CTestSubmit/FailDrop-cp/test.cmake diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-cp-stdout.txt b/Tests/RunCMake/CTestSubmit/FailDrop-cp-stdout.txt new file mode 100644 index 0000000..fa6e004 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/FailDrop-cp-stdout.txt @@ -0,0 +1 @@ +Submit files \(using cp\) diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-ftp-result.txt b/Tests/RunCMake/CTestSubmit/FailDrop-ftp-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/FailDrop-ftp-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-ftp-stderr.txt b/Tests/RunCMake/CTestSubmit/FailDrop-ftp-stderr.txt new file mode 100644 index 0000000..a622fac --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/FailDrop-ftp-stderr.txt @@ -0,0 +1,3 @@ +Error message was: .* + Problems when submitting via FTP +Error in read script: .*/Tests/RunCMake/CTestSubmit/FailDrop-ftp/test.cmake diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-ftp-stdout.txt b/Tests/RunCMake/CTestSubmit/FailDrop-ftp-stdout.txt new file mode 100644 index 0000000..345bb62 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/FailDrop-ftp-stdout.txt @@ -0,0 +1,3 @@ +Submit files \(using ftp\) + Using FTP submit method + Drop site: ftp:// diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-http-result.txt b/Tests/RunCMake/CTestSubmit/FailDrop-http-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/FailDrop-http-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-http-stderr.txt b/Tests/RunCMake/CTestSubmit/FailDrop-http-stderr.txt new file mode 100644 index 0000000..6870d2e --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/FailDrop-http-stderr.txt @@ -0,0 +1,3 @@ +Error message was: .* + Problems when submitting via HTTP +Error in read script: .*/Tests/RunCMake/CTestSubmit/FailDrop-http/test.cmake diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-http-stdout.txt b/Tests/RunCMake/CTestSubmit/FailDrop-http-stdout.txt new file mode 100644 index 0000000..c7f35c5 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/FailDrop-http-stdout.txt @@ -0,0 +1,3 @@ +Submit files \(using http\) + Using HTTP submit method + Drop site:http:// diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-https-result.txt b/Tests/RunCMake/CTestSubmit/FailDrop-https-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/FailDrop-https-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-https-stderr.txt b/Tests/RunCMake/CTestSubmit/FailDrop-https-stderr.txt new file mode 100644 index 0000000..a3c0cd5 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/FailDrop-https-stderr.txt @@ -0,0 +1,3 @@ +Error message was: .* + Problems when submitting via HTTP +Error in read script: .*/Tests/RunCMake/CTestSubmit/FailDrop-https/test.cmake diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-https-stdout.txt b/Tests/RunCMake/CTestSubmit/FailDrop-https-stdout.txt new file mode 100644 index 0000000..19f8234 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/FailDrop-https-stdout.txt @@ -0,0 +1,3 @@ +Submit files \(using https\) + Using HTTP submit method + Drop site:https:// diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-scp-result.txt b/Tests/RunCMake/CTestSubmit/FailDrop-scp-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/FailDrop-scp-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-scp-stderr.txt b/Tests/RunCMake/CTestSubmit/FailDrop-scp-stderr.txt new file mode 100644 index 0000000..42b8f50 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/FailDrop-scp-stderr.txt @@ -0,0 +1,2 @@ + Problems when submitting via SCP +Error in read script: .*/Tests/RunCMake/CTestSubmit/FailDrop-scp/test.cmake diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-scp-stdout.txt b/Tests/RunCMake/CTestSubmit/FailDrop-scp-stdout.txt new file mode 100644 index 0000000..ec2ce92 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/FailDrop-scp-stdout.txt @@ -0,0 +1 @@ +Submit files \(using scp\) diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-result.txt b/Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stderr.txt b/Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stderr.txt new file mode 100644 index 0000000..020b615 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stderr.txt @@ -0,0 +1,2 @@ + (Problems when submitting via XML-RPC|Submission method "xmlrpc" not compiled into CTest!) +Error in read script: .*/Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc/test.cmake diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stdout.txt b/Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stdout.txt new file mode 100644 index 0000000..ed2acb5 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stdout.txt @@ -0,0 +1 @@ +Submit files \(using xmlrpc\) diff --git a/Tests/RunCMake/CTestSubmit/RepeatRETURN_VALUE-result.txt b/Tests/RunCMake/CTestSubmit/RepeatRETURN_VALUE-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/RepeatRETURN_VALUE-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/RepeatRETURN_VALUE-stderr.txt b/Tests/RunCMake/CTestSubmit/RepeatRETURN_VALUE-stderr.txt new file mode 100644 index 0000000..d56793e --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/RepeatRETURN_VALUE-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at .*/Tests/RunCMake/CTestSubmit/RepeatRETURN_VALUE/test.cmake:[0-9]+ \(ctest_submit\): + Called with more than one value for RETURN_VALUE diff --git a/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake b/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake new file mode 100644 index 0000000..3638007 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake @@ -0,0 +1,49 @@ +include(RunCMake) + +# Default case parameters. +set(CASE_DROP_METHOD "http") +set(CASE_DROP_SITE "-no-site-") +set(CASE_CTEST_SUBMIT_ARGS "") + +function(run_ctest CASE_NAME) + configure_file(${RunCMake_SOURCE_DIR}/test.cmake.in + ${RunCMake_BINARY_DIR}/${CASE_NAME}/test.cmake @ONLY) + configure_file(${RunCMake_SOURCE_DIR}/CTestConfig.cmake.in + ${RunCMake_BINARY_DIR}/${CASE_NAME}/CTestConfig.cmake @ONLY) + configure_file(${RunCMake_SOURCE_DIR}/CMakeLists.txt.in + ${RunCMake_BINARY_DIR}/${CASE_NAME}/CMakeLists.txt @ONLY) + run_cmake_command(${CASE_NAME} ${CMAKE_CTEST_COMMAND} + -C Debug + -S ${RunCMake_BINARY_DIR}/${CASE_NAME}/test.cmake + -V + --output-log ${RunCMake_BINARY_DIR}/${CASE_NAME}-build/testOutput.log + ${ARGN} + ) +endfunction() + +#----------------------------------------------------------------------------- +# Test bad argument combinations. + +function(run_ctest_submit CASE_NAME) + set(CASE_CTEST_SUBMIT_ARGS "${ARGN}") + run_ctest(${CASE_NAME}) +endfunction() + +run_ctest_submit(BadArg bad-arg) +run_ctest_submit(BadPARTS PARTS bad-part) +run_ctest_submit(BadFILES FILES bad-file) +run_ctest_submit(RepeatRETURN_VALUE RETURN_VALUE res RETURN_VALUE res) + +#----------------------------------------------------------------------------- +# Test failed drops by various protocols + +function(run_ctest_submit_FailDrop CASE_DROP_METHOD) + run_ctest(FailDrop-${CASE_DROP_METHOD}) +endfunction() + +run_ctest_submit_FailDrop(cp) +run_ctest_submit_FailDrop(ftp) +run_ctest_submit_FailDrop(http) +run_ctest_submit_FailDrop(https) +run_ctest_submit_FailDrop(scp) +run_ctest_submit_FailDrop(xmlrpc) diff --git a/Tests/RunCMake/CTestSubmit/test.cmake.in b/Tests/RunCMake/CTestSubmit/test.cmake.in new file mode 100644 index 0000000..ba826f1 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/test.cmake.in @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.1) + +set(CTEST_SITE "test-site") +set(CTEST_BUILD_NAME "test-build-name") +set(CTEST_SOURCE_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@") +set(CTEST_BINARY_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@-build") +set(CTEST_CMAKE_GENERATOR "@RunCMake_GENERATOR@") +set(CTEST_CMAKE_GENERATOR_PLATFORM "@RunCMake_GENERATOR_PLATFORM@") +set(CTEST_CMAKE_GENERATOR_TOOLSET "@RunCMake_GENERATOR_TOOLSET@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") + +ctest_start(Experimental) +ctest_configure() + +set(ctest_submit_args "@CASE_CTEST_SUBMIT_ARGS@") +ctest_submit(${ctest_submit_args}) diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-mtime1-result.txt b/Tests/RunCMake/CommandLine/E_tar-bad-mtime1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-bad-mtime1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-mtime1-stderr.txt b/Tests/RunCMake/CommandLine/E_tar-bad-mtime1-stderr.txt new file mode 100644 index 0000000..ca925f1 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-bad-mtime1-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: unable to parse mtime 'bad' +CMake Error: Problem creating tar: bad.tar$ diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-opt1-result.txt b/Tests/RunCMake/CommandLine/E_tar-bad-opt1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-bad-opt1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-opt1-stderr.txt b/Tests/RunCMake/CommandLine/E_tar-bad-opt1-stderr.txt new file mode 100644 index 0000000..35133c8 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-bad-opt1-stderr.txt @@ -0,0 +1 @@ +^CMake Error: Unknown option to -E tar: --bad$ diff --git a/Tests/RunCMake/CommandLine/E_tar-end-opt1-result.txt b/Tests/RunCMake/CommandLine/E_tar-end-opt1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-end-opt1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_tar-end-opt1-stderr.txt b/Tests/RunCMake/CommandLine/E_tar-end-opt1-stderr.txt new file mode 100644 index 0000000..1fddf6d --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-end-opt1-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: archive_read_disk_entry_from_file '--bad':.* +CMake Error: Problem creating tar: bad.tar$ diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index 0c43c20..2994f16 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -1,5 +1,11 @@ include(RunCMake) +run_cmake_command(E_tar-bad-opt1 ${CMAKE_COMMAND} -E tar cvf bad.tar --bad) +run_cmake_command(E_tar-bad-mtime1 ${CMAKE_COMMAND} -E tar cvf bad.tar --mtime=bad .) +run_cmake_command(E_tar-end-opt1 ${CMAKE_COMMAND} -E tar cvf bad.tar -- --bad) +run_cmake_command(E_tar-end-opt2 ${CMAKE_COMMAND} -E tar cvf bad.tar --) +run_cmake_command(E_tar-mtime ${CMAKE_COMMAND} -E tar cvf bad.tar "--mtime=1970-01-01 00:00:00 UTC") + run_cmake_command(build-no-cache ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}) run_cmake_command(build-no-generator |