Skip to content

Commit 4ae48c3

Browse files
committed
fix(ci): Add support for multi-config cmake projects
Also, enable running the unit tests in the Windows CI.
1 parent 950f1d1 commit 4ae48c3

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ jobs:
2626
cmake --build build
2727
2828
- name: Test
29+
working-directory: build
2930
run: |
30-
cmake --build build --target test
31+
ctest -v
3132
3233
build-windows:
3334
runs-on: windows-latest
@@ -43,11 +44,20 @@ jobs:
4344
path: ~\AppData\Local\vcpkg\archives
4445
key: vcpkg-cache
4546

47+
- name: Install unit tests requirements
48+
run: |
49+
pip install -r tests\unit_tests\requirements.txt
50+
4651
- name: Build
4752
run: |
4853
mkdir build
4954
cmake -Bbuild -DCMAKE_TOOLCHAIN_FILE=C:\Vcpkg\scripts\buildsystems\vcpkg.cmake .
50-
cmake --build build
55+
cmake --build build --config Release
56+
57+
- name: Test
58+
working-directory: build
59+
run: |
60+
ctest -v -C Release
5161
5262
build-emscripten:
5363
runs-on: ubuntu-20.04

tests/unit_tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ file(READ lit.site.cfg.py.in lit_cfg_in)
4848
string(CONFIGURE "${lit_cfg_in}" lit_cfg @ONLY)
4949

5050
file(GENERATE
51-
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
51+
OUTPUT $<CONFIG>.lit.site.cfg.py
5252
CONTENT "${lit_cfg}")
5353

5454
add_subdirectory(preprocessor)

tests/unit_tests/preprocessor/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1919

2020
add_test(NAME preprocessor
21-
COMMAND lit::tool -v ${CMAKE_CURRENT_BINARY_DIR})
21+
COMMAND lit::tool --config-prefix $<CONFIG>.lit -v ${CMAKE_CURRENT_BINARY_DIR})

0 commit comments

Comments
 (0)