diff options
Diffstat (limited to 'Tests/RunCMake/WriteCompilerDetectionHeader')
32 files changed, 173 insertions, 0 deletions
diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/CMakeLists.txt new file mode 100644 index 0000000000..872338d3c6 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.0) +project(${RunCMake_TEST} CXX) +include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/ExtraArgs-result.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/ExtraArgs-result.txt new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/ExtraArgs-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/ExtraArgs-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/ExtraArgs-stderr.txt new file mode 100644 index 0000000000..62c4ff1da7 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/ExtraArgs-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at .*Modules/WriteCompilerDetectionHeader.cmake:[0-9]+ \(message\): + Unparsed arguments: GarbageArg +Call Stack \(most recent call first\): + ExtraArgs.cmake:4 \(write_compiler_detection_header\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/ExtraArgs.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/ExtraArgs.cmake new file mode 100644 index 0000000000..c2a21af990 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/ExtraArgs.cmake @@ -0,0 +1,10 @@ + +include(WriteCompilerDetectionHeader) + +write_compiler_detection_header( + FILE "${CMAKE_CURRENT_BINARY_DIR}/somefile" + PREFIX Pref + GarbageArg + COMPILERS GNU + FEATURES cxx_final +) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/FileTypo-result.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/FileTypo-result.txt new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/FileTypo-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/FileTypo-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/FileTypo-stderr.txt new file mode 100644 index 0000000000..3c0c07689c --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/FileTypo-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at .*Modules/WriteCompilerDetectionHeader.cmake:[0-9]+ \(message\): + write_compiler_detection_header: FILE parameter missing. +Call Stack \(most recent call first\): + FileTypo.cmake:4 \(write_compiler_detection_header\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/FileTypo.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/FileTypo.cmake new file mode 100644 index 0000000000..c90eda21e8 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/FileTypo.cmake @@ -0,0 +1,7 @@ + +include(WriteCompilerDetectionHeader) + +write_compiler_detection_header( + FILE_TYPO "${CMAKE_CURRENT_BINARY_DIR}/somefile" + PREFIX Pref +) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidArgs-result.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidArgs-result.txt new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidArgs-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidArgs-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidArgs-stderr.txt new file mode 100644 index 0000000000..b4d7e08eb7 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidArgs-stderr.txt @@ -0,0 +1,11 @@ +CMake Error at InvalidArgs.cmake:4 \(write_compiler_detection_header\): + write_compiler_detection_header Function invoked with incorrect arguments + for function named: write_compiler_detection_header +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at InvalidArgs.cmake:6 \(write_compiler_detection_header\): + write_compiler_detection_header Function invoked with incorrect arguments + for function named: write_compiler_detection_header +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidArgs.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidArgs.cmake new file mode 100644 index 0000000000..cfebae13ed --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidArgs.cmake @@ -0,0 +1,6 @@ + +include(WriteCompilerDetectionHeader) + +write_compiler_detection_header() + +write_compiler_detection_header(FILE) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCXXFeature-result.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCXXFeature-result.txt new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCXXFeature-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCXXFeature-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCXXFeature-stderr.txt new file mode 100644 index 0000000000..f34c9e1987 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCXXFeature-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at .*Modules/WriteCompilerDetectionHeader.cmake:[0-9]+ \(message\): + Unsupported feature cxx_not_a_feature. +Call Stack \(most recent call first\): + InvalidCXXFeature.cmake:4 \(write_compiler_detection_header\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCXXFeature.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCXXFeature.cmake new file mode 100644 index 0000000000..da870fa82d --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCXXFeature.cmake @@ -0,0 +1,10 @@ + +include(WriteCompilerDetectionHeader) + +write_compiler_detection_header( + FILE "${CMAKE_CURRENT_BINARY_DIR}/somefile" + PREFIX PREF_ + COMPILERS GNU + FEATURES cxx_not_a_feature + VERSION 3.1 +) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCompiler-result.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCompiler-result.txt new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCompiler-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCompiler-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCompiler-stderr.txt new file mode 100644 index 0000000000..f35f9f9699 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCompiler-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at .*Modules/WriteCompilerDetectionHeader.cmake:[0-9]+ \(message\): + Unsupported compiler NOT_A_COMPILER. +Call Stack \(most recent call first\): + InvalidCompiler.cmake:4 \(write_compiler_detection_header\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCompiler.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCompiler.cmake new file mode 100644 index 0000000000..ecd09571b5 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidCompiler.cmake @@ -0,0 +1,10 @@ + +include(WriteCompilerDetectionHeader) + +write_compiler_detection_header( + FILE "${CMAKE_CURRENT_BINARY_DIR}/somefile" + PREFIX PREF_ + COMPILERS NOT_A_COMPILER + FEATURES cxx_final + VERSION 3.1 +) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidFeature-result.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidFeature-result.txt new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidFeature-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidFeature-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidFeature-stderr.txt new file mode 100644 index 0000000000..0445744040 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidFeature-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at .*Modules/WriteCompilerDetectionHeader.cmake:[0-9]+ \(message\): + Unsupported feature not_a_feature. +Call Stack \(most recent call first\): + InvalidFeature.cmake:4 \(write_compiler_detection_header\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidFeature.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidFeature.cmake new file mode 100644 index 0000000000..cd839686a9 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidFeature.cmake @@ -0,0 +1,10 @@ + +include(WriteCompilerDetectionHeader) + +write_compiler_detection_header( + FILE "${CMAKE_CURRENT_BINARY_DIR}/somefile" + PREFIX PREF_ + COMPILERS GNU + FEATURES not_a_feature + VERSION 3.1 +) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/NoCompiler-result.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/NoCompiler-result.txt new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/NoCompiler-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/NoCompiler-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/NoCompiler-stderr.txt new file mode 100644 index 0000000000..9451348b2b --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/NoCompiler-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at .*Modules/WriteCompilerDetectionHeader.cmake:[0-9]+ \(message\): + Invalid arguments. write_compiler_detection_header requires at least one + compiler. +Call Stack \(most recent call first\): + NoCompiler.cmake:4 \(write_compiler_detection_header\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/NoCompiler.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/NoCompiler.cmake new file mode 100644 index 0000000000..2dc14e9a69 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/NoCompiler.cmake @@ -0,0 +1,10 @@ + +include(WriteCompilerDetectionHeader) + +write_compiler_detection_header( + FILE "${CMAKE_CURRENT_BINARY_DIR}/somefile" + PREFIX PREF_ + # COMPILERS + FEATURES cxx_final + VERSION 3.1 +) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/NoFeature-result.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/NoFeature-result.txt new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/NoFeature-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/NoFeature-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/NoFeature-stderr.txt new file mode 100644 index 0000000000..193f297d23 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/NoFeature-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at .*Modules/WriteCompilerDetectionHeader.cmake:[0-9]+ \(message\): + Invalid arguments. write_compiler_detection_header requires at least one + feature. +Call Stack \(most recent call first\): + NoFeature.cmake:4 \(write_compiler_detection_header\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/NoFeature.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/NoFeature.cmake new file mode 100644 index 0000000000..1fbc1292a9 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/NoFeature.cmake @@ -0,0 +1,10 @@ + +include(WriteCompilerDetectionHeader) + +write_compiler_detection_header( + FILE "${CMAKE_CURRENT_BINARY_DIR}/somefile" + PREFIX PREF_ + COMPILERS GNU + # FEATURES + VERSION 3.1 +) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/OldVersion-result.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/OldVersion-result.txt new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/OldVersion-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/OldVersion-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/OldVersion-stderr.txt new file mode 100644 index 0000000000..842eb3ff49 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/OldVersion-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at .*Modules/WriteCompilerDetectionHeader.cmake:[0-9]+ \(message\): + VERSION parameter too low. +Call Stack \(most recent call first\): + OldVersion.cmake:4 \(write_compiler_detection_header\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/OldVersion.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/OldVersion.cmake new file mode 100644 index 0000000000..a6e30224cc --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/OldVersion.cmake @@ -0,0 +1,10 @@ + +include(WriteCompilerDetectionHeader) + +write_compiler_detection_header( + FILE "${CMAKE_CURRENT_BINARY_DIR}/somefile" + PREFIX Pref + VERSION 3.0 + COMPILERS GNU + FEATURES cxx_final +) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/PrefixTypo-result.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/PrefixTypo-result.txt new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/PrefixTypo-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/PrefixTypo-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/PrefixTypo-stderr.txt new file mode 100644 index 0000000000..5fdcdb83f8 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/PrefixTypo-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at .*Modules/WriteCompilerDetectionHeader.cmake:[0-9]+ \(message\): + write_compiler_detection_header: PREFIX parameter missing. +Call Stack \(most recent call first\): + PrefixTypo.cmake:4 \(write_compiler_detection_header\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/PrefixTypo.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/PrefixTypo.cmake new file mode 100644 index 0000000000..8b6774c44a --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/PrefixTypo.cmake @@ -0,0 +1,7 @@ + +include(WriteCompilerDetectionHeader) + +write_compiler_detection_header( + FILE "${CMAKE_CURRENT_BINARY_DIR}/somefile" + PREFIX_TYPO Pref +) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/RunCMakeTest.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/RunCMakeTest.cmake new file mode 100644 index 0000000000..be79d417f4 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/RunCMakeTest.cmake @@ -0,0 +1,12 @@ +include(RunCMake) + +run_cmake(InvalidArgs) +run_cmake(NoCompiler) +run_cmake(NoFeature) +run_cmake(FileTypo) +run_cmake(PrefixTypo) +run_cmake(ExtraArgs) +run_cmake(OldVersion) +run_cmake(InvalidCompiler) +run_cmake(InvalidFeature) +run_cmake(InvalidCXXFeature) |