aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/test
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-08-27 12:49:14 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-08-27 17:59:52 +0200
commite19acf196c518fd7f8fe39a7f64f3febb35b6dfb (patch)
tree99164db2ccd0648fb747f52f5b3b351b538b90e7 /test
parentagain, reorganize test targets (diff)
downloadcimple-e19acf196c518fd7f8fe39a7f64f3febb35b6dfb.tar.gz
cimple-e19acf196c518fd7f8fe39a7f64f3febb35b6dfb.zip
test: add a target to generate an HTML report
Diffstat (limited to '')
-rw-r--r--test/CMakeLists.txt11
-rw-r--r--test/py/requirements.txt1
2 files changed, 11 insertions, 1 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index fa34457..df8db29 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -4,7 +4,7 @@ find_package(Python3 REQUIRED COMPONENTS Interpreter)
set(python_test_args
--no-header -v
- --durations=0 --durations-min=1.0
+ --durations 0 --durations-min 1.0
"${CMAKE_CURRENT_SOURCE_DIR}/py"
--server "$<TARGET_FILE:server>"
--worker "$<TARGET_FILE:worker>"
@@ -23,6 +23,15 @@ endfunction()
add_python_tests(python_tests_default
Python3::Interpreter -m pytest ${python_test_args} -m "not flame_graph")
+# Use pytest-html to generate an HTML report.
+if(NOT DEFINED TEST_REPORT_DIR)
+ set(TEST_REPORT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
+endif()
+
+add_python_tests(python_tests_report
+ Python3::Interpreter -m pytest ${python_test_args} -m "not flame_graph"
+ --html "${TEST_REPORT_DIR}/index.html")
+
# A subset of tests, excluding long-running stress tests.
add_python_tests(python_tests_sanity
Python3::Interpreter -m pytest ${python_test_args} -m "not flame_graph and not stress")
diff --git a/test/py/requirements.txt b/test/py/requirements.txt
new file mode 100644
index 0000000..43300f8
--- /dev/null
+++ b/test/py/requirements.txt
@@ -0,0 +1 @@
+pytest-html ~= 3.0