aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-06-18 20:39:59 +0200
committerEgor Tensin <egor@tensin.name>2026-06-18 20:39:59 +0200
commitff66e906bebb2bab972e92e056b94bd6a9391c3e (patch)
treeb184540c7e5f792449d2ddb1a6fe1b21884b82d4
parentcmake: use a more common warnings option (diff)
downloadcimple-ff66e906bebb2bab972e92e056b94bd6a9391c3e.tar.gz
cimple-ff66e906bebb2bab972e92e056b94bd6a9391c3e.zip
cmake: prettify CMakeLists.txt files
Diffstat (limited to '')
-rw-r--r--src/CMakeLists.txt15
-rw-r--r--test/CMakeLists.txt28
2 files changed, 29 insertions, 14 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7bd8e78..64b8b1a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -25,7 +25,8 @@ execute_process(
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
OUTPUT_VARIABLE PROJECT_REV
OUTPUT_STRIP_TRAILING_WHITESPACE
- COMMAND_ERROR_IS_FATAL ANY)
+ COMMAND_ERROR_IS_FATAL ANY
+)
set(DEFAULT_HOST "127.0.0.1" CACHE STRING "Set default --host value")
set(DEFAULT_PORT "5556" CACHE STRING "Set default --port value")
@@ -46,7 +47,8 @@ function(generate_sql_header engine)
"${CMAKE_CURRENT_SOURCE_DIR}/generate-sql-header.py"
"${CMAKE_CURRENT_SOURCE_DIR}/${engine}/"
-o "${CMAKE_CURRENT_BINARY_DIR}/sql/${engine}_sql.h"
- DEPENDS ${sql_files})
+ DEPENDS ${sql_files}
+ )
endfunction()
generate_sql_header(sqlite)
@@ -80,7 +82,8 @@ add_my_executable(server server_main.c server.c
storage_sqlite.c
string.c
tcp_server.c
- worker_queue.c)
+ worker_queue.c
+)
target_link_libraries(server PRIVATE json-c pthread sodium sqlite3)
target_include_directories(server PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")
@@ -96,7 +99,8 @@ add_my_executable(client client_main.c client.c
net.c
process.c
protocol.c
- run_queue.c)
+ run_queue.c
+)
target_link_libraries(client PRIVATE json-c sodium)
add_my_executable(worker worker_main.c worker.c
@@ -117,5 +121,6 @@ add_my_executable(worker worker_main.c worker.c
protocol.c
run_queue.c
signal.c
- string.c)
+ string.c
+)
target_link_libraries(worker PRIVATE git2 json-c sodium)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index e31662f..c369729 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -18,38 +18,48 @@ set(python_test_args
--worker "$<TARGET_FILE:worker>"
--client "$<TARGET_FILE:client>"
--sigsegv "$<TARGET_FILE:sigsegv>"
- --project-version "${PROJECT_VERSION}")
+ --project-version "${PROJECT_VERSION}"
+)
function(add_python_tests name)
list(POP_FRONT ARGV)
add_test(NAME "${name}"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src"
- COMMAND ${ARGV})
+ COMMAND ${ARGV}
+ )
set_tests_properties("${name}" PROPERTIES TIMEOUT 600)
endfunction()
# Fast sanity tests & longer-running stress tests.
add_python_tests(python_tests_default
- Python3::Interpreter -m pytest ${python_test_args})
+ Python3::Interpreter -m pytest ${python_test_args}
+)
# Same, but use pytest-html to generate an HTML report.
add_python_tests(python_tests_report
Python3::Interpreter -m pytest ${python_test_args}
- --html "${TEST_REPORT_DIR}/index.html")
+ --html "${TEST_REPORT_DIR}/index.html"
+)
# Fast sanity tests only.
add_python_tests(python_tests_sanity
- Python3::Interpreter -m pytest ${python_test_args} -m "not stress")
+ Python3::Interpreter -m pytest ${python_test_args}
+ -m "not stress"
+)
# Same, but run under Valgrind. Longer-running stress tests are not run under
# Valgrind, because they take too long.
add_python_tests(python_tests_valgrind
- Python3::Interpreter -m pytest ${python_test_args} -m "not stress"
- --valgrind "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/valgrind.sh")
+ Python3::Interpreter -m pytest ${python_test_args}
+ -m "not stress"
+ --valgrind "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/valgrind.sh"
+)
# A couple of tests that are profiled using the flame graph tool. These are
# excluded by default.
add_python_tests(python_tests_flame_graphs
- Python3::Interpreter -m pytest ${python_test_args} -m "flame_graph"
+ Python3::Interpreter -m pytest ${python_test_args}
+ -m "flame_graph"
--flamegraph "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/flamegraph.sh"
- --flame-graphs-dir "${FLAME_GRAPHS_DIR}")
+ --flame-graphs-dir "${FLAME_GRAPHS_DIR}"
+)