Skip to content

Commit

Permalink
Make xcodebuild testing work and do it in CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
dabrahams committed Feb 27, 2024
1 parent cef47fa commit 37efaa0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ jobs:
with:
runCmd: cmake -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DENABLE_TESTING=1 -GNinja -S . -B .devcontainer-build && cmake --build .devcontainer-build && ctest -V --test-dir .devcontainer-build

- name: 'Xcode (build only—"error: Scheme DummyTestee is not currently configured for the test action.")'
- name: Xcode
if: ${{ matrix.os == 'macos-latest' }}
run: |
cmake -DENABLE_TESTING=1 -GXcode -S . -B .xcode-build
cd .xcode-build
xcrun xcodebuild -configuration ${{ matrix.configuration }} -scheme DummyTestee -destination 'platform=macOS' build-for-testing
xcrun xcodebuild -configuration ${{ matrix.configuration }} -scheme DummyTestee -destination 'platform=macOS' test
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ project(SwiftCMakeXCTesting
)
enable_testing()

set(CMAKE_XCODE_GENERATE_SCHEME YES)

list(PREPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)

option(SwiftCMakeXCTesting_FORCE_BUILD_GenerateXCTestMain
Expand Down

0 comments on commit 37efaa0

Please sign in to comment.