mirror of
https://github.com/threeal/cmake-action.git
synced 2025-04-22 03:21:21 +00:00
add support to run test_c
and test_cpp
targets as a CMake test
This commit is contained in:
parent
03870ba3b0
commit
c04ca4c05a
14
.github/workflows/test.yml
vendored
14
.github/workflows/test.yml
vendored
@ -32,7 +32,7 @@ jobs:
|
||||
with:
|
||||
source-dir: test
|
||||
build-dir: output
|
||||
run_test: true
|
||||
run-test: true
|
||||
|
||||
- name: Check if the default build directory does not exist
|
||||
run: test ! -d build && test ! -d test/build
|
||||
@ -51,14 +51,11 @@ jobs:
|
||||
with:
|
||||
source-dir: test
|
||||
targets: test_c test_cpp
|
||||
run-test: true
|
||||
c-flags: ${{ matrix.compiler == 'msvc' && '/w /WX-' || '-Wno-unused-variable' }}
|
||||
cxx-flags: ${{ matrix.compiler == 'msvc' && '/w /WX-' || '-Wno-unused-variable' }}
|
||||
args: -D CHECK_SURPASS_WARNING=ON
|
||||
|
||||
- name: Run the build results
|
||||
run: |
|
||||
${{ matrix.compiler == 'msvc' && 'test\build\Debug\test_c.exe' || 'test/build/test_c' }}
|
||||
${{ matrix.compiler == 'msvc' && 'test\build\Debug\test_cpp.exe' || 'test/build/test_cpp' }}
|
||||
test-args: -C test
|
||||
|
||||
specified-compiler-usage:
|
||||
runs-on: ${{ matrix.os }}-latest
|
||||
@ -74,13 +71,12 @@ jobs:
|
||||
with:
|
||||
source-dir: test
|
||||
targets: test_c test_cpp
|
||||
run-test: true
|
||||
generator: Ninja
|
||||
c-compiler: clang
|
||||
cxx-compiler: clang++
|
||||
args: -D CHECK_USING_CLANG=ON
|
||||
|
||||
- name: Run the build results
|
||||
run: test/build/test_c && test/build/test_cpp
|
||||
test-args: -C test
|
||||
|
||||
specified-generator-usage:
|
||||
runs-on: ${{ matrix.os }}-latest
|
||||
|
@ -28,4 +28,5 @@ foreach(LANG ${LANGS})
|
||||
$<$<BOOL:${CHECK_USING_CLANG}>:CHECK_USING_CLANG>
|
||||
$<$<BOOL:${CHECK_SURPASS_WARNING}>:CHECK_SURPASS_WARNING>
|
||||
)
|
||||
add_test(NAME test_${LANG} CONFIGURATIONS test COMMAND $<TARGET_FILE:test_${LANG}>)
|
||||
endforeach()
|
||||
|
Loading…
Reference in New Issue
Block a user