X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/17409dcc5a7e9f03a1180cd740b963b53c2ce6ee..704c26980e576b01caf27af751ca5ca08f8f355a:/functest/do.sh?ds=sidebyside diff --git a/functest/do.sh b/functest/do.sh new file mode 100755 index 00000000..77d928a5 --- /dev/null +++ b/functest/do.sh @@ -0,0 +1,56 @@ +#!/bin/sh + +MKTEMP=/usr/bin/mktemp +RM=/bin/rm + +printf "Creating temporary dir... " +DIR=`$MKTEMP -d` + +if [ "$DIR" == "" ] +then + printf "Failed.\nTemporary dir is empty.\n" + exit -1 +fi + +if [ ! -d "$DIR" ] +then + printf "Failed.\nTemporary dir '$DIR' does not exist or not a directory.\n" + exit -1 +fi + +LOGFILE=`date "+%Y-%m-%d-%H%M%S.log"` + +printf "Ok.\nCloning... " +./clone.sh "$DIR" >> "$LOGFILE" 2>&1 +if [ "$?" != "0" ] +then + printf "Failed.\n" + exit -1 +else + printf "Ok.\nBuilding... " +fi +./build.sh "$DIR" >> "$LOGFILE" 2>&1 +if [ "$?" != "0" ] +then + printf "Failed.\n" + exit -1 +else + printf "Ok.\nTesting... " +fi +./test.sh "$DIR" # >> "$LOGFILE" 2>&1 +if [ "$?" != "0" ] +then + printf "Failed.\n" + exit -1 +else + printf "Ok.\nCleaning up... " +fi + +$RM -rf $DIR +if [ "$?" != "0" ] +then + printf "Failed.\n" + exit -1 +else + printf "Ok.\n" +fi