Added autotest.sh -p option
authorClifford Wolf <clifford@clifford.at>
Thu, 2 Jan 2014 16:51:30 +0000 (17:51 +0100)
committerClifford Wolf <clifford@clifford.at>
Thu, 2 Jan 2014 16:52:48 +0000 (17:52 +0100)
tests/tools/autotest.sh

index fcc212378a804de2f5101a96ff3eb64be74c4def..b1c330d89cc0782cd3cec05c1ad26e4bd192c37f 100755 (executable)
@@ -9,13 +9,14 @@ keeprunning=false
 backend_opts="-noattr -noexpr"
 kompare_xst=false
 scriptfiles=""
+scriptopt=""
 toolsdir="$(cd $(dirname $0); pwd)"
 
 if [ ! -f $toolsdir/cmp_tbdata -o $toolsdir/cmp_tbdata.c -nt $toolsdir/cmp_tbdata ]; then
        ( set -ex;  gcc -Wall -o $toolsdir/cmp_tbdata $toolsdir/cmp_tbdata.c; ) || exit 1
 fi
 
-while getopts iml:wkvrxs: opt; do
+while getopts iml:wkvrxs:p: opt; do
        case "$opt" in
                i)
                        use_isim=true ;;
@@ -30,14 +31,16 @@ while getopts iml:wkvrxs: opt; do
                v)
                        verbose=true ;;
                r)
-                       backend_opts="$backend_opts norename" ;;
+                       backend_opts="$backend_opts -norename" ;;
                x)
                        kompare_xst=true ;;
                s)
                        [[ "$OPTARG" == /* ]] || OPTARG="$PWD/$OPTARG"
                        scriptfiles="$scriptfiles $OPTARG" ;;
+               p)
+                       scriptopt="$OPTARG" ;;
                *)
-                       echo "Usage: $0 [-i] [-w] [-k] [-v] [-r] [-x] [-l libs] [-s script] verilog-files\n" >&2
+                       echo "Usage: $0 [-i] [-w] [-k] [-v] [-r] [-x] [-l libs] [-s script] [-p cmdstring] verilog-files\n" >&2
                        exit 1
        esac
 done
@@ -147,6 +150,8 @@ do
 
                if [ -n "$scriptfiles" ]; then
                        test_passes
+               elif [ -n "$scriptopt" ]; then
+                       test_passes -p "$scriptopt"
                else
                        test_passes -p "hierarchy; proc; opt; memory; opt; fsm; opt"
                        test_passes -p "hierarchy; proc; opt; memory; opt; fsm; opt; techmap; opt; abc -dff; opt"