mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-12 10:22:12 +02:00
CMakeLists.txt: make tests optional
Run test-strbuf using ctest.
This commit is contained in:
@@ -45,8 +45,8 @@ jobs:
|
||||
- name: Run flashfetch
|
||||
run: ./flashfetch
|
||||
|
||||
- name: Run fastfetch-test-strbuf
|
||||
run: ./fastfetch-test-strbuf
|
||||
- name: Run tests
|
||||
run: ctest
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
|
||||
+18
-12
@@ -16,6 +16,7 @@ OPTION(ENABLE_DCONF "Enable dconf" ON)
|
||||
OPTION(ENABLE_DBUS "Enable dbus-1" ON)
|
||||
OPTION(ENABLE_XFCONF "Enable libxfconf-0" ON)
|
||||
OPTION(ENABLE_RPM "Enable rpm" ON)
|
||||
OPTION(BUILD_TESTS "Build tests" ON)
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
@@ -277,19 +278,24 @@ target_link_libraries(flashfetch
|
||||
|
||||
# Testing.
|
||||
|
||||
add_executable(fastfetch-test-performance
|
||||
tests/performance.c
|
||||
)
|
||||
target_link_libraries(fastfetch-test-performance
|
||||
PRIVATE libfastfetch
|
||||
)
|
||||
if (BUILD_TESTS)
|
||||
add_executable(fastfetch-test-performance
|
||||
tests/performance.c
|
||||
)
|
||||
target_link_libraries(fastfetch-test-performance
|
||||
PRIVATE libfastfetch
|
||||
)
|
||||
|
||||
add_executable(fastfetch-test-strbuf
|
||||
tests/strbuf.c
|
||||
)
|
||||
target_link_libraries(fastfetch-test-strbuf
|
||||
PRIVATE libfastfetch
|
||||
)
|
||||
add_executable(fastfetch-test-strbuf
|
||||
tests/strbuf.c
|
||||
)
|
||||
target_link_libraries(fastfetch-test-strbuf
|
||||
PRIVATE libfastfetch
|
||||
)
|
||||
|
||||
enable_testing()
|
||||
add_test(NAME test-strbuf COMMAND fastfetch-test-strbuf)
|
||||
endif()
|
||||
|
||||
# Installation.
|
||||
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#!/bin/env sh
|
||||
mkdir -p build/
|
||||
cd build
|
||||
cmake ..
|
||||
cmake --build . --target fastfetch-test-strbuf -j$(nproc)
|
||||
./fastfetch-test-strbuf "$@"
|
||||
Reference in New Issue
Block a user