Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,10 @@ It is recommended to use assertions where applicable, and to enable them with

The source tree includes a Benchmark tool that can help measure library performance. The tool is located in the `test/benchmark/` directory. The build process also creates the binary here, so you will have the tool after the compilation is finished.

Detailed benchmark test documentation is available in:
* `docs/benchmark-tests.en.md`
* `docs/benchmark-tests.de.md`

To compare the JSON regression suite across both supported JSON backends with separate build directories, run:

```shell
Expand Down Expand Up @@ -325,7 +329,7 @@ The tool is a straightforward wrapper application that utilizes the library. It

Each transaction is an HTTP/1.1 GET request with some GET parameters. Common headers are added, followed by the response headers and an XML body. Between phases, the tool checks whether an intervention has occurred. All transactions are created with the same data.

Note that the tool does not call the last phase (logging).
Note that the tool calls the logging phase (`processLogging()`) for each transaction.

Please remember to reset `basic_rules.conf` if you want to try with a different ruleset.

Expand Down
35 changes: 31 additions & 4 deletions build/win32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,22 @@ endfunction()

# unit tests
file(GLOB unitTestSources ${BASE_DIR}/test/unit/*.cc)

list(REMOVE_ITEM unitTestSources
${BASE_DIR}/test/unit/json_backend_depth_tests.cc
)

add_executable(unit_tests ${unitTestSources} ${BASE_DIR}/test/common/custom_debug_log.cc)
setTestTargetProperties(unit_tests)
target_compile_options(unit_tests PRIVATE /wd4805)

add_executable(json_backend_depth_tests
${BASE_DIR}/test/unit/json_backend_depth_tests.cc
${BASE_DIR}/test/common/custom_debug_log.cc
)
setTestTargetProperties(json_backend_depth_tests)
target_compile_options(json_backend_depth_tests PRIVATE /wd4805)

# regression tests
file(GLOB regressionTestsSources ${BASE_DIR}/test/regression/*.cc)
add_executable(regression_tests ${regressionTestsSources} ${BASE_DIR}/test/common/custom_debug_log.cc)
Expand All @@ -214,6 +226,12 @@ add_regression_test_capability(WITH_MAXMIND HAVE_MAXMIND)

enable_testing()

add_test(
NAME json_backend_depth_tests
COMMAND json_backend_depth_tests
WORKING_DIRECTORY ${BASE_DIR}/test
)

file(READ ${BASE_DIR}/test/test-suite.in TEST_FILES_RAW)
string(REPLACE "\n" ";" TEST_FILES ${TEST_FILES_RAW})

Expand All @@ -233,15 +251,25 @@ foreach(TEST_FILE ${TEST_FILES})
# test name
get_filename_component(TEST_NAME ${TEST_FILE} NAME_WE)

# json_backend_depth_tests is built as a standalone executable,
# so skip automatic registration through unit_tests
if(TEST_NAME STREQUAL "json_backend_depth_tests")
continue()
endif()

# determine test runner based on test path prefix
string(FIND ${TEST_FILE} "test-cases/regression/" is_regression_test)
if(is_regression_test EQUAL 0)
set(TEST_RUNNER "regression_tests")
set(TEST_RUNNER "regression_tests")
else()
set(TEST_RUNNER "unit_tests")
set(TEST_RUNNER "unit_tests")
endif()

add_test(NAME ${TEST_NAME} COMMAND ${TEST_RUNNER} ${TEST_FILE} WORKING_DIRECTORY ${BASE_DIR}/test)
add_test(
NAME ${TEST_NAME}
COMMAND ${TEST_RUNNER} ${TEST_FILE}
WORKING_DIRECTORY ${BASE_DIR}/test
)
endif()
endforeach()

Expand All @@ -253,7 +281,6 @@ setTestTargetProperties(benchmark)
add_executable(rules_optimization ${BASE_DIR}/test/optimization/optimization.cc)
setTestTargetProperties(rules_optimization)


# examples
#

Expand Down
Loading