Don't write ApprovalTests' temporary files into the source tree

This has two effects:
 1) This significantly improves the performance of ApprovalTests
    run in WSL, because running the massively multi-reporter
    test would cause lots of small and parallel writes across the
    WSL-Windows FS boundary, completely mudering performance.

 2) ApprovalTests can be run from multiple build dirs in parallel,
    as long as they do not fail. However, if they do fail,
    the multiple runs will still step on each other toes when
    writing the unapproved files for user.
This commit is contained in:
Martin Hořeňovský
2022-11-06 00:11:32 +01:00
parent 3b139ae51a
commit 0c75caf77b
2 changed files with 55 additions and 35 deletions

View File

@@ -343,7 +343,14 @@ set_tests_properties(FilteredSection::GeneratorsDontCauseInfiniteLoop-2
)
# AppVeyor has a Python 2.7 in path, but doesn't have .py files as autorunnable
add_test(NAME ApprovalTests COMMAND ${PYTHON_EXECUTABLE} ${CATCH_DIR}/tools/scripts/approvalTests.py $<TARGET_FILE:SelfTest>)
add_test(NAME ApprovalTests
COMMAND
${PYTHON_EXECUTABLE}
${CATCH_DIR}/tools/scripts/approvalTests.py
$<TARGET_FILE:SelfTest>
"${CMAKE_CURRENT_BINARY_DIR}"
)
set_tests_properties(ApprovalTests
PROPERTIES
FAIL_REGULAR_EXPRESSION "Results differed"