From 712de3645689a570f24d5ac9ea906cad8945e9de Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Mon, 29 May 2017 00:06:22 +0430 Subject: added relics --- extra-tools/precommitTests.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'extra-tools') diff --git a/extra-tools/precommitTests.sh b/extra-tools/precommitTests.sh index b8ce27f..45af595 100755 --- a/extra-tools/precommitTests.sh +++ b/extra-tools/precommitTests.sh @@ -7,6 +7,8 @@ Orange="\033[0;33m" NC="\033[0m" REP_FILE="test/precommit.rep" +TIME=$(date +%Y-%m-%d:%H:%M:%S) +RELIC_COUNT=10 printf "${Lblue}switching to mutator root...\n${NC}" | tee ../test/precommit.rep cd .. @@ -63,6 +65,10 @@ echo "" if [[ $? == 0 ]]; then printf "${Green}mutator c++1z test build passed.\n${NC}" | tee -a ./test/precommit.rep + printf "${Orange}date and time of relic:.\n${NC}" | tee -a ./test/precommit.rep + echo $TIME | tee -a ./test/precommit.rep + cp ./mutator-lvl0 ./reliquary/m0/m0-$TIME + cp ./bruiser/bruiser ./reliquary/bruiser/bruiser-$TIME else printf "${Red}mutator c++1z test build failed.\n${NC}" | tee -a ./test/precommit.rep fi @@ -183,5 +189,5 @@ printf "${Lblue}cleaning the objects and exexutables...\n${NC}" | tee -a ../test printf "${Lblue}finished running all tests...\n${NC}" | tee -a ../test/precommit.rep #tell me when youre done -echo -ne '\007' && echo "" && echo -ne '\007' && echo -ne '\007' +echo -ne '\007' && echo "" && echo -ne '\007' && echo "" && echo -ne '\007' printf "${Green}beep...\n${NC}" -- cgit v1.2.3 From a323e646a2678add598b55f927e8fb587e7635d0 Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Mon, 29 May 2017 20:11:24 +0430 Subject: added reliquary --- extra-tools/precommitTests.sh | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) (limited to 'extra-tools') diff --git a/extra-tools/precommitTests.sh b/extra-tools/precommitTests.sh index 45af595..7a6336e 100755 --- a/extra-tools/precommitTests.sh +++ b/extra-tools/precommitTests.sh @@ -1,5 +1,5 @@ #!/bin/bash - +######################################################################################################################## Red="\033[0;31m" Green="\033[0;32m" Lblue="\033[1;34m" @@ -8,8 +8,35 @@ NC="\033[0m" REP_FILE="test/precommit.rep" TIME=$(date +%Y-%m-%d:%H:%M:%S) +#how many relics to keep RELIC_COUNT=10 - +######################################################################################################################## +function RelicKeeper +{ + cd ./reliquary/bruiser + RELIC_CNT=$(ls | gawk 'END{print NR}') + if (( $RELIC_CNT > 10 )); then + rm "$(ls -t | tail -1)" + printf "${Orange}RelicKeeper removed the oldest bruiser relic.\n${NC}" | tee -a ../../test/precommit.rep + fi + + cd ../m0 + RELIC_CNT=$(ls | gawk 'END{print NR}') + if (( $RELIC_CNT > 10 )); then + rm "$(ls -t | tail -1)" + printf "${Orange}RelicKeeper removed the oldest m0 relic.\n${NC}" | tee -a ../../test/precommit.rep + fi + + cd ../safercpp + RELIC_CNT=$(ls | gawk 'END{print NR}') + if (( $RELIC_CNT > 10 )); then + rm "$(ls -t | tail -1)" + printf "${Orange}RelicKeeper removed the oldest safercpp relic.\n${NC}" | tee -a ../../test/precommit.rep + fi + + cd ../.. +} +######################################################################################################################## printf "${Lblue}switching to mutator root...\n${NC}" | tee ../test/precommit.rep cd .. @@ -67,8 +94,10 @@ if [[ $? == 0 ]]; then printf "${Green}mutator c++1z test build passed.\n${NC}" | tee -a ./test/precommit.rep printf "${Orange}date and time of relic:.\n${NC}" | tee -a ./test/precommit.rep echo $TIME | tee -a ./test/precommit.rep - cp ./mutator-lvl0 ./reliquary/m0/m0-$TIME - cp ./bruiser/bruiser ./reliquary/bruiser/bruiser-$TIME + "cp" ./mutator-lvl0 ./reliquary/m0/m0-$TIME + "cp" ./bruiser/bruiser ./reliquary/bruiser/bruiser-$TIME + "cp" ./safercpp/safercpp-arr ./reliquary/safercpp/safercpp-$TIME + RelicKeeper else printf "${Red}mutator c++1z test build failed.\n${NC}" | tee -a ./test/precommit.rep fi -- cgit v1.2.3 From b5c0d7753e7041372a4ad8172642bd7feb1a1b2f Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Tue, 30 May 2017 19:13:49 +0430 Subject: added oracle --- extra-tools/precommitTests.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'extra-tools') diff --git a/extra-tools/precommitTests.sh b/extra-tools/precommitTests.sh index 7a6336e..eec5682 100755 --- a/extra-tools/precommitTests.sh +++ b/extra-tools/precommitTests.sh @@ -98,6 +98,7 @@ if [[ $? == 0 ]]; then "cp" ./bruiser/bruiser ./reliquary/bruiser/bruiser-$TIME "cp" ./safercpp/safercpp-arr ./reliquary/safercpp/safercpp-$TIME RelicKeeper + source ./extra-tools/oracle.sh ./test/precommit.rep else printf "${Red}mutator c++1z test build failed.\n${NC}" | tee -a ./test/precommit.rep fi -- cgit v1.2.3 From 1b90b852824ad60a673cd99fa581558237ec36bb Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Tue, 30 May 2017 19:14:34 +0430 Subject: oracle --- extra-tools/oracle.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 extra-tools/oracle.sh (limited to 'extra-tools') diff --git a/extra-tools/oracle.sh b/extra-tools/oracle.sh new file mode 100755 index 0000000..f5d07ae --- /dev/null +++ b/extra-tools/oracle.sh @@ -0,0 +1,19 @@ +#!/bin/bash +Red="\033[0;31m" +Green="\033[0;32m" +Lblue="\033[1;34m" +Orange="\033[0;33m" +Magenta="\033[1;35m" +NC="\033[0m" +######################################################################################################################## +printf "${Magenta}Running oracle...\n${NC}" | tee -a $1 + +#m0 +"diff" ./test/misrareport.xml ./oracle/m0/oracle-m0.xml | tee ./oralce-m0-diff + +printf "${Magenta}Running oracle for m0...\n${NC}" | tee -a $1 +if [ -s oracle-m0-diff ]; then + printf "${RED}The oracle test failed.\n${NC}" | tee -a $1 +fi + +printf "${Green}The oracle test passed.\n${NC}" | tee -a $1 -- cgit v1.2.3