diff options
author | Brad King <brad.king@kitware.com> | 2024-01-25 15:15:07 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2024-01-25 15:15:28 (GMT) |
commit | 35246ed9c4bba6980d4cc95cda1be534231eaa1d (patch) | |
tree | 1d433d6ef784b4aa0c5349dccb81de5716495574 /Tests/RunCMake | |
parent | a8f0e347907cf0c442c5c2be3dbe4e9f7d7c63d7 (diff) | |
parent | b2129a14f47a92dfb0c662882885d335b98811d7 (diff) | |
download | CMake-35246ed9c4bba6980d4cc95cda1be534231eaa1d.zip CMake-35246ed9c4bba6980d4cc95cda1be534231eaa1d.tar.gz CMake-35246ed9c4bba6980d4cc95cda1be534231eaa1d.tar.bz2 |
Merge topic 'swift-windows'
b2129a14f4 Tests: Fix SwiftMix tests' runtime library selection on Windows
4f49f7fc0b Tests: Fix SwiftOnly test on Windows
2dec0c0308 Tests: Fix RunCMake.Swift expected output on Windows
79f1f509b1 Tests: Fix RunCMake.Swift's build output checks
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Jeremy Day <jadaytime@gmail.com>
Merge-request: !9169
Diffstat (limited to 'Tests/RunCMake')
5 files changed, 29 insertions, 27 deletions
diff --git a/Tests/RunCMake/Swift/CMP0157-OLD-build-stdout.txt b/Tests/RunCMake/Swift/CMP0157-OLD-build-stdout.txt index 0955c61..d593b92 100644 --- a/Tests/RunCMake/Swift/CMP0157-OLD-build-stdout.txt +++ b/Tests/RunCMake/Swift/CMP0157-OLD-build-stdout.txt @@ -1 +1 @@ -swiftc .* -output-file-map CMakeFiles/greetings_default.dir//output-file-map.json .* +swiftc(.exe)? .* -output-file-map CMakeFiles(/|\\)greetings_default.dir(//|\\\\)output-file-map.json .* diff --git a/Tests/RunCMake/Swift/ForceResponseFile-check-stdout.txt b/Tests/RunCMake/Swift/ForceResponseFile-check-stdout.txt index 3d70f12..ec396d7 100644 --- a/Tests/RunCMake/Swift/ForceResponseFile-check-stdout.txt +++ b/Tests/RunCMake/Swift/ForceResponseFile-check-stdout.txt @@ -1,2 +1,2 @@ -swiftc -j [0-9]+ -num-threads [0-9]+ -c @CMakeFiles/L.dir/L.o.swift.rsp -.*swiftc -emit-library -static -o libL.a @CMakeFiles/L.rsp +swiftc(.exe)? -j [0-9]+ -num-threads [0-9]+ -c @CMakeFiles(/|\\)L.dir(/|\\)L.o(bj)?.swift.rsp +.*swiftc(.exe)? -emit-library -static -o (libL.a|L.lib) @CMakeFiles(/|\\)L.rsp diff --git a/Tests/RunCMake/Swift/IncrementalSwift-second-stderr.txt b/Tests/RunCMake/Swift/IncrementalSwift-second-stderr.txt index 7a882f8..efa3336 100644 --- a/Tests/RunCMake/Swift/IncrementalSwift-second-stderr.txt +++ b/Tests/RunCMake/Swift/IncrementalSwift-second-stderr.txt @@ -1,2 +1,2 @@ ninja explain: A.swiftmodule is dirty -ninja explain: libB.a is dirty +ninja explain: (libB.a|B.lib) is dirty diff --git a/Tests/RunCMake/Swift/IncrementalSwift-second-stdout.txt b/Tests/RunCMake/Swift/IncrementalSwift-second-stdout.txt index d644d6b..8e5b97c 100644 --- a/Tests/RunCMake/Swift/IncrementalSwift-second-stdout.txt +++ b/Tests/RunCMake/Swift/IncrementalSwift-second-stdout.txt @@ -1,3 +1,3 @@ -.*Building Swift object A.swiftmodule CMakeFiles/A.dir/a.swift.o -.*Building Swift object B.swiftmodule CMakeFiles/B.dir/b.swift.o -FAILED: B.swiftmodule CMakeFiles/B.dir/b.swift.o +.*Building Swift object A.swiftmodule CMakeFiles(/|\\)A.dir(/|\\)a.swift.o(bj)? +.*Building Swift object B.swiftmodule CMakeFiles(/|\\)B.dir(/|\\)b.swift.o(bj)? +FAILED: B.swiftmodule CMakeFiles(/|\\)B.dir(/|\\)b.swift.o(bj)? diff --git a/Tests/RunCMake/Swift/RunCMakeTest.cmake b/Tests/RunCMake/Swift/RunCMakeTest.cmake index 56158e3..3711efb 100644 --- a/Tests/RunCMake/Swift/RunCMakeTest.cmake +++ b/Tests/RunCMake/Swift/RunCMakeTest.cmake @@ -35,60 +35,62 @@ elseif(RunCMake_GENERATOR STREQUAL Ninja) # Test that intermediate static libraries are rebuilt when the public # interface of their dependency changes block() - set(IncrementalSwift_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/IncrementalSwift-build) - set(IncrementalSwift_TEST_NO_CLEAN 1) - set(IncrementalSwift_TEST_OUTPUT_MERGE 1) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/IncrementalSwift-build) # Since files are modified during test, the files are created in the cmake # file into the build directory run_cmake(IncrementalSwift) - run_cmake_command(IncrementalSwift-first ${CMAKE_COMMAND} --build ${IncrementalSwift_TEST_BINARY_DIR}) + set(RunCMake_TEST_NO_CLEAN 1) + run_cmake_command(IncrementalSwift-first ${CMAKE_COMMAND} --build .) # Modify public interface of libA requiring rebuild of libB - file(WRITE ${IncrementalSwift_TEST_BINARY_DIR}/a.swift + file(WRITE ${RunCMake_TEST_BINARY_DIR}/a.swift "public func callA() -> Float { return 32.0 }\n") # Note: We still expect this to fail, but instead of failure at link time, # it should fail while re-compiling libB because the function changed - run_cmake_command(IncrementalSwift-second ${CMAKE_COMMAND} --build ${IncrementalSwift_TEST_BINARY_DIR} -- -d explain) + run_cmake_command(IncrementalSwift-second ${CMAKE_COMMAND} --build . -- -d explain) endblock() block() - set(CMP0157-OLD_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CMP0157-OLD-build) - set(CMP0157-OLD_TEST_NO_CLEAN 1) - set(CMP0157-OLD_TEST_OUTPUT_MERGE 1) - run_cmake(CMP0157-NEW) + run_cmake(CMP0157-WARN) + + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CMP0157-OLD-build) run_cmake(CMP0157-OLD) + set(RunCMake_TEST_NO_CLEAN 1) # -n: dry-run to avoid actually compiling, -v: verbose to capture executed command - run_cmake_command(CMP0157-OLD-build ${CMAKE_COMMAND} --build ${CMP0157-OLD_TEST_BINARY_DIR} -- -n -v) - run_cmake(CMP0157-WARN) + run_cmake_command(CMP0157-OLD-build ${CMAKE_COMMAND} --build . -- -n -v) endblock() block() - set(CompileCommands_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CompileCommands-build) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CompileCommands-build) run_cmake(CompileCommands) - run_cmake_command(CompileCommands-check ${CMAKE_COMMAND} --build ${CompileCommands_TEST_BINARY_DIR}) + set(RunCMake_TEST_NO_CLEAN 1) + run_cmake_command(CompileCommands-check ${CMAKE_COMMAND} --build .) endblock() block() - set(ForceResponseFile_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/ForceResponseFile-build) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/ForceResponseFile-build) run_cmake(ForceResponseFile) + set(RunCMake_TEST_NO_CLEAN 1) # -v: verbose to capture executed commands -n: dry-run to avoid actually compiling - run_cmake_command(ForceResponseFile-check ${CMAKE_COMMAND} --build ${ForceResponseFile_TEST_BINARY_DIR} -- -vn) + run_cmake_command(ForceResponseFile-check ${CMAKE_COMMAND} --build . -- -vn) endblock() block() if(CMAKE_SYSTEM_NAME MATCHES Windows) - set(ImportLibraryFlags_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SwiftLibraryModuleCommand-build) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/ImportLibraryFlags-build) run_cmake(ImportLibraryFlags) - run_cmake_command(ImportLibraryFlags-check ${CMAKE_COMMAND} --build ${SwiftLibraryModuleCommand_TEST_BINARY_DIR} -- -n -v) + set(RunCMake_TEST_NO_CLEAN 1) + run_cmake_command(ImportLibraryFlags-check ${CMAKE_COMMAND} --build . -- -n -v) endif() endblock() block() - set(SwiftLibraryModuleCommand_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SwiftLibraryModuleCommand-build) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SwiftLibraryModuleCommand-build) run_cmake(SwiftLibraryModuleCommand) - run_cmake_command(SwiftLibraryModuleCommand-check ${CMAKE_COMMAND} --build ${SwiftLibraryModuleCommand_TEST_BINARY_DIR} -- -n -v) + set(RunCMake_TEST_NO_CLEAN 1) + run_cmake_command(SwiftLibraryModuleCommand-check ${CMAKE_COMMAND} --build . -- -n -v) endblock() endif() elseif(RunCMake_GENERATOR STREQUAL "Ninja Multi-Config") |