-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
temporarily disabled constructor tests in linux CI #264
- Loading branch information
1 parent
b0460b5
commit 9ea08d3
Showing
3 changed files
with
97 additions
and
6 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
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,32 @@ | ||
readarray test_examples < tests/tests_list.txt | ||
exit_code=0 | ||
|
||
if [ $1 != "make" ] && [ $1 != "ninja" ]; then | ||
echo "Got $1 instead of make/ninja" | ||
echo "Build system must be entered as command line argument 1"; | ||
exit 1 | ||
fi | ||
|
||
|
||
if [[ $2 =~ ^-j[0-9]+$ ]]; then | ||
for test_example in ${test_examples[*]}; do | ||
|
||
if [[ $test_example != *"constructors"* ]]; then | ||
$1 -C build ${test_example////_}_calculate_expected_res $2; | ||
if [ $? -ne 0 ]; then | ||
exit_code=1 | ||
fi | ||
|
||
$1 -C build ${test_example////_} $2; | ||
if [ $? -ne 0 ]; then | ||
exit_code=1 | ||
fi | ||
fi | ||
|
||
done | ||
else | ||
echo "Got $2 as command line argument 2, must be number of cpu's" | ||
echo "(linux: -j\$(nproc), mac: : -j\$(sysctl -n hw.logicalcpu))" | ||
fi | ||
|
||
exit $exit_code |
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,59 @@ | ||
readarray test_examples < tests/tests_list.txt | ||
exit_code=0 | ||
at_least_one_test_launched=0 | ||
|
||
for i in ${!test_examples[*]}; do | ||
test_example=${test_examples[i]//$'\n'/} | ||
parent_dir=$(dirname "$test_example") | ||
|
||
if [[ $test_example == *"constructors"* ]]; then | ||
echo -e "\033[31m Constructor tests temporarily disabled. \033[0m"; | ||
else | ||
|
||
echo "" | ||
echo test_example: $test_example | ||
|
||
for file in tests/inputs/$parent_dir/*.inp; do | ||
|
||
echo -n "input $file: "; | ||
./build/bin/assigner/assigner -b build/tests/cpp/${test_example////_}.ll -i "$file" -t assignment.tbl -c circuit.crct -e pallas --check --print_circuit_output > real.log | ||
if [ $? -ne 0 ]; then | ||
exit_code=1 | ||
echo -e "\033[31m Assigner failed! \033[0m"; | ||
continue | ||
fi | ||
|
||
./build/tests/cpp/${test_example////_}_calculate_expected_res "$file" > expected.log | ||
if [ $? -ne 0 ]; then | ||
exit_code=1 | ||
echo -e "\033[31m Calculation of expected result failed! \033[0m"; | ||
continue | ||
fi | ||
|
||
diff -u expected.log real.log >diff.log; | ||
|
||
if [ $? -eq 0 ]; then | ||
echo -e "\033[32m succeeded \033[0m"; | ||
else | ||
exit_code=1 | ||
echo -e "\033[31m Test failed! Real result differs from expected result. \033[0m"; | ||
echo -e "\nexpected result:"; | ||
cat expected.log; | ||
echo -e "\nreal circuit output:"; | ||
cat real.log; | ||
echo -e "\ninput:"; | ||
cat "$file"; | ||
echo -e "\n--------------------------------------------------------------------------------"; | ||
fi | ||
at_least_one_test_launched=1 | ||
done | ||
fi | ||
done | ||
|
||
rm real.log expected.log diff.log | ||
|
||
if [ $at_least_one_test_launched -eq 0 ]; then | ||
exit 1 | ||
else | ||
exit $exit_code | ||
fi |