diff FaCT++-linux-v1.5.2/Models.lisp/create-new-test @ 19:cc270db37d33 draft

Directories re-arranged
author Mikel Egana Aranguren <mikel-egana-aranguren@toolshed.g2.bx.psu.edu>
date Sat, 06 Oct 2012 21:50:39 +0200
parents OPPL/FaCT++-linux-v1.5.2/Models.lisp/create-new-test@40adbcb2a7cc
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/FaCT++-linux-v1.5.2/Models.lisp/create-new-test	Sat Oct 06 21:50:39 2012 +0200
@@ -0,0 +1,60 @@
+#!/bin/bash
+
+# Script for creating new test-suit.
+# In parameters: <suit-name> <source-tbox>
+# output:
+#  - create <suit-name> directory
+#  - copy <source-tbox> into <suit-name>/<suit-name>.tbox
+#  - create Makefile and conf-file
+
+# file names
+MKNAME=./$1/Makefile
+TBOXNAME=./$1/$1.tbox
+CONFNAME=./$1/$1.conf
+
+# .orig files path
+OFP=.
+
+Usage()
+{
+	echo
+	echo "Usage: create-new-test <suit-name> <source-tbox>"
+	echo " where: <suit-name>   -- unique name for new suit"
+	echo "        <source-tbox> -- test TBox file"
+	exit 1
+}
+
+Fatal()
+{
+  echo "Fatal: directory $1 already exists"
+  exit 1
+}
+
+# check for the parameters
+if test "$1" = ""; then
+  Usage
+elif test "$2" = ""; then
+  Usage
+fi
+
+# create new subdir
+mkdir $1 || Fatal
+
+# create Makefile for the test suit
+cp $OFP/Makefile.default $MKNAME
+echo "KB_CONF = $1.conf" >> $MKNAME
+echo "KB = $1.tbox" >> $MKNAME
+echo >> $MKNAME
+echo "sat classify:" >> $MKNAME
+echo "	FaCT++ \$(KB_CONF)" >> $MKNAME
+
+# create TBox file for the test suit
+cp $2 $TBOXNAME
+
+# create Config file for the test suit
+cp $OFP/options.default $CONFNAME
+cat $OFP/query.default >> $CONFNAME
+echo "TBox = $1.tbox" >> $CONFNAME
+echo >> $CONFNAME
+
+echo "Finished!"