summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt43
-rw-r--r--Tests/RunCMake/CommandLine/E___run_co_compile-bad-iwyu-result.txt (renamed from Tests/RunCMake/CommandLine/E___run_iwyu-no-iwyu-result.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/E___run_co_compile-bad-iwyu-stderr.txt (renamed from Tests/RunCMake/CommandLine/E___run_iwyu-bad-iwyu-stderr.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/E___run_co_compile-no----result.txt (renamed from Tests/RunCMake/CommandLine/E___run_iwyu-no-cc-result.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/E___run_co_compile-no----stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E___run_co_compile-no-cc-result.txt (renamed from Tests/RunCMake/CommandLine/E___run_iwyu-no----result.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/E___run_co_compile-no-cc-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E___run_co_compile-no-iwyu-result.txt (renamed from Tests/RunCMake/CommandLine/E___run_iwyu-bad-iwyu-result.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/E___run_co_compile-no-iwyu-stderr.txt5
-rw-r--r--Tests/RunCMake/CommandLine/E___run_iwyu-no----stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E___run_iwyu-no-cc-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E___run_iwyu-no-iwyu-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake8
-rw-r--r--Tests/RunCMake/Cppcheck/C-bad-Build-result.txt1
-rw-r--r--Tests/RunCMake/Cppcheck/C-bad-Build-stdout.txt2
-rw-r--r--Tests/RunCMake/Cppcheck/C-bad.cmake3
-rw-r--r--Tests/RunCMake/Cppcheck/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/FPHSA/RunCMakeTest.cmake8
-rw-r--r--Tests/RunCMake/README.rst4
-rw-r--r--Tests/RunCMake/get_filename_component/KnownComponents.cmake11
-rw-r--r--Tests/RunCMake/pseudo_cppcheck.c13
-rw-r--r--Tests/SameName/CMakeLists.txt7
-rw-r--r--Tests/SameName/Exe1/CMakeLists.txt11
-rw-r--r--Tests/SameName/Exe1/conly.c11
-rw-r--r--Tests/SameName/Lib1/CMakeLists.txt1
-rw-r--r--Tests/SameName/Lib1/libc1.c4
-rw-r--r--Tests/SameName/Lib1/libc1.h1
-rw-r--r--Tests/SimpleExclude/CMakeLists.txt11
-rw-r--r--Tests/SimpleExclude/dirC/CMakeLists.txt3
-rw-r--r--Tests/SimpleExclude/dirC/dirA/CMakeLists.txt10
-rw-r--r--Tests/SimpleExclude/dirC/dirA/t1.c8
-rw-r--r--Tests/SimpleExclude/dirC/dirA/t2.c7
-rw-r--r--Tests/SimpleExclude/dirC/dirA/t3.c7
-rw-r--r--Tests/SimpleExclude/dirC/dirA/t4.c17
-rw-r--r--Tests/SimpleExclude/dirC/dirA/t5.c7
-rw-r--r--Tests/SimpleExclude/dirC/dirB/CMakeLists.txt5
-rw-r--r--Tests/SimpleExclude/dirC/dirB/t6.c8
-rw-r--r--Tests/SimpleExclude/dirC/dirB/t7.c15
-rw-r--r--Tests/SimpleExclude/dirD/CMakeLists.txt7
-rw-r--r--Tests/SimpleExclude/dirD/t8.c7
-rw-r--r--Tests/SimpleExclude/dirD/t9.c24
-rw-r--r--Tests/SimpleExclude/run.cmake.in13
-rw-r--r--Tests/VSGNUFortran/runtest.cmake.in2
43 files changed, 57 insertions, 233 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 640b542..ce53454 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -268,7 +268,7 @@ if(BUILD_TESTING)
endif()
add_test(NAME CMake.Copyright
- COMMAND cmake -P ${CMAKE_CURRENT_SOURCE_DIR}/CMakeCopyright.cmake)
+ COMMAND ${CMAKE_CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/CMakeCopyright.cmake)
# add a bunch of standard build-and-test style tests
ADD_TEST_MACRO(CommandLineTest CommandLineTest)
@@ -329,7 +329,7 @@ if(BUILD_TESTING)
set(CMAKE_SKIP_VSGNUFortran TRUE)
endif()
if(NOT CMAKE_SKIP_VSGNUFortran)
- ADD_TEST_MACRO(VSGNUFortran ${CMAKE_COMMAND} -P runtest.cmake)
+ ADD_TEST_MACRO(VSGNUFortran ${CMAKE_CMAKE_COMMAND} -P runtest.cmake)
endif()
endif()
@@ -813,31 +813,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommandWorkingDirectory")
- #add_test(SimpleExclude ${CMAKE_CTEST_COMMAND}
- # --build-and-test
- # "${CMake_SOURCE_DIR}/Tests/SimpleExclude"
- # "${CMake_BINARY_DIR}/Tests/SimpleExclude"
- # ${build_generator_args}
- # --build-project SimpleExclude
- # --build-two-config
- # --build-options ${build_options}
- # --test-command t4
- #--test-command "${CMAKE_COMMAND}"
- #"-DCONFIGURATION=\${CTEST_CONFIGURATION_TYPE}"
- #-P "${CMake_BINARY_DIR}/Tests/SimpleExclude/run.cmake"
- #)
-
-# add_test(SameName ${CMAKE_CTEST_COMMAND}
-# --build-and-test
-# "${CMake_SOURCE_DIR}/Tests/SameName"
-# "${CMake_BINARY_DIR}/Tests/SameName"
-# ${build_generator_args}
-# --build-project SameName
-# --build-two-config
-# --build-options ${build_options}
-# --test-command
-# "${CMake_BINARY_DIR}/Tests/SameName/Exe1/mytest2")
-
add_test(OutOfSource ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/OutOfSource"
@@ -2666,7 +2641,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
file(COPY "${CMake_SOURCE_DIR}/Tests/MumpsCoverage/VistA-FOIA"
DESTINATION "${CMake_BINARY_DIR}/Testing/MumpsCoverage")
add_test(NAME CTestGTMCoverage
- COMMAND cmake -E chdir
+ COMMAND ${CMAKE_CMAKE_COMMAND} -E chdir
${CMake_BINARY_DIR}/Testing/MumpsCoverage
$<TARGET_FILE:ctest> -T Coverage --debug)
set_tests_properties(CTestGTMCoverage PROPERTIES
@@ -2684,7 +2659,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
file(COPY "${CMake_SOURCE_DIR}/Tests/MumpsCoverage/VistA-FOIA"
DESTINATION "${CMake_BINARY_DIR}/Testing/MumpsCacheCoverage")
add_test(NAME CTestCacheCoverage
- COMMAND cmake -E chdir
+ COMMAND ${CMAKE_CMAKE_COMMAND} -E chdir
${CMake_BINARY_DIR}/Testing/MumpsCacheCoverage
$<TARGET_FILE:ctest> -T Coverage --debug)
set_tests_properties(CTestCacheCoverage PROPERTIES
@@ -2702,7 +2677,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
file(COPY "${CMake_SOURCE_DIR}/Tests/PythonCoverage/coveragetest"
DESTINATION "${CMake_BINARY_DIR}/Testing/PythonCoverage")
add_test(NAME CTestPythonCoverage
- COMMAND cmake -E chdir
+ COMMAND ${CMAKE_CMAKE_COMMAND} -E chdir
${CMake_BINARY_DIR}/Testing/PythonCoverage
$<TARGET_FILE:ctest> -T Coverage --debug)
set_tests_properties(CTestPythonCoverage PROPERTIES
@@ -2720,7 +2695,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
file(COPY "${CMake_SOURCE_DIR}/Tests/CoberturaCoverage/src"
DESTINATION "${CMake_BINARY_DIR}/Testing/CoberturaCoverage")
add_test(NAME CTestCoberturaCoverage
- COMMAND cmake -E chdir
+ COMMAND ${CMAKE_CMAKE_COMMAND} -E chdir
${CMake_BINARY_DIR}/Testing/CoberturaCoverage
$<TARGET_FILE:ctest> -T Coverage --debug)
set_tests_properties(CTestCoberturaCoverage PROPERTIES
@@ -2739,7 +2714,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
configure_file("${CMake_BINARY_DIR}/Testing/JacocoCoverage/Coverage/target/site/jacoco.xml.in"
"${CMake_BINARY_DIR}/Testing/JacocoCoverage/Coverage/target/site/jacoco.xml")
add_test(NAME CTestJacocoCoverage
- COMMAND cmake -E chdir
+ COMMAND ${CMAKE_CMAKE_COMMAND} -E chdir
${CMake_BINARY_DIR}/Testing/JacocoCoverage
$<TARGET_FILE:ctest> -T Coverage --debug)
set_tests_properties(CTestJacocoCoverage PROPERTIES
@@ -2758,7 +2733,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
DESTINATION "${CMake_BINARY_DIR}/Testing/JavascriptCoverage"
FILES_MATCHING PATTERN "*.js")
add_test(NAME CTestJavascriptCoverage
- COMMAND cmake -E chdir
+ COMMAND ${CMAKE_CMAKE_COMMAND} -E chdir
${CMake_BINARY_DIR}/Testing/JavascriptCoverage
$<TARGET_FILE:ctest> -T Coverage --debug)
set_tests_properties(CTestJavascriptCoverage PROPERTIES
@@ -2776,7 +2751,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
"${CMake_SOURCE_DIR}/Tests/DelphiCoverage/UTCovTest(UTCovTest.pas).html.in"
"${CMake_BINARY_DIR}/Testing/DelphiCoverage/UTCovTest(UTCovTest.pas).html")
add_test(NAME CTestDelphiCoverage
- COMMAND cmake -E chdir
+ COMMAND ${CMAKE_CMAKE_COMMAND} -E chdir
${CMake_BINARY_DIR}/Testing/DelphiCoverage
$<TARGET_FILE:ctest> -T Coverage --debug)
set_tests_properties(CTestDelphiCoverage PROPERTIES
diff --git a/Tests/RunCMake/CommandLine/E___run_iwyu-no-iwyu-result.txt b/Tests/RunCMake/CommandLine/E___run_co_compile-bad-iwyu-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/CommandLine/E___run_iwyu-no-iwyu-result.txt
+++ b/Tests/RunCMake/CommandLine/E___run_co_compile-bad-iwyu-result.txt
diff --git a/Tests/RunCMake/CommandLine/E___run_iwyu-bad-iwyu-stderr.txt b/Tests/RunCMake/CommandLine/E___run_co_compile-bad-iwyu-stderr.txt
index 338f7c4..338f7c4 100644
--- a/Tests/RunCMake/CommandLine/E___run_iwyu-bad-iwyu-stderr.txt
+++ b/Tests/RunCMake/CommandLine/E___run_co_compile-bad-iwyu-stderr.txt
diff --git a/Tests/RunCMake/CommandLine/E___run_iwyu-no-cc-result.txt b/Tests/RunCMake/CommandLine/E___run_co_compile-no----result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/CommandLine/E___run_iwyu-no-cc-result.txt
+++ b/Tests/RunCMake/CommandLine/E___run_co_compile-no----result.txt
diff --git a/Tests/RunCMake/CommandLine/E___run_co_compile-no----stderr.txt b/Tests/RunCMake/CommandLine/E___run_co_compile-no----stderr.txt
new file mode 100644
index 0000000..f0597d2
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E___run_co_compile-no----stderr.txt
@@ -0,0 +1 @@
+^__run_co_compile given unknown argument: command-does-not-exist$
diff --git a/Tests/RunCMake/CommandLine/E___run_iwyu-no----result.txt b/Tests/RunCMake/CommandLine/E___run_co_compile-no-cc-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/CommandLine/E___run_iwyu-no----result.txt
+++ b/Tests/RunCMake/CommandLine/E___run_co_compile-no-cc-result.txt
diff --git a/Tests/RunCMake/CommandLine/E___run_co_compile-no-cc-stderr.txt b/Tests/RunCMake/CommandLine/E___run_co_compile-no-cc-stderr.txt
new file mode 100644
index 0000000..bba846e
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E___run_co_compile-no-cc-stderr.txt
@@ -0,0 +1 @@
+^__run_co_compile missing compile command after --$
diff --git a/Tests/RunCMake/CommandLine/E___run_iwyu-bad-iwyu-result.txt b/Tests/RunCMake/CommandLine/E___run_co_compile-no-iwyu-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/CommandLine/E___run_iwyu-bad-iwyu-result.txt
+++ b/Tests/RunCMake/CommandLine/E___run_co_compile-no-iwyu-result.txt
diff --git a/Tests/RunCMake/CommandLine/E___run_co_compile-no-iwyu-stderr.txt b/Tests/RunCMake/CommandLine/E___run_co_compile-no-iwyu-stderr.txt
new file mode 100644
index 0000000..ffa1da8
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E___run_co_compile-no-iwyu-stderr.txt
@@ -0,0 +1,5 @@
+^__run_co_compile missing command to run. Looking for one of the following:
+.*--cppcheck=
+.*--cpplint=
+.*--iwyu=
+.*--tidy=
diff --git a/Tests/RunCMake/CommandLine/E___run_iwyu-no----stderr.txt b/Tests/RunCMake/CommandLine/E___run_iwyu-no----stderr.txt
deleted file mode 100644
index c251adf..0000000
--- a/Tests/RunCMake/CommandLine/E___run_iwyu-no----stderr.txt
+++ /dev/null
@@ -1 +0,0 @@
-^__run_iwyu given unknown argument: command-does-not-exist$
diff --git a/Tests/RunCMake/CommandLine/E___run_iwyu-no-cc-stderr.txt b/Tests/RunCMake/CommandLine/E___run_iwyu-no-cc-stderr.txt
deleted file mode 100644
index 1998abb..0000000
--- a/Tests/RunCMake/CommandLine/E___run_iwyu-no-cc-stderr.txt
+++ /dev/null
@@ -1 +0,0 @@
-^__run_iwyu missing compile command after --$
diff --git a/Tests/RunCMake/CommandLine/E___run_iwyu-no-iwyu-stderr.txt b/Tests/RunCMake/CommandLine/E___run_iwyu-no-iwyu-stderr.txt
deleted file mode 100644
index 9db95f8..0000000
--- a/Tests/RunCMake/CommandLine/E___run_iwyu-no-iwyu-stderr.txt
+++ /dev/null
@@ -1 +0,0 @@
-^__run_iwyu missing --cpplint=, --iwyu=, --lwyu=, --cppcheck= and/or --tidy=$
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index 6efcc12..55eac5e 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -21,10 +21,10 @@ run_cmake_command(E_touch_nocreate-no-arg ${CMAKE_COMMAND} -E touch_nocreate)
run_cmake_command(E_time ${CMAKE_COMMAND} -E time ${CMAKE_COMMAND} -E echo "hello world")
run_cmake_command(E_time-no-arg ${CMAKE_COMMAND} -E time)
-run_cmake_command(E___run_iwyu-no-iwyu ${CMAKE_COMMAND} -E __run_iwyu -- command-does-not-exist)
-run_cmake_command(E___run_iwyu-bad-iwyu ${CMAKE_COMMAND} -E __run_iwyu --iwyu=iwyu-does-not-exist -- command-does-not-exist)
-run_cmake_command(E___run_iwyu-no--- ${CMAKE_COMMAND} -E __run_iwyu --iwyu=iwyu-does-not-exist command-does-not-exist)
-run_cmake_command(E___run_iwyu-no-cc ${CMAKE_COMMAND} -E __run_iwyu --iwyu=iwyu-does-not-exist --)
+run_cmake_command(E___run_co_compile-no-iwyu ${CMAKE_COMMAND} -E __run_co_compile -- command-does-not-exist)
+run_cmake_command(E___run_co_compile-bad-iwyu ${CMAKE_COMMAND} -E __run_co_compile --iwyu=iwyu-does-not-exist -- command-does-not-exist)
+run_cmake_command(E___run_co_compile-no--- ${CMAKE_COMMAND} -E __run_co_compile --iwyu=iwyu-does-not-exist command-does-not-exist)
+run_cmake_command(E___run_co_compile-no-cc ${CMAKE_COMMAND} -E __run_co_compile --iwyu=iwyu-does-not-exist --)
run_cmake_command(G_no-arg ${CMAKE_COMMAND} -G)
run_cmake_command(G_bad-arg ${CMAKE_COMMAND} -G NoSuchGenerator)
diff --git a/Tests/RunCMake/Cppcheck/C-bad-Build-result.txt b/Tests/RunCMake/Cppcheck/C-bad-Build-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/Cppcheck/C-bad-Build-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/Cppcheck/C-bad-Build-stdout.txt b/Tests/RunCMake/Cppcheck/C-bad-Build-stdout.txt
new file mode 100644
index 0000000..2370ce1
--- /dev/null
+++ b/Tests/RunCMake/Cppcheck/C-bad-Build-stdout.txt
@@ -0,0 +1,2 @@
+stdout from bad command line arg '-bad'
+stderr from bad command line arg '-bad'
diff --git a/Tests/RunCMake/Cppcheck/C-bad.cmake b/Tests/RunCMake/Cppcheck/C-bad.cmake
new file mode 100644
index 0000000..920e4b4
--- /dev/null
+++ b/Tests/RunCMake/Cppcheck/C-bad.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+set(CMAKE_C_CPPCHECK "${PSEUDO_CPPCHECK}" -bad)
+add_executable(main main.c)
diff --git a/Tests/RunCMake/Cppcheck/RunCMakeTest.cmake b/Tests/RunCMake/Cppcheck/RunCMakeTest.cmake
index ae14f8c..5fd4ead 100644
--- a/Tests/RunCMake/Cppcheck/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Cppcheck/RunCMakeTest.cmake
@@ -15,6 +15,7 @@ endfunction()
run_cppcheck(C)
run_cppcheck(CXX)
+run_cppcheck(C-bad)
if(NOT RunCMake_GENERATOR STREQUAL "Watcom WMake")
run_cppcheck(C-launch)
diff --git a/Tests/RunCMake/FPHSA/RunCMakeTest.cmake b/Tests/RunCMake/FPHSA/RunCMakeTest.cmake
index 1b71a31..dd73cd4 100644
--- a/Tests/RunCMake/FPHSA/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FPHSA/RunCMakeTest.cmake
@@ -9,13 +9,13 @@ run_cmake(BadFoundVar)
set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" "-DPseudo_VERSION=0")
run_cmake(any_version_find_0)
-# Find a package with more customary version number, without requestion a specific version and in
+# Find a package with more customary version number, without requesting a specific version and in
# the presence of a cache variable VERSION.
-set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" "-DPseudoNoVersionVar_VERSION=1.2.3.4.5_SHOULD_BE_IGNORED" "-DVERSION=BAD_VERSION")
+set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" "-DPseudoNoVersionVar_VERSION=1.2.3.4_SHOULD_BE_IGNORED" "-DVERSION=BAD_VERSION")
run_cmake(any_version_VERSION_cache_variable)
-# Find a package with a more customary version number, without requestion a specific version.
-set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" "-DPseudo_VERSION=1.2.3.4.5")
+# Find a package with a more customary version number, without requesting a specific version.
+set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" "-DPseudo_VERSION=1.2.3.4")
run_cmake(any_version)
# test EXACT mode with every subcomponent
diff --git a/Tests/RunCMake/README.rst b/Tests/RunCMake/README.rst
index 4aae4ae..08b51d9 100644
--- a/Tests/RunCMake/README.rst
+++ b/Tests/RunCMake/README.rst
@@ -47,11 +47,11 @@ but do not actually build anything. To add a test:
containing expected test results:
``<SubTest>-result.txt``
- Process result expected if not "0"
+ Regex matching expected process result, if not ``0``
``<SubTest>-stdout.txt``
Regex matching expected stdout content
``<SubTest>-stderr.txt``
- Regex matching expected stderr content, if not "^$"
+ Regex matching expected stderr content, if not ``^$``
``<SubTest>-check.cmake``
Custom result check.
diff --git a/Tests/RunCMake/get_filename_component/KnownComponents.cmake b/Tests/RunCMake/get_filename_component/KnownComponents.cmake
index 7dfb55d..ac77ac3 100644
--- a/Tests/RunCMake/get_filename_component/KnownComponents.cmake
+++ b/Tests/RunCMake/get_filename_component/KnownComponents.cmake
@@ -80,6 +80,17 @@ get_filename_component(test_program_name "/ arg1 arg2" PROGRAM
check("PROGRAM with args output: name" "${test_program_name}" "/")
check("PROGRAM with args output: args" "${test_program_args}" " arg1 arg2")
+get_filename_component(test_program_name " " PROGRAM)
+check("PROGRAM with just a space" "${test_program_name}" "")
+
+get_filename_component(test_program_name "${CMAKE_CURRENT_LIST_FILE}" PROGRAM)
+check("PROGRAM specified explicitly without quoting" "${test_program_name}" "${CMAKE_CURRENT_LIST_FILE}")
+
+get_filename_component(test_program_name "\"${CMAKE_CURRENT_LIST_FILE}\" arg1 arg2" PROGRAM
+ PROGRAM_ARGS test_program_args)
+check("PROGRAM specified explicitly with arguments: name" "${test_program_name}" "${CMAKE_CURRENT_LIST_FILE}")
+check("PROGRAM specified explicitly with arguments: args" "${test_program_args}" " arg1 arg2")
+
list(APPEND non_cache_vars test_program_name)
list(APPEND non_cache_vars test_program_args)
diff --git a/Tests/RunCMake/pseudo_cppcheck.c b/Tests/RunCMake/pseudo_cppcheck.c
index 32e6e28..8667e5e 100644
--- a/Tests/RunCMake/pseudo_cppcheck.c
+++ b/Tests/RunCMake/pseudo_cppcheck.c
@@ -1,7 +1,18 @@
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
-int main(void)
+int main(int argc, char* argv[])
{
+ int i;
+ for (i = 1; i < argc; ++i) {
+ if (strcmp(argv[i], "-bad") == 0)
+ if (strcmp(argv[i], "-bad") == 0) {
+ fprintf(stdout, "stdout from bad command line arg '-bad'\n");
+ fprintf(stderr, "stderr from bad command line arg '-bad'\n");
+ return 1;
+ }
+ }
fprintf(stderr,
"[/foo/bar.c:2]: (error) Array 'abc[10]' accessed at index 12,"
" which is out of bounds.\n");
diff --git a/Tests/SameName/CMakeLists.txt b/Tests/SameName/CMakeLists.txt
deleted file mode 100644
index d78879d..0000000
--- a/Tests/SameName/CMakeLists.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-cmake_minimum_required (VERSION 2.6)
-project(SameName C)
-
-add_subdirectory(Lib1)
-
-include_directories(${PROJECT_SOURCE_DIR}/Lib1)
-add_subdirectory(Exe1)
diff --git a/Tests/SameName/Exe1/CMakeLists.txt b/Tests/SameName/Exe1/CMakeLists.txt
deleted file mode 100644
index b9182f2..0000000
--- a/Tests/SameName/Exe1/CMakeLists.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-# a target with the same name as a target in a different dir
-add_executable(mytest_exe conly.c)
-set_target_properties(mytest_exe PROPERTIES OUTPUT_NAME mytest)
-target_link_libraries(mytest_exe mytest)
-
-# and two targets in the same dir with the same name
-add_library(mytest2 ../Lib1/libc1.c)
-
-add_executable(mytest2_exe conly.c)
-set_target_properties(mytest2_exe PROPERTIES OUTPUT_NAME mytest2)
-target_link_libraries(mytest2_exe mytest2)
diff --git a/Tests/SameName/Exe1/conly.c b/Tests/SameName/Exe1/conly.c
deleted file mode 100644
index 8f2ce05..0000000
--- a/Tests/SameName/Exe1/conly.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "libc1.h"
-#include <stdio.h>
-
-int main()
-{
- if (LibC1Func() != 2.0) {
- printf("Problem with libc1\n");
- return 1;
- }
- return 0;
-}
diff --git a/Tests/SameName/Lib1/CMakeLists.txt b/Tests/SameName/Lib1/CMakeLists.txt
deleted file mode 100644
index 40fa154..0000000
--- a/Tests/SameName/Lib1/CMakeLists.txt
+++ /dev/null
@@ -1 +0,0 @@
-add_library(mytest libc1.c)
diff --git a/Tests/SameName/Lib1/libc1.c b/Tests/SameName/Lib1/libc1.c
deleted file mode 100644
index b01e1e1..0000000
--- a/Tests/SameName/Lib1/libc1.c
+++ /dev/null
@@ -1,4 +0,0 @@
-float LibC1Func()
-{
- return 2.0;
-}
diff --git a/Tests/SameName/Lib1/libc1.h b/Tests/SameName/Lib1/libc1.h
deleted file mode 100644
index 84c94a9..0000000
--- a/Tests/SameName/Lib1/libc1.h
+++ /dev/null
@@ -1 +0,0 @@
-extern float LibC1Func();
diff --git a/Tests/SimpleExclude/CMakeLists.txt b/Tests/SimpleExclude/CMakeLists.txt
deleted file mode 100644
index baca23e..0000000
--- a/Tests/SimpleExclude/CMakeLists.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-cmake_minimum_required (VERSION 2.6)
-project(SimpleExclude C)
-
-set(EXECUTABLE_OUTPUT_PATH "${SimpleExclude_BINARY_DIR}" CACHE INTERNAL "" FORCE)
-set(LIBRARY_OUTPUT_PATH "${SimpleExclude_BINARY_DIR}" CACHE INTERNAL "" FORCE)
-
-add_subdirectory(dirC EXCLUDE_FROM_ALL)
-add_subdirectory(dirD)
-
-configure_file("${CMAKE_CURRENT_SOURCE_DIR}/run.cmake.in"
- "${CMAKE_CURRENT_BINARY_DIR}/run.cmake" @ONLY)
diff --git a/Tests/SimpleExclude/dirC/CMakeLists.txt b/Tests/SimpleExclude/dirC/CMakeLists.txt
deleted file mode 100644
index 9b59fda..0000000
--- a/Tests/SimpleExclude/dirC/CMakeLists.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-add_subdirectory(dirA EXCLUDE_FROM_ALL)
-add_subdirectory(dirB)
-
diff --git a/Tests/SimpleExclude/dirC/dirA/CMakeLists.txt b/Tests/SimpleExclude/dirC/dirA/CMakeLists.txt
deleted file mode 100644
index 52fac81..0000000
--- a/Tests/SimpleExclude/dirC/dirA/CMakeLists.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-add_library(t1 STATIC t1.c)
-
-add_library(t2 STATIC t2.c)
-
-add_executable(t3 t3.c)
-
-add_executable(t4 t4.c)
-
-add_executable(t5 t5.c)
-target_link_libraries(t5 t1)
diff --git a/Tests/SimpleExclude/dirC/dirA/t1.c b/Tests/SimpleExclude/dirC/dirA/t1.c
deleted file mode 100644
index 67fe06f..0000000
--- a/Tests/SimpleExclude/dirC/dirA/t1.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <stdio.h>
-
-int tlib1func()
-{
- Should not be build unless target directory A, B, or C are build;
- printf("This is T1\n");
- return 5;
-}
diff --git a/Tests/SimpleExclude/dirC/dirA/t2.c b/Tests/SimpleExclude/dirC/dirA/t2.c
deleted file mode 100644
index 6aaf406..0000000
--- a/Tests/SimpleExclude/dirC/dirA/t2.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <stdio.h>
-
-int tlib2func()
-{
- printf("This is T2\n");
- return 2;
-}
diff --git a/Tests/SimpleExclude/dirC/dirA/t3.c b/Tests/SimpleExclude/dirC/dirA/t3.c
deleted file mode 100644
index 1366dc0..0000000
--- a/Tests/SimpleExclude/dirC/dirA/t3.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <stdio.h>
-
-int main(int argc, char* argv[])
-{
- Should not be build unless target directory A, B, or C are build;
- return 0;
-}
diff --git a/Tests/SimpleExclude/dirC/dirA/t4.c b/Tests/SimpleExclude/dirC/dirA/t4.c
deleted file mode 100644
index b0e4000..0000000
--- a/Tests/SimpleExclude/dirC/dirA/t4.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <stdio.h>
-
-#ifdef __CLASSIC_C__
-int main()
-{
- int ac;
- char* av[];
-#else
-int main(int ac, char* av[])
-{
-#endif
- if (ac > 1000) {
- return *av[0];
- }
- printf("This is T4. This one should work.\n");
- return 0;
-}
diff --git a/Tests/SimpleExclude/dirC/dirA/t5.c b/Tests/SimpleExclude/dirC/dirA/t5.c
deleted file mode 100644
index 1fba212..0000000
--- a/Tests/SimpleExclude/dirC/dirA/t5.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <stdio.h>
-
-int main(int argc, char* argv[])
-{
- Should not be build unless target directory A, B, or C are build;
- return 5;
-}
diff --git a/Tests/SimpleExclude/dirC/dirB/CMakeLists.txt b/Tests/SimpleExclude/dirC/dirB/CMakeLists.txt
deleted file mode 100644
index ea4650c..0000000
--- a/Tests/SimpleExclude/dirC/dirB/CMakeLists.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-add_library(t6 STATIC t6.c)
-
-add_library(t7 STATIC t7.c)
-target_link_libraries(t7 t2)
-
diff --git a/Tests/SimpleExclude/dirC/dirB/t6.c b/Tests/SimpleExclude/dirC/dirB/t6.c
deleted file mode 100644
index e8877df..0000000
--- a/Tests/SimpleExclude/dirC/dirB/t6.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <stdio.h>
-
-int tlib6func()
-{
- Should not be build unless target directory B, or C are build;
- printf("This is T6\n");
- return 6;
-}
diff --git a/Tests/SimpleExclude/dirC/dirB/t7.c b/Tests/SimpleExclude/dirC/dirB/t7.c
deleted file mode 100644
index b613e91..0000000
--- a/Tests/SimpleExclude/dirC/dirB/t7.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <stdio.h>
-
-extern int tlib2func();
-
-int tlib7func()
-{
- printf("This is T7\n");
-
- if (tlib2func() != 2) {
- fprintf(stderr, "Something wrong with T2\n");
- return 1;
- }
-
- return 7;
-}
diff --git a/Tests/SimpleExclude/dirD/CMakeLists.txt b/Tests/SimpleExclude/dirD/CMakeLists.txt
deleted file mode 100644
index 44b8c27..0000000
--- a/Tests/SimpleExclude/dirD/CMakeLists.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-add_library(t8 STATIC t8.c)
-
-add_executable(t9 t9.c)
-target_link_libraries(t9 t7)
-
-add_custom_target(t4_custom ALL)
-add_dependencies(t4_custom t4)
diff --git a/Tests/SimpleExclude/dirD/t8.c b/Tests/SimpleExclude/dirD/t8.c
deleted file mode 100644
index bddec6f..0000000
--- a/Tests/SimpleExclude/dirD/t8.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <stdio.h>
-
-int tlib8func()
-{
- printf("This is T8\n");
- return 8;
-}
diff --git a/Tests/SimpleExclude/dirD/t9.c b/Tests/SimpleExclude/dirD/t9.c
deleted file mode 100644
index 9954ea5..0000000
--- a/Tests/SimpleExclude/dirD/t9.c
+++ /dev/null
@@ -1,24 +0,0 @@
-#include <stdio.h>
-
-extern int tlib7func();
-
-#ifdef __CLASSIC_C__
-int main()
-{
- int ac;
- char* av[];
-#else
-int main(int ac, char* av[])
-{
-#endif
- if (ac > 1000) {
- return *av[0];
- }
- printf("This is T9. This one should work.\n");
-
- if (tlib7func() != 7) {
- fprintf(stderr, "Something wrong with T7\n");
- return 1;
- }
- return 0;
-}
diff --git a/Tests/SimpleExclude/run.cmake.in b/Tests/SimpleExclude/run.cmake.in
deleted file mode 100644
index d31d2e5..0000000
--- a/Tests/SimpleExclude/run.cmake.in
+++ /dev/null
@@ -1,13 +0,0 @@
-set(t4_name "\"@CMAKE_CURRENT_BINARY_DIR@${CFG_DIR}/t4\"")
-exec_program("${t4_name}" RETURN_VALUE "t4_var")
-message("T4 ${t4_name} resulted ${t4_var}")
-
-set(t9_name "\"@CMAKE_CURRENT_BINARY_DIR@${CFG_DIR}/t9\"")
-exec_program("${t9_name}" RETURN_VALUE "t9_var")
-message("T9 ${t9_name} resulted ${t9_var}")
-
-if ( "${t4_var}" EQUAL "0" AND "${t9_var}" EQUAL "0" )
- message("Everything is good, Yoshimi won...")
-else ()
- message(FATAL_ERROR "Yoshimi lost... The evil pink robots will take over the world")
-endif ()
diff --git a/Tests/VSGNUFortran/runtest.cmake.in b/Tests/VSGNUFortran/runtest.cmake.in
index 987207b..fc05715 100644
--- a/Tests/VSGNUFortran/runtest.cmake.in
+++ b/Tests/VSGNUFortran/runtest.cmake.in
@@ -14,7 +14,7 @@ file(TO_NATIVE_PATH "${MINGW_PATH}" MINGW_PATH)
string(REPLACE "\\" "\\\\" MINGW_PATH "${MINGW_PATH}")
message("${MINGW_PATH}")
set(test_exe "@VSGNUFortran_BINARY_DIR@/bin/c_using_fortran.exe")
-set(ENV{PATH} "${MINGW_PATH}";$ENV{PATH})
+set(ENV{PATH} "${MINGW_PATH};$ENV{PATH}")
message("run ${test_exe}")
execute_process(COMMAND "${test_exe}"
RESULT_VARIABLE res)