diff --git a/examples/aplusb/buildtests b/examples/aplusb/buildtests index aeaccf5..c54ff74 100755 --- a/examples/aplusb/buildtests +++ b/examples/aplusb/buildtests @@ -53,18 +53,7 @@ cat testmanifest | while read instr; do ################# if [ $rebuild_inputs = true ] ; then - # Build input generator - cd ingen && make -s && cd .. - - # Copy ingen/ingen.bin and incf/$1 into stage - cp ingen/ingen.bin stage/$problemname.bin - cp incf/$incf stage/$problemname.cf - - # Build input - cd stage && ./$problemname.bin && cp $problemname.in ../tests/$problemname-$nr.in && cd .. - - # Clean stage - rm stage/* + build_test_number $nr $incf fi ################### diff --git a/examples/aplusb/compare b/examples/aplusb/compare new file mode 100755 index 0000000..6a81689 --- /dev/null +++ b/examples/aplusb/compare @@ -0,0 +1,90 @@ +#!/bin/bash +# +# compare -s "s1 s2" -s s3 -c "c1 c2" -c c3 compares sources s1, s2, s3 with configurations c1 c2 c3 until they diverge +# Tamio-Vesa Nakajima + +source lib +source problemconfig + +srcs="" +configs="" + +while getopts "hs:c:" opt ; do + case $opt in + h) + echo "Usage: ./compare -s \"source1\" -s \"source2\" -c \"config1\" \"config2\"" + exit 0 + ;; + s) + srcs="$srcs $OPTARG" + ;; + c) + configs="$configs $OPTARG" + ;; + esac +done + +if [ -z "$srcs" ] ; then + echo No sources provided + exit 1 +fi + +if [ -z "$configs" ] ; then + echo No configs provided + exit 1 +fi + +srcs_arr=($srcs) +nr_srcs=${#srcs_arr[@]} +outputs_arr=() +binary_arr=() +input_file=`mktemp` + +for i in `seq 0 $(($nr_srcs-1))` ; do + outputs_arr[$i]=`mktemp` + binary_arr[$i]=`mktemp` +done + +for i in `seq 0 $(($nr_srcs-1))` ; do + g++ src/${srcs_arr[$i]} -std=c++11 -O2 -o ${binary_arr[$i]} +done + +curr_test=0 + +path_to_tests=`realpath tests` +trap "rm $path_to_tests/$problemname-999.in" EXIT + +while : ; do + for conf in $configs ; do + rm stage/* 2> /dev/null + echo -en " \r" + echo Doing test $curr_test + curr_test=$(($curr_test + 1)) + + build_test_number 999 $conf + + hasTle=false + + for i in `seq 0 $(($nr_srcs-1))` ; do + run_src_test ${binary_arr[$i]} $problemname-999 + + if (( $(echo "$timeUsed > $timelimit" | bc -l ) )) ; then + hasTle=true + fi + + cp stage/$problemname.out ${outputs_arr[$i]} + done + if [ $hasTle = true ] || ! diff --from-file ${outputs_arr[*]} > /dev/null ; then + echo -en " \r" + echo Has failed on: + cat tests/$problemname-999.in + echo With outputs: + for i in `seq 0 $(($nr_srcs-1))` ; do + echo ${srcs_arr[$i]}: + cat ${outputs_arr[$i]} + echo + done + exit 0 + fi + done +done diff --git a/examples/aplusb/incf/fixed b/examples/aplusb/incf/fixed index 1a63220..4271727 100644 --- a/examples/aplusb/incf/fixed +++ b/examples/aplusb/incf/fixed @@ -1 +1 @@ -1 0 2 +1 0 0 diff --git a/examples/aplusb/incf/fixed2 b/examples/aplusb/incf/fixed2 new file mode 100644 index 0000000..8cd5e6d --- /dev/null +++ b/examples/aplusb/incf/fixed2 @@ -0,0 +1 @@ +1 100 200 diff --git a/examples/aplusb/ingen/ingen.bin b/examples/aplusb/ingen/ingen.bin index 83566ce..40aa67d 100755 Binary files a/examples/aplusb/ingen/ingen.bin and b/examples/aplusb/ingen/ingen.bin differ diff --git a/examples/aplusb/ingen/ingen.cpp b/examples/aplusb/ingen/ingen.cpp index c661e9b..223d9c2 100644 --- a/examples/aplusb/ingen/ingen.cpp +++ b/examples/aplusb/ingen/ingen.cpp @@ -1,5 +1,6 @@ #include #include +#include using namespace std; int main(){ @@ -8,12 +9,12 @@ int main(){ bool fixed; int x, y; f >> fixed >> x >> y; - cout << fixed << ' ' << x << ' ' << y << endl; if(fixed){ g << x << ' ' << y << endl; } else{ - srand(time(nullptr)); + unsigned seed1 = std::chrono::system_clock::now().time_since_epoch().count(); + srand(seed1); g << rand() << ' ' << rand() << endl; } return 0; } diff --git a/examples/aplusb/lib b/examples/aplusb/lib index d9526ac..e8bf9c7 100644 --- a/examples/aplusb/lib +++ b/examples/aplusb/lib @@ -23,6 +23,28 @@ maybecp () { fi } +# Builds test number $1 with incf $2 +build_test_number () { + source problemconfig + + nr=$1 + incf=$2 + + # Build input generator + cd ingen && make -s && cd .. + + # Copy ingen/ingen.bin and incf/$1 into stage + cp ingen/ingen.bin stage/$problemname.bin + cp incf/$incf stage/$problemname.cf + + # Build input + cd stage && ./$problemname.bin && cp $problemname.in ../tests/$problemname-$nr.in && cd .. + + # Clean stage + rm stage/* 2> /dev/null + +} + # Run the binary $1 with test $2, returning the time used in timeUsed, and leaving the output file in stage/$problemname.out run_src_test () { binary=$1 @@ -45,7 +67,7 @@ run_src_test () { echo -en "Doing $testname\r" # Clean the stage - rm stage/* + rm stage/* 2> /dev/null # Copy the binary into the stage cp $binary stage/$problemname.bin diff --git a/examples/aplusb/oldtests/newtests.zip b/examples/aplusb/oldtests/newtests.zip new file mode 100644 index 0000000..c8cb9ae Binary files /dev/null and b/examples/aplusb/oldtests/newtests.zip differ diff --git a/examples/aplusb/oldtests/newtests2.zip b/examples/aplusb/oldtests/newtests2.zip new file mode 100644 index 0000000..9756376 Binary files /dev/null and b/examples/aplusb/oldtests/newtests2.zip differ diff --git a/examples/aplusb/src/almost_ok.cpp b/examples/aplusb/src/almost_ok.cpp new file mode 100644 index 0000000..9464e09 --- /dev/null +++ b/examples/aplusb/src/almost_ok.cpp @@ -0,0 +1,11 @@ +#include +using namespace std; + +int main(){ + ifstream f("aplusb.in"); + ofstream g("aplusb.out"); + long long x, y; + f >> x >> y; + if((x+y)%100 == 0) g << -1 << endl; + else g << x+y << endl; + return 0; } diff --git a/examples/aplusb/stage/aplusb.bin b/examples/aplusb/stage/aplusb.bin new file mode 100755 index 0000000..51e0c25 Binary files /dev/null and b/examples/aplusb/stage/aplusb.bin differ diff --git a/examples/aplusb/stage/aplusb.in b/examples/aplusb/stage/aplusb.in new file mode 100644 index 0000000..ac00f99 --- /dev/null +++ b/examples/aplusb/stage/aplusb.in @@ -0,0 +1 @@ +468168176 122451424 diff --git a/examples/aplusb/stage/aplusb.out b/examples/aplusb/stage/aplusb.out new file mode 100644 index 0000000..3a2e3f4 --- /dev/null +++ b/examples/aplusb/stage/aplusb.out @@ -0,0 +1 @@ +-1 diff --git a/examples/aplusb/testmanifest b/examples/aplusb/testmanifest index 83d2d86..9e68729 100644 --- a/examples/aplusb/testmanifest +++ b/examples/aplusb/testmanifest @@ -1,2 +1,3 @@ 1 fixed 10 +1 fixed2 10 18 random 90 diff --git a/examples/aplusb/tests/aplusb-1.in b/examples/aplusb/tests/aplusb-1.in index a0718a1..10ec153 100644 --- a/examples/aplusb/tests/aplusb-1.in +++ b/examples/aplusb/tests/aplusb-1.in @@ -1 +1 @@ -1394068970 1070590020 +100 200 diff --git a/examples/aplusb/tests/aplusb-1.ok b/examples/aplusb/tests/aplusb-1.ok index 98ce6b8..222b847 100644 --- a/examples/aplusb/tests/aplusb-1.ok +++ b/examples/aplusb/tests/aplusb-1.ok @@ -1,2 +1,2 @@ -5 -2464658990 +10 +300 diff --git a/examples/aplusb/tests/aplusb-10.in b/examples/aplusb/tests/aplusb-10.in index 7a8f027..32ce837 100644 --- a/examples/aplusb/tests/aplusb-10.in +++ b/examples/aplusb/tests/aplusb-10.in @@ -1 +1 @@ -1394085777 1353065269 +1405884291 2082194543 diff --git a/examples/aplusb/tests/aplusb-10.ok b/examples/aplusb/tests/aplusb-10.ok index cece230..275004c 100644 --- a/examples/aplusb/tests/aplusb-10.ok +++ b/examples/aplusb/tests/aplusb-10.ok @@ -1,2 +1,2 @@ 5 -2747151046 +3488078834 diff --git a/examples/aplusb/tests/aplusb-11.in b/examples/aplusb/tests/aplusb-11.in index 7a8f027..32ce837 100644 --- a/examples/aplusb/tests/aplusb-11.in +++ b/examples/aplusb/tests/aplusb-11.in @@ -1 +1 @@ -1394085777 1353065269 +1405884291 2082194543 diff --git a/examples/aplusb/tests/aplusb-11.ok b/examples/aplusb/tests/aplusb-11.ok index cece230..275004c 100644 --- a/examples/aplusb/tests/aplusb-11.ok +++ b/examples/aplusb/tests/aplusb-11.ok @@ -1,2 +1,2 @@ 5 -2747151046 +3488078834 diff --git a/examples/aplusb/tests/aplusb-12.in b/examples/aplusb/tests/aplusb-12.in index 7a8f027..32ce837 100644 --- a/examples/aplusb/tests/aplusb-12.in +++ b/examples/aplusb/tests/aplusb-12.in @@ -1 +1 @@ -1394085777 1353065269 +1405884291 2082194543 diff --git a/examples/aplusb/tests/aplusb-12.ok b/examples/aplusb/tests/aplusb-12.ok index cece230..275004c 100644 --- a/examples/aplusb/tests/aplusb-12.ok +++ b/examples/aplusb/tests/aplusb-12.ok @@ -1,2 +1,2 @@ 5 -2747151046 +3488078834 diff --git a/examples/aplusb/tests/aplusb-13.in b/examples/aplusb/tests/aplusb-13.in index 7a8f027..32ce837 100644 --- a/examples/aplusb/tests/aplusb-13.in +++ b/examples/aplusb/tests/aplusb-13.in @@ -1 +1 @@ -1394085777 1353065269 +1405884291 2082194543 diff --git a/examples/aplusb/tests/aplusb-13.ok b/examples/aplusb/tests/aplusb-13.ok index cece230..275004c 100644 --- a/examples/aplusb/tests/aplusb-13.ok +++ b/examples/aplusb/tests/aplusb-13.ok @@ -1,2 +1,2 @@ 5 -2747151046 +3488078834 diff --git a/examples/aplusb/tests/aplusb-14.in b/examples/aplusb/tests/aplusb-14.in index 7a8f027..32ce837 100644 --- a/examples/aplusb/tests/aplusb-14.in +++ b/examples/aplusb/tests/aplusb-14.in @@ -1 +1 @@ -1394085777 1353065269 +1405884291 2082194543 diff --git a/examples/aplusb/tests/aplusb-14.ok b/examples/aplusb/tests/aplusb-14.ok index cece230..275004c 100644 --- a/examples/aplusb/tests/aplusb-14.ok +++ b/examples/aplusb/tests/aplusb-14.ok @@ -1,2 +1,2 @@ 5 -2747151046 +3488078834 diff --git a/examples/aplusb/tests/aplusb-15.in b/examples/aplusb/tests/aplusb-15.in index 7a8f027..32ce837 100644 --- a/examples/aplusb/tests/aplusb-15.in +++ b/examples/aplusb/tests/aplusb-15.in @@ -1 +1 @@ -1394085777 1353065269 +1405884291 2082194543 diff --git a/examples/aplusb/tests/aplusb-15.ok b/examples/aplusb/tests/aplusb-15.ok index cece230..275004c 100644 --- a/examples/aplusb/tests/aplusb-15.ok +++ b/examples/aplusb/tests/aplusb-15.ok @@ -1,2 +1,2 @@ 5 -2747151046 +3488078834 diff --git a/examples/aplusb/tests/aplusb-16.in b/examples/aplusb/tests/aplusb-16.in index 7a8f027..32ce837 100644 --- a/examples/aplusb/tests/aplusb-16.in +++ b/examples/aplusb/tests/aplusb-16.in @@ -1 +1 @@ -1394085777 1353065269 +1405884291 2082194543 diff --git a/examples/aplusb/tests/aplusb-16.ok b/examples/aplusb/tests/aplusb-16.ok index cece230..275004c 100644 --- a/examples/aplusb/tests/aplusb-16.ok +++ b/examples/aplusb/tests/aplusb-16.ok @@ -1,2 +1,2 @@ 5 -2747151046 +3488078834 diff --git a/examples/aplusb/tests/aplusb-17.in b/examples/aplusb/tests/aplusb-17.in index 7a8f027..32ce837 100644 --- a/examples/aplusb/tests/aplusb-17.in +++ b/examples/aplusb/tests/aplusb-17.in @@ -1 +1 @@ -1394085777 1353065269 +1405884291 2082194543 diff --git a/examples/aplusb/tests/aplusb-17.ok b/examples/aplusb/tests/aplusb-17.ok index cece230..275004c 100644 --- a/examples/aplusb/tests/aplusb-17.ok +++ b/examples/aplusb/tests/aplusb-17.ok @@ -1,2 +1,2 @@ 5 -2747151046 +3488078834 diff --git a/examples/aplusb/tests/aplusb-18.in b/examples/aplusb/tests/aplusb-18.in index 7a8f027..ca06237 100644 --- a/examples/aplusb/tests/aplusb-18.in +++ b/examples/aplusb/tests/aplusb-18.in @@ -1 +1 @@ -1394085777 1353065269 +1405901098 217186145 diff --git a/examples/aplusb/tests/aplusb-18.ok b/examples/aplusb/tests/aplusb-18.ok index cece230..9391515 100644 --- a/examples/aplusb/tests/aplusb-18.ok +++ b/examples/aplusb/tests/aplusb-18.ok @@ -1,2 +1,2 @@ 5 -2747151046 +1623087243 diff --git a/examples/aplusb/tests/aplusb-19.in b/examples/aplusb/tests/aplusb-19.in new file mode 100644 index 0000000..ca06237 --- /dev/null +++ b/examples/aplusb/tests/aplusb-19.in @@ -0,0 +1 @@ +1405901098 217186145 diff --git a/examples/aplusb/tests/aplusb-19.ok b/examples/aplusb/tests/aplusb-19.ok new file mode 100644 index 0000000..9391515 --- /dev/null +++ b/examples/aplusb/tests/aplusb-19.ok @@ -0,0 +1,2 @@ +5 +1623087243 diff --git a/examples/aplusb/tests/aplusb-2.in b/examples/aplusb/tests/aplusb-2.in index a0718a1..3cb1cbe 100644 --- a/examples/aplusb/tests/aplusb-2.in +++ b/examples/aplusb/tests/aplusb-2.in @@ -1 +1 @@ -1394068970 1070590020 +1405867484 1799719294 diff --git a/examples/aplusb/tests/aplusb-2.ok b/examples/aplusb/tests/aplusb-2.ok index 98ce6b8..4919a58 100644 --- a/examples/aplusb/tests/aplusb-2.ok +++ b/examples/aplusb/tests/aplusb-2.ok @@ -1,2 +1,2 @@ 5 -2464658990 +3205586778 diff --git a/examples/aplusb/tests/aplusb-3.in b/examples/aplusb/tests/aplusb-3.in index a0718a1..3cb1cbe 100644 --- a/examples/aplusb/tests/aplusb-3.in +++ b/examples/aplusb/tests/aplusb-3.in @@ -1 +1 @@ -1394068970 1070590020 +1405867484 1799719294 diff --git a/examples/aplusb/tests/aplusb-3.ok b/examples/aplusb/tests/aplusb-3.ok index 98ce6b8..4919a58 100644 --- a/examples/aplusb/tests/aplusb-3.ok +++ b/examples/aplusb/tests/aplusb-3.ok @@ -1,2 +1,2 @@ 5 -2464658990 +3205586778 diff --git a/examples/aplusb/tests/aplusb-4.in b/examples/aplusb/tests/aplusb-4.in index a0718a1..3cb1cbe 100644 --- a/examples/aplusb/tests/aplusb-4.in +++ b/examples/aplusb/tests/aplusb-4.in @@ -1 +1 @@ -1394068970 1070590020 +1405867484 1799719294 diff --git a/examples/aplusb/tests/aplusb-4.ok b/examples/aplusb/tests/aplusb-4.ok index 98ce6b8..4919a58 100644 --- a/examples/aplusb/tests/aplusb-4.ok +++ b/examples/aplusb/tests/aplusb-4.ok @@ -1,2 +1,2 @@ 5 -2464658990 +3205586778 diff --git a/examples/aplusb/tests/aplusb-5.in b/examples/aplusb/tests/aplusb-5.in index a0718a1..3cb1cbe 100644 --- a/examples/aplusb/tests/aplusb-5.in +++ b/examples/aplusb/tests/aplusb-5.in @@ -1 +1 @@ -1394068970 1070590020 +1405867484 1799719294 diff --git a/examples/aplusb/tests/aplusb-5.ok b/examples/aplusb/tests/aplusb-5.ok index 98ce6b8..4919a58 100644 --- a/examples/aplusb/tests/aplusb-5.ok +++ b/examples/aplusb/tests/aplusb-5.ok @@ -1,2 +1,2 @@ 5 -2464658990 +3205586778 diff --git a/examples/aplusb/tests/aplusb-6.in b/examples/aplusb/tests/aplusb-6.in index a0718a1..3cb1cbe 100644 --- a/examples/aplusb/tests/aplusb-6.in +++ b/examples/aplusb/tests/aplusb-6.in @@ -1 +1 @@ -1394068970 1070590020 +1405867484 1799719294 diff --git a/examples/aplusb/tests/aplusb-6.ok b/examples/aplusb/tests/aplusb-6.ok index 98ce6b8..4919a58 100644 --- a/examples/aplusb/tests/aplusb-6.ok +++ b/examples/aplusb/tests/aplusb-6.ok @@ -1,2 +1,2 @@ 5 -2464658990 +3205586778 diff --git a/examples/aplusb/tests/aplusb-7.in b/examples/aplusb/tests/aplusb-7.in index a0718a1..3cb1cbe 100644 --- a/examples/aplusb/tests/aplusb-7.in +++ b/examples/aplusb/tests/aplusb-7.in @@ -1 +1 @@ -1394068970 1070590020 +1405867484 1799719294 diff --git a/examples/aplusb/tests/aplusb-7.ok b/examples/aplusb/tests/aplusb-7.ok index 98ce6b8..4919a58 100644 --- a/examples/aplusb/tests/aplusb-7.ok +++ b/examples/aplusb/tests/aplusb-7.ok @@ -1,2 +1,2 @@ 5 -2464658990 +3205586778 diff --git a/examples/aplusb/tests/aplusb-8.in b/examples/aplusb/tests/aplusb-8.in index a0718a1..3cb1cbe 100644 --- a/examples/aplusb/tests/aplusb-8.in +++ b/examples/aplusb/tests/aplusb-8.in @@ -1 +1 @@ -1394068970 1070590020 +1405867484 1799719294 diff --git a/examples/aplusb/tests/aplusb-8.ok b/examples/aplusb/tests/aplusb-8.ok index 98ce6b8..4919a58 100644 --- a/examples/aplusb/tests/aplusb-8.ok +++ b/examples/aplusb/tests/aplusb-8.ok @@ -1,2 +1,2 @@ 5 -2464658990 +3205586778 diff --git a/examples/aplusb/tests/aplusb-9.in b/examples/aplusb/tests/aplusb-9.in index 7a8f027..3cb1cbe 100644 --- a/examples/aplusb/tests/aplusb-9.in +++ b/examples/aplusb/tests/aplusb-9.in @@ -1 +1 @@ -1394085777 1353065269 +1405867484 1799719294 diff --git a/examples/aplusb/tests/aplusb-9.ok b/examples/aplusb/tests/aplusb-9.ok index cece230..4919a58 100644 --- a/examples/aplusb/tests/aplusb-9.ok +++ b/examples/aplusb/tests/aplusb-9.ok @@ -1,2 +1,2 @@ 5 -2747151046 +3205586778 diff --git a/src/buildtests b/src/buildtests index aeaccf5..c54ff74 100755 --- a/src/buildtests +++ b/src/buildtests @@ -53,18 +53,7 @@ cat testmanifest | while read instr; do ################# if [ $rebuild_inputs = true ] ; then - # Build input generator - cd ingen && make -s && cd .. - - # Copy ingen/ingen.bin and incf/$1 into stage - cp ingen/ingen.bin stage/$problemname.bin - cp incf/$incf stage/$problemname.cf - - # Build input - cd stage && ./$problemname.bin && cp $problemname.in ../tests/$problemname-$nr.in && cd .. - - # Clean stage - rm stage/* + build_test_number $nr $incf fi ################### diff --git a/src/compare b/src/compare new file mode 100755 index 0000000..6a81689 --- /dev/null +++ b/src/compare @@ -0,0 +1,90 @@ +#!/bin/bash +# +# compare -s "s1 s2" -s s3 -c "c1 c2" -c c3 compares sources s1, s2, s3 with configurations c1 c2 c3 until they diverge +# Tamio-Vesa Nakajima + +source lib +source problemconfig + +srcs="" +configs="" + +while getopts "hs:c:" opt ; do + case $opt in + h) + echo "Usage: ./compare -s \"source1\" -s \"source2\" -c \"config1\" \"config2\"" + exit 0 + ;; + s) + srcs="$srcs $OPTARG" + ;; + c) + configs="$configs $OPTARG" + ;; + esac +done + +if [ -z "$srcs" ] ; then + echo No sources provided + exit 1 +fi + +if [ -z "$configs" ] ; then + echo No configs provided + exit 1 +fi + +srcs_arr=($srcs) +nr_srcs=${#srcs_arr[@]} +outputs_arr=() +binary_arr=() +input_file=`mktemp` + +for i in `seq 0 $(($nr_srcs-1))` ; do + outputs_arr[$i]=`mktemp` + binary_arr[$i]=`mktemp` +done + +for i in `seq 0 $(($nr_srcs-1))` ; do + g++ src/${srcs_arr[$i]} -std=c++11 -O2 -o ${binary_arr[$i]} +done + +curr_test=0 + +path_to_tests=`realpath tests` +trap "rm $path_to_tests/$problemname-999.in" EXIT + +while : ; do + for conf in $configs ; do + rm stage/* 2> /dev/null + echo -en " \r" + echo Doing test $curr_test + curr_test=$(($curr_test + 1)) + + build_test_number 999 $conf + + hasTle=false + + for i in `seq 0 $(($nr_srcs-1))` ; do + run_src_test ${binary_arr[$i]} $problemname-999 + + if (( $(echo "$timeUsed > $timelimit" | bc -l ) )) ; then + hasTle=true + fi + + cp stage/$problemname.out ${outputs_arr[$i]} + done + if [ $hasTle = true ] || ! diff --from-file ${outputs_arr[*]} > /dev/null ; then + echo -en " \r" + echo Has failed on: + cat tests/$problemname-999.in + echo With outputs: + for i in `seq 0 $(($nr_srcs-1))` ; do + echo ${srcs_arr[$i]}: + cat ${outputs_arr[$i]} + echo + done + exit 0 + fi + done +done diff --git a/src/lib b/src/lib index d9526ac..e8bf9c7 100644 --- a/src/lib +++ b/src/lib @@ -23,6 +23,28 @@ maybecp () { fi } +# Builds test number $1 with incf $2 +build_test_number () { + source problemconfig + + nr=$1 + incf=$2 + + # Build input generator + cd ingen && make -s && cd .. + + # Copy ingen/ingen.bin and incf/$1 into stage + cp ingen/ingen.bin stage/$problemname.bin + cp incf/$incf stage/$problemname.cf + + # Build input + cd stage && ./$problemname.bin && cp $problemname.in ../tests/$problemname-$nr.in && cd .. + + # Clean stage + rm stage/* 2> /dev/null + +} + # Run the binary $1 with test $2, returning the time used in timeUsed, and leaving the output file in stage/$problemname.out run_src_test () { binary=$1 @@ -45,7 +67,7 @@ run_src_test () { echo -en "Doing $testname\r" # Clean the stage - rm stage/* + rm stage/* 2> /dev/null # Copy the binary into the stage cp $binary stage/$problemname.bin