From 6b74dab3c0ebe13390ca0e15825b6dd98a0f8240 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sun, 27 Aug 2023 12:24:49 +0200 Subject: again, reorganize test targets --- DEVELOPMENT.md | 4 ++++ Makefile | 34 ++++++++++++++++------------------ test/CMakeLists.txt | 12 +++++++----- 3 files changed, 27 insertions(+), 23 deletions(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 4f5d598..bc1799b 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -17,6 +17,10 @@ After building, you can run the "test suite" (depends on Pytest). make test +To only run a subset of basic sanity tests: + + make test/sanity + ### Valgrind You can run a suite of basic sanity tests under Valgrind: diff --git a/Makefile b/Makefile index 6c80198..184060c 100644 --- a/Makefile +++ b/Makefile @@ -55,31 +55,24 @@ release: build install: build cmake --install '$(call escape,$(cmake_dir))' -.PHONY: test/sanity -test/sanity: +.PHONY: test +test: @echo ----------------------------------------------------------------- - @echo Running sanity tests + @echo Running tests @echo ----------------------------------------------------------------- ctest --test-dir '$(call escape,$(cmake_dir))' \ - --verbose --tests-regex python_tests_sanity + --verbose --tests-regex python_tests_default -.PHONY: test/stress -test/stress: +# A subset of tests, excluding long-running stress tests. +.PHONY: test/sanity +test/sanity: @echo ----------------------------------------------------------------- - @echo Running stress tests + @echo Running sanity tests @echo ----------------------------------------------------------------- ctest --test-dir '$(call escape,$(cmake_dir))' \ - --verbose --tests-regex python_tests_stress - -# Run the basic "sanity" tests & the stress tests by default. -.PHONY: test -test: test/sanity test/stress - -# When building for a Docker image for a different platform, exclude stress -# tests: they simply take way too long. -.PHONY: test/docker -test/docker: test/sanity + --verbose --tests-regex python_tests_sanity +# Same, but run under Valgrind. .PHONY: test/valgrind test/valgrind: @echo ----------------------------------------------------------------- @@ -88,11 +81,16 @@ test/valgrind: ctest --test-dir '$(call escape,$(cmake_dir))' \ --verbose --tests-regex python_tests_valgrind +# When building a Docker image for a different platform, exclude stress tests: +# they simply take way too long. +.PHONY: test/docker +test/docker: test/sanity + +# Force a rebuild for a coverage report, since it depends on GCC debug data. .PHONY: coverage coverage: COMPILER := gcc coverage: CONFIGURATION := Debug coverage: COVERAGE := 1 -# Force a rebuild for a coverage report, since it depends on the GCC debug data. coverage: clean build test @echo ----------------------------------------------------------------- @echo Generating code coverage report diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 1470b3c..fa34457 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -20,14 +20,16 @@ function(add_python_tests name) set_tests_properties("${name}" PROPERTIES TIMEOUT 600) endfunction() -add_python_tests(python_tests_sanity - Python3::Interpreter -m pytest ${python_test_args} -m "not stress and not flame_graph") +add_python_tests(python_tests_default + Python3::Interpreter -m pytest ${python_test_args} -m "not flame_graph") -add_python_tests(python_tests_stress - Python3::Interpreter -m pytest ${python_test_args} -m "stress") +# 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") +# Same, but run under Valgrind. add_python_tests(python_tests_valgrind - Python3::Interpreter -m pytest ${python_test_args} -m "not stress and not flame_graph" + Python3::Interpreter -m pytest ${python_test_args} -m "not flame_graph and not stress" --valgrind "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/valgrind.sh") if(NOT DEFINED FLAME_GRAPHS_DIR) -- cgit v1.2.3