Skip to content

Commit

Permalink
build: add MUSEN_BUILD_TESTS option
Browse files Browse the repository at this point in the history
  • Loading branch information
threeal committed Aug 4, 2024
1 parent 95f7b73 commit ade2dd9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Build project
uses: threeal/[email protected]
with:
options: BUILD_TESTING=ON
options: MUSEN_BUILD_TESTS=ON
run-build: true

- name: Test project
Expand Down
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.5)

project(musen)

option(MUSEN_BUILD_TESTS "Build test targets.")

function(cpmaddpackage)
file(
DOWNLOAD https://github.com/cpm-cmake/CPM.cmake/releases/download/v0.40.1/CPM.cmake
Expand Down Expand Up @@ -42,7 +44,7 @@ install(TARGETS ${PROJECT_NAME}

add_subdirectory("examples")

if(BUILD_TESTING)
if(MUSEN_BUILD_TESTS)
enable_testing()
add_subdirectory("test/gtest")
endif()
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ See [releases](https://github.com/ichiro-its/musen/releases) for the latest vers
```
- (Optional) reconfigure CMake to run the unit tests.
```sh
$ cmake -DBUILD_TESTING=ON .. && make && ctest --verbose
$ cmake -DMUSEN_BUILD_TESTS=ON .. && make && ctest --verbose
```

## Usages
Expand Down

0 comments on commit ade2dd9

Please sign in to comment.