Skip to content

Commit

Permalink
unit_test: fix cmake, make headless tests once again
Browse files Browse the repository at this point in the history
  • Loading branch information
FolkertVanVerseveld committed Feb 7, 2024
1 parent 2dff575 commit d10be67
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
with:
submodules: true
- name: configure
run: mkdir build && cd build && cmake ../
run: mkdir build && cd build && cmake ../ -DBUILD_TESTS_HEADLESS=ON
- name: make testempires
run: cd build && make testempires -DBUILD_TESTS_HEADLESS=1
run: cd build && make testempires
- name: run
run: ./build/testempires
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@ project(${GAME_TARGET}
)

option(BUILD_TESTS "Build unit tests" ON)
option(BUILD_TESTS_HEADLESS "Only run headless unit tests" OFF)

set(TEST_TARGET "testempires")

if (BUILD_TESTS_HEADLESS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBUILD_TESTS_HEADLESS=1")
endif()

# dependencies

include(FetchContent)
Expand Down

0 comments on commit d10be67

Please sign in to comment.