diff options
author | Brad King <brad.king@kitware.com> | 2024-01-19 21:13:33 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2024-01-24 19:41:35 (GMT) |
commit | 79f1f509b127ebaad4bd238bea64e84943678caf (patch) | |
tree | ab5d0025fd7ffc707713c57dbf02a49fcaac26f2 /Tests/RunCMake | |
parent | c75047709f2ee2a3f8791f19b9ce8cc76e633521 (diff) | |
download | CMake-79f1f509b127ebaad4bd238bea64e84943678caf.zip CMake-79f1f509b127ebaad4bd238bea64e84943678caf.tar.gz CMake-79f1f509b127ebaad4bd238bea64e84943678caf.tar.bz2 |
Tests: Fix RunCMake.Swift's build output checks
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/Swift/RunCMakeTest.cmake | 42 |
1 files changed, 22 insertions, 20 deletions
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") |