aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2017-05-29 15:41:24 +0000
committerbloodstalker <thabogre@gmail.com>2017-05-29 15:41:24 +0000
commita323e646a2678add598b55f927e8fb587e7635d0 (patch)
tree4e299fafde88be7d59dd6a383ad116e8acbe6df8
parentadded the reliquary dorectories (diff)
downloadmutator-a323e646a2678add598b55f927e8fb587e7635d0.tar.gz
mutator-a323e646a2678add598b55f927e8fb587e7635d0.zip
added reliquary
-rwxr-xr-xextra-tools/precommitTests.sh37
1 files changed, 33 insertions, 4 deletions
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