-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1229 from wmdi/test-compiler
Finish implementing `compiler`
- Loading branch information
Showing
149 changed files
with
3,709 additions
and
11,505 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
diff --git a/scripts/cmake/doctestAddTests.cmake b/scripts/cmake/doctestAddTests.cmake | ||
index 3b25485..d3ba906 100644 | ||
--- a/scripts/cmake/doctestAddTests.cmake | ||
+++ b/scripts/cmake/doctestAddTests.cmake | ||
@@ -56,12 +56,14 @@ foreach(line ${output}) | ||
if("${line}" STREQUAL "===============================================================================" OR "${line}" MATCHES [==[^\[doctest\] ]==]) | ||
continue() | ||
endif() | ||
- set(test ${line}) | ||
+ set(unescaped_test ${line}) | ||
+ # use escape commas to handle properly test cases with commas inside the name | ||
+ string(REPLACE "," "\\," escaped_test ${unescaped_test}) | ||
set(labels "") | ||
if(${add_labels}) | ||
# get test suite that test belongs to | ||
execute_process( | ||
- COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" --test-case=${test} --list-test-suites | ||
+ COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" --test-case=${escaped_test} --list-test-suites | ||
OUTPUT_VARIABLE labeloutput | ||
RESULT_VARIABLE labelresult | ||
WORKING_DIRECTORY "${TEST_WORKING_DIR}" | ||
@@ -85,24 +87,22 @@ foreach(line ${output}) | ||
|
||
if(NOT "${junit_output_dir}" STREQUAL "") | ||
# turn testname into a valid filename by replacing all special characters with "-" | ||
- string(REGEX REPLACE "[/\\:\"|<>]" "-" test_filename "${test}") | ||
+ string(REGEX REPLACE "[/\\:\"|<>]" "-" test_filename "${unescaped_test}") | ||
set(TEST_JUNIT_OUTPUT_PARAM "--reporters=junit" "--out=${junit_output_dir}/${prefix}${test_filename}${suffix}.xml") | ||
else() | ||
unset(TEST_JUNIT_OUTPUT_PARAM) | ||
endif() | ||
- # use escape commas to handle properly test cases with commas inside the name | ||
- string(REPLACE "," "\\," test_name ${test}) | ||
# ...and add to script | ||
add_command(add_test | ||
- "${prefix}${test}${suffix}" | ||
+ "${prefix}${unescaped_test}${suffix}" | ||
${TEST_EXECUTOR} | ||
"${TEST_EXECUTABLE}" | ||
- "--test-case=${test_name}" | ||
+ "--test-case=${escaped_test}" | ||
"${TEST_JUNIT_OUTPUT_PARAM}" | ||
${extra_args} | ||
) | ||
add_command(set_tests_properties | ||
- "${prefix}${test}${suffix}" | ||
+ "${prefix}${unescaped_test}${suffix}" | ||
PROPERTIES | ||
WORKING_DIRECTORY "${TEST_WORKING_DIR}" | ||
${properties} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#! /usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
DIR="$(realpath -- "$(dirname "${BASH_SOURCE[0]}")")" | ||
REPO="$(realpath -- "$DIR/../../../")" | ||
|
||
cd "$REPO/build-ci" | ||
make -j $(( $(nproc) < 2 ? 1 : $(nproc)-1 )) "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#! /usr/bin/env bash | ||
|
||
set -euo pipefail | ||
set -x | ||
|
||
DIR="$(realpath -- "$(dirname "${BASH_SOURCE[0]}")")" | ||
REPO="$(realpath -- "$DIR/../../../")" | ||
|
||
TEST_LIBS=("${@/%/-tests}") | ||
REGEX="^$(IFS='|'; echo "${TEST_LIBS[*]}")\$" | ||
|
||
cd "$REPO/build-ci" | ||
make -j $(( $(nproc) < 2 ? 1 : $(nproc)-1 )) "${TEST_LIBS[@]}" | ||
ctest --progress --output-on-failure -L "$REGEX" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
include(aliasing) | ||
|
||
if (FF_USE_EXTERNAL_DOCTEST) | ||
find_package(doctest REQUIRED) | ||
include(doctest) # import doctest_discover_tests | ||
else() | ||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/deps/doctest) | ||
include(${CMAKE_CURRENT_SOURCE_DIR}/deps/doctest/scripts/cmake/doctest.cmake) | ||
endif() | ||
|
||
alias_library(doctest doctest::doctest) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/deps/rapidcheck) | ||
if (FF_USE_EXTERNAL_RAPIDCHECK) | ||
find_package(rapidcheck REQUIRED) | ||
else() | ||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/deps/rapidcheck) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.