Skip to content

Commit c4e9cdb

Browse files
authored
Merge pull request #13 from jm6271/cmake-tests
Enable testing in CMakeLists.txt
2 parents e51f66b + 3a426f0 commit c4e9cdb

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

.github/workflows/run-test-suite.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@ jobs:
3232
run: |
3333
cd out/build/x64-release
3434
ninja
35-
cd loc.tests
36-
./loc.tests
37-
cd ../loc
38-
./loc --help
35+
ctest
3936
4037
build-linux:
4138
runs-on: ubuntu-latest
@@ -56,7 +53,5 @@ jobs:
5653
5754
- name: Run tests
5855
run: |
59-
cd out/build/linux-release/loc.tests
60-
./loc.tests
61-
cd ../loc
62-
./loc --help
56+
cd out/build/linux-release/
57+
ctest

.github/workflows/upload-release.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ jobs:
3131
run: |
3232
cd out/build/x64-release
3333
ninja
34-
cd loc.tests
35-
./loc.tests
36-
cd ../../../..
34+
ctest
3735
3836
- name: Create zip file
3937
run: powershell Compress-Archive -Path out\build\x64-release\loc\loc.exe,out\build\x64-release\loc\*.dll -DestinationPath out\build\x64-release\loc-windows-x64.zip
@@ -65,9 +63,8 @@ jobs:
6563
6664
- name: Run tests
6765
run: |
68-
cd out/build/linux-release/loc.tests
69-
./loc.tests
70-
cd ../../../..
66+
cd out/build/linux-release/
67+
ctest
7168
7269
- name: Create zip file
7370
run: zip -j out/build/linux-release/loc-linux-x64.zip out/build/linux-release/loc/loc out/build/linux-release/loc/*.so.*

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
1515

1616
project ("loc")
1717

18+
enable_testing()
19+
1820
# Include sub-projects.
1921
add_subdirectory ("loc")
2022
add_subdirectory("loc.tests")

0 commit comments

Comments
 (0)