function execute
{
- scripts/tctestsgen.sh $1 `pwd` desktop
+ scripts/tctestsgen.sh $1 `pwd` desktop $2
testkit-lite -f `pwd`/tests.xml -o tct-${1}-core-tests.xml -A --comm localhost
scripts/add_style.pl $1
}
if [ -n "$1" ] ; then
echo EXECUTING ONLY $1
- execute $1
+ execute $*
else
for mod in `ls -1 src/ | grep -v CMakeList `
do
if [ $mod != 'common' ] && [ $mod != 'manual' ]; then
echo EXECUTING $mod
- execute $mod
+ execute $mod $*
fi
done
fi
# usage note and exit:
-# - argument begin with '-' but is not recognised or number of arguments is > 2,
-# - argument doesn't begin with '-' and number of arguments is > 1
-if [[ ( "$1" == -* && ( ! "$1" =~ ^-(anum|mnum|f)$ || $# > 2 ) ) || ( "$1" != -* && $# > 1 ) ]]; then
+# - argument begin with '-' but is not recognised or number of arguments is > 3,
+# - argument doesn't begin with '-' and number of arguments is > 2
+if [[ ( "$1" == -* && ( ! "$1" =~ ^-(anum|mnum|f)$ || $# > 3 ) ) || ( "$1" != -* && $# > 2 ) ]]; then
echo -e "$USAGE"
exit 1
fi
-
# get directory from last argument (or assume current one)
if [[ ! "$1" =~ ^-(anum|mnum|f)$ ]]; then
DIR=${1:-.}
DIR=${2:-.}
fi
+# get filename from last argument
+if [[ $# == 3 && -f $DIR/$3 ]] ; then
+ FILE=$3
+elif [[ $# == 2 && -f $DIR/$2 ]] ; then
+ FILE=$2
+fi
+
+#Debug needs to be output on stderr ( calling script redirects stdout to file )
+#echo "Dir: $DIR File: $FILE" >& 2
# populate $TC_FILES with files declared in CMakeLists.txt
-get_tc_files $DIR
-if [ $? != 0 ]; then
- exit 1
+if [[ -z $FILE ]]; then
+ get_tc_files $DIR
+ if [ $? != 0 ]; then
+ exit 1
+ fi
+ echo "Got all files" >& 2
+else
+ TC_FILES="$DIR/$FILE"
+ echo "TC_FILES: $TC_FILES" >& 2
fi
+
# run appropriate subcommand
case "$1" in
-anum)
}' $TFILE > $FILE
}
-(cd $SCRIPT_DIR/..; scripts/retriever.sh -f src/$MODULE_NAME > ${TFILE}_pre)
+(cd $SCRIPT_DIR/..; scripts/retriever.sh -f src/$MODULE_NAME $4 > ${TFILE}_pre)
if [ $? -ne 0 ]; then cat ${TFILE}_pre; exit 1; fi
cat ${TFILE}_pre | sort -t',' -k2,2 -s > $TFILE
gen