diff options
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 5 | ||||
-rw-r--r-- | Tests/RunCMake/Swift/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/Swift/Enable-stdout.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/Swift/Enable.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/Swift/NotSupported-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/Swift/NotSupported-stderr.txt | 5 | ||||
-rw-r--r-- | Tests/RunCMake/Swift/NotSupported.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/Swift/RunCMakeTest.cmake | 11 | ||||
-rw-r--r-- | Tests/RunCMake/Swift/XcodeTooOld-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/Swift/XcodeTooOld-stderr.txt | 5 | ||||
-rw-r--r-- | Tests/RunCMake/Swift/XcodeTooOld.cmake | 1 |
11 files changed, 35 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index bc706d3..adbe7cc 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -59,6 +59,10 @@ function(add_RunCMake_test_group test types) endforeach() endfunction() +if(XCODE_VERSION AND "${XCODE_VERSION}" VERSION_LESS 6.1) + set(Swift_ARGS -DXCODE_BELOW_6_1=1) +endif() + if(XCODE_VERSION AND "${XCODE_VERSION}" VERSION_LESS 3) set(GeneratorToolset_ARGS -DXCODE_BELOW_3=1) endif() @@ -132,6 +136,7 @@ add_RunCMake_test(GNUInstallDirs) add_RunCMake_test(TargetPropertyGeneratorExpressions) add_RunCMake_test(Languages) add_RunCMake_test(ObjectLibrary) +add_RunCMake_test(Swift) add_RunCMake_test(TargetObjects) add_RunCMake_test(TargetSources) add_RunCMake_test(find_dependency) diff --git a/Tests/RunCMake/Swift/CMakeLists.txt b/Tests/RunCMake/Swift/CMakeLists.txt new file mode 100644 index 0000000..74b3ff8 --- /dev/null +++ b/Tests/RunCMake/Swift/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.3) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/Swift/Enable-stdout.txt b/Tests/RunCMake/Swift/Enable-stdout.txt new file mode 100644 index 0000000..39e133f --- /dev/null +++ b/Tests/RunCMake/Swift/Enable-stdout.txt @@ -0,0 +1 @@ +-- The Swift compiler identification is Apple diff --git a/Tests/RunCMake/Swift/Enable.cmake b/Tests/RunCMake/Swift/Enable.cmake new file mode 100644 index 0000000..19f297a --- /dev/null +++ b/Tests/RunCMake/Swift/Enable.cmake @@ -0,0 +1 @@ +enable_language(Swift) diff --git a/Tests/RunCMake/Swift/NotSupported-result.txt b/Tests/RunCMake/Swift/NotSupported-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Swift/NotSupported-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Swift/NotSupported-stderr.txt b/Tests/RunCMake/Swift/NotSupported-stderr.txt new file mode 100644 index 0000000..9a9c23f --- /dev/null +++ b/Tests/RunCMake/Swift/NotSupported-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at .*/Modules/CMakeDetermineSwiftCompiler.cmake:[0-9]+ \(message\): + Swift language not supported by "[^"]*" generator +Call Stack \(most recent call first\): + NotSupported.cmake:[0-9]+ \(enable_language\) + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/Swift/NotSupported.cmake b/Tests/RunCMake/Swift/NotSupported.cmake new file mode 100644 index 0000000..19f297a --- /dev/null +++ b/Tests/RunCMake/Swift/NotSupported.cmake @@ -0,0 +1 @@ +enable_language(Swift) diff --git a/Tests/RunCMake/Swift/RunCMakeTest.cmake b/Tests/RunCMake/Swift/RunCMakeTest.cmake new file mode 100644 index 0000000..0a57121 --- /dev/null +++ b/Tests/RunCMake/Swift/RunCMakeTest.cmake @@ -0,0 +1,11 @@ +include(RunCMake) + +if(RunCMake_GENERATOR STREQUAL Xcode) + if(XCODE_BELOW_6_1) + run_cmake(XcodeTooOld) + else() + run_cmake(Enable) + endif() +else() + run_cmake(NotSupported) +endif() diff --git a/Tests/RunCMake/Swift/XcodeTooOld-result.txt b/Tests/RunCMake/Swift/XcodeTooOld-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Swift/XcodeTooOld-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Swift/XcodeTooOld-stderr.txt b/Tests/RunCMake/Swift/XcodeTooOld-stderr.txt new file mode 100644 index 0000000..8d18f29 --- /dev/null +++ b/Tests/RunCMake/Swift/XcodeTooOld-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at .*/Modules/CMakeDetermineSwiftCompiler.cmake:[0-9]+ \(message\): + Swift language not supported by Xcode [0-9.]+ +Call Stack \(most recent call first\): + XcodeTooOld.cmake:[0-9]+ \(enable_language\) + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/Swift/XcodeTooOld.cmake b/Tests/RunCMake/Swift/XcodeTooOld.cmake new file mode 100644 index 0000000..19f297a --- /dev/null +++ b/Tests/RunCMake/Swift/XcodeTooOld.cmake @@ -0,0 +1 @@ +enable_language(Swift) |