mirror of
https://github.com/pantor/inja.git
synced 2026-02-17 09:03:58 +00:00
include building benchmark in test option
This commit is contained in:
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -30,7 +30,7 @@ jobs:
|
|||||||
- name: ubuntu-22.04-clang-15-no-exceptions
|
- name: ubuntu-22.04-clang-15-no-exceptions
|
||||||
os: ubuntu-22.04
|
os: ubuntu-22.04
|
||||||
compiler: clang-15
|
compiler: clang-15
|
||||||
cmake_vars: "-DCMAKE_CXX_FLAGS=-fno-exceptions -DBUILD_TESTING=OFF -DBUILD_BENCHMARK=ON"
|
cmake_vars: "-DCMAKE_CXX_FLAGS=-fno-exceptions -DBUILD_TESTING=OFF"
|
||||||
|
|
||||||
- name: ubuntu-22.04-gcc
|
- name: ubuntu-22.04-gcc
|
||||||
os: ubuntu-22.04
|
os: ubuntu-22.04
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ option(INJA_INSTALL_SINGLE_HEADER "Install the single header instead" OFF)
|
|||||||
option(INJA_EXPORT "Export the current build tree to the package registry" ON)
|
option(INJA_EXPORT "Export the current build tree to the package registry" ON)
|
||||||
option(BUILD_TESTING "Build unit tests" ON)
|
option(BUILD_TESTING "Build unit tests" ON)
|
||||||
option(INJA_BUILD_TESTS "Build unit tests when BUILD_TESTING is enabled." ON)
|
option(INJA_BUILD_TESTS "Build unit tests when BUILD_TESTING is enabled." ON)
|
||||||
option(BUILD_BENCHMARK "Build benchmark" ON)
|
|
||||||
option(COVERALLS "Generate coveralls data" OFF)
|
option(COVERALLS "Generate coveralls data" OFF)
|
||||||
|
|
||||||
|
|
||||||
@@ -103,10 +102,8 @@ if(BUILD_TESTING AND INJA_BUILD_TESTS)
|
|||||||
target_include_directories(single_inja_test PRIVATE include third_party/include)
|
target_include_directories(single_inja_test PRIVATE include third_party/include)
|
||||||
|
|
||||||
add_test(single_inja_test ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/single_inja_test)
|
add_test(single_inja_test ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/single_inja_test)
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
if(BUILD_BENCHMARK)
|
|
||||||
add_executable(inja_benchmark test/benchmark.cpp)
|
add_executable(inja_benchmark test/benchmark.cpp)
|
||||||
target_link_libraries(inja_benchmark PRIVATE inja)
|
target_link_libraries(inja_benchmark PRIVATE inja)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -52,10 +52,8 @@ if get_option('build_tests')
|
|||||||
|
|
||||||
test('Inja unit test', inja_test)
|
test('Inja unit test', inja_test)
|
||||||
test('Inja single include test', inja_single_test)
|
test('Inja single include test', inja_single_test)
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
if get_option('build_benchmark')
|
|
||||||
inja_benchmark = executable(
|
inja_benchmark = executable(
|
||||||
'inja_benchmark',
|
'inja_benchmark',
|
||||||
'test/benchmark.cpp',
|
'test/benchmark.cpp',
|
||||||
|
|||||||
@@ -1,2 +1 @@
|
|||||||
option('build_tests', type: 'boolean', value: true)
|
option('build_tests', type: 'boolean', value: true)
|
||||||
option('build_benchmark', type: 'boolean', value: true)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user