diff options
Diffstat (limited to 'Tests/RunCMake/WriteCompilerDetectionHeader')
38 files changed, 211 insertions, 0 deletions
diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/CMakeLists.txt new file mode 100644 index 0000000..872338d --- /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/EmptyPrefix-result.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/EmptyPrefix-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/EmptyPrefix-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/EmptyPrefix-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/EmptyPrefix-stderr.txt new file mode 100644 index 0000000..cf8578e --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/EmptyPrefix-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at .*/Modules/WriteCompilerDetectionHeader.cmake:[0-9]+ \(message\): + A prefix must be specified +Call Stack \(most recent call first\): + EmptyPrefix.cmake:[0-9]+ \(write_compiler_detection_header\) + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/EmptyPrefix.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/EmptyPrefix.cmake new file mode 100644 index 0000000..eda6b18 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/EmptyPrefix.cmake @@ -0,0 +1,10 @@ + +include(WriteCompilerDetectionHeader) + +write_compiler_detection_header( + FILE "${CMAKE_CURRENT_BINARY_DIR}/somefile" + PREFIX "" + VERSION 3.1 + COMPILERS GNU + FEATURES cxx_final +) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/ExtraArgs-result.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/ExtraArgs-result.txt new file mode 100644 index 0000000..d00491f --- /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 0000000..62c4ff1 --- /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 0000000..c2a21af --- /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 0000000..d00491f --- /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 0000000..3c0c076 --- /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 0000000..c90eda2 --- /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 0000000..d00491f --- /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 0000000..b4d7e08 --- /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 0000000..cfebae1 --- /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 0000000..d00491f --- /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 0000000..f34c9e1 --- /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 0000000..da870fa --- /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 0000000..d00491f --- /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 0000000..f35f9f9 --- /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 0000000..ecd0957 --- /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 0000000..d00491f --- /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 0000000..0445744 --- /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 0000000..cd83968 --- /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/InvalidPrefix-result.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidPrefix-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidPrefix-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidPrefix-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidPrefix-stderr.txt new file mode 100644 index 0000000..ea1bf67 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidPrefix-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at .*/Modules/WriteCompilerDetectionHeader.cmake:[0-9]+ \(message\): + The prefix must be a valid C identifier. +Call Stack \(most recent call first\): + InvalidPrefix.cmake:[0-9]+ \(write_compiler_detection_header\) + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidPrefix.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidPrefix.cmake new file mode 100644 index 0000000..6599f35 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/InvalidPrefix.cmake @@ -0,0 +1,10 @@ + +include(WriteCompilerDetectionHeader) + +write_compiler_detection_header( + FILE "${CMAKE_CURRENT_BINARY_DIR}/somefile" + PREFIX "0compile" + VERSION 3.1 + COMPILERS GNU + FEATURES cxx_final +) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/NoCompiler-result.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/NoCompiler-result.txt new file mode 100644 index 0000000..d00491f --- /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 0000000..9451348 --- /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 0000000..2dc14e9 --- /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 0000000..d00491f --- /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 0000000..193f297 --- /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 0000000..1fbc129 --- /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 0000000..d00491f --- /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 0000000..8d4db34 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/OldVersion-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at .*Modules/WriteCompilerDetectionHeader.cmake:[0-9]+ \(message\): + VERSION compatibility for write_compiler_detection_header is set to 3.0, + which is too low. It must be set to at least 3.1.0. Either set the + VERSION parameter to the write_compiler_detection_header function, or + update your minimum required CMake version with the cmake_minimum_required + command. +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 0000000..a6e3022 --- /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 0000000..d00491f --- /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 0000000..5fdcdb8 --- /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 0000000..8b6774c --- /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 0000000..6dded44 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/RunCMakeTest.cmake @@ -0,0 +1,14 @@ +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) +run_cmake(EmptyPrefix) +run_cmake(InvalidPrefix) |