From f9f5199fb819ca7897ef895f9a4a86aecb147446 Mon Sep 17 00:00:00 2001 From: kevinrs Date: Fri, 23 Dec 2005 21:09:32 +0000 Subject: 2005-12-23 Kevin Stafford SCRIPTS: run.sh - This is the driver for automated testing. To run: ./run.sh stpdirectory c_binaries_directory Result: log/timestamp.log discerpancy report ctostp.sh - This script generates corresponding stp probe script files for every C file found in the input directory. To Run: ctostp.sh input output where input is the directory containing the C files to convert. Output is the directory to store the corresponding stp files. build.sh - This script expedites the process of compiling all of the c files. When the "compile" flag is given it creates a directory called bin, which stores the compiled C programs. ./build.sh clean removes the binaries, and ./build.sh run attempts to execute all of the programs in cfiles/bin. --- tapset/test/build.sh | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100755 tapset/test/build.sh (limited to 'tapset/test/build.sh') diff --git a/tapset/test/build.sh b/tapset/test/build.sh new file mode 100755 index 00000000..05b64f67 --- /dev/null +++ b/tapset/test/build.sh @@ -0,0 +1,56 @@ +function usage { + echo -ne " \033[1mUsage:\033[0m build [compile|clean|run]\n" + echo -ne " \033[1mDo not remove this script from this dir!\033[0m\n" + exit +} +function clean { + rm -rf bin +} +function compile { + if [ ! -d bin ]; then + mkdir bin + else + rm -rf bin/* + fi + for file in `ls *.c` + do + execn=e_`echo $file|cut -d"." -f1` + # some depend on external realtime lib... + if [[ `echo $file|grep clock|wc -l` -gt 0 + || `echo $file|grep timer|wc -l` -gt 0 ]] + then + gcc -lrt $file -o bin/$execn + else + gcc $file -o bin/$execn + fi + done + if [ `ls *.c|wc -l` -eq `ls bin|wc -l` ]; then + echo "Success: compiled `ls bin|wc -l` files." + else + echo "Some files failed to compile! Try again." + fi +} +function run { + if [ ! -d bin -o `ls bin|wc -l` -le 0 ]; then + echo "No compiled C files! First build compile!" + exit + else + for execn in `ls bin` + do + echo "$execn _______________________________" + ./bin/$execn + done + fi +} + +if [ $# -ne 1 ]; then + usage +elif [ $1 == "compile" ]; then + compile +elif [ $1 == "clean" ]; then + clean +elif [ $1 == "run" ]; then + run +else + usage +fi -- cgit