fi
# Detect a working time command
-if env time --quiet -f%U true 2>/dev/null; then
- TIME="env time --quiet -f%U"
-elif env time -f%U true 2>/dev/null; then
- TIME="env time -f%U"
-elif env gtime -f%U true 2>/dev/null; then
- TIME="env gtime -f%U"
+if command time --quiet -f%e true 2>/dev/null; then
+ TIME="command time --quiet -f%e"
+elif command time -f%e true 2>/dev/null; then
+ TIME="command time -f%e"
+elif command gtime -f%e true 2>/dev/null; then
+ TIME="command gtime -f%e"
else
TIME=
fi
fi
# Detect a working hostname command
-if hostname --version | grep coreutils >/dev/null 2>&1; then
+if hostname --version 2>&1 | grep coreutils >/dev/null 2>&1; then
HOSTNAME="hostname"
else
HOSTNAME="hostname -s"
fi
+UNAME=`uname | sed s/-.*//`
+
# $1 is the pattern of the test
# $2 is the file to compare to
# the result is:
fi
# Skip by OS
- local os_skip_file=`uname`.skip
+ local os_skip_file=$UNAME.skip
if test -e $os_skip_file && echo "$1" | grep -f "$os_skip_file" >/dev/null 2>&1; then
echo "=> $2: [skip os]"
echo >>$xml "<testcase classname='`xmlesc "$3"`' name='`xmlesc "$2"`' `timestamp`><skipped/></testcase>"
find_nitc()
{
local name="$enginebinname"
- local recent=`ls -t ../src/$name ../src/$name_[0-9] ../bin/$name ../c_src/$name 2>/dev/null | head -1`
+ local recent=`ls -t ../src/$name ../src/$name_[0-9] ../bin/$name ../contrib/nitin/bin/$name ../c_src/$name 2>/dev/null | head -1`
if [[ "x$recent" == "x" ]]; then
echo "Could not find binary for engine $engine, aborting"
exit 1
done
enginebinname=$engine
isinterpret=
+isinteractive=
case $engine in
nitc|nitg)
engine=nitcs;
OPT="--vm $OPT"
savdirs="sav/niti/"
;;
+ nitin)
+ enginebinname=nitin
+ isinteractive=true
+ ;;
nitj)
engine=nitj;
OPT="--compile-dir $compdir --ant"
;;
esac
-savdirs="sav/`$HOSTNAME` sav/`uname` sav/$engine $savdirs sav/"
+savdirs="sav/`$HOSTNAME` sav/$UNAME sav/$engine $savdirs sav/"
# The default nitc compiler
[ -z "$NITC" ] && find_nitc
> "$ff.compile.log"
ERR=0
echo 0.0 > "$ff.time.out"
+ elif [ -n "$isinteractive" ]; then
+ cat > "$ff.bin" <<END
+exec $NITC --no-color --no-prompt $OPT $includes < $(printf '%q' "$i") "\$@"
+END
+ chmod +x "$ff.bin"
+ > "$ff.cmp.err"
+ > "$ff.compile.log"
+ ERR=0
+ echo 0.0 > "$ff.time.out"
else
if skip_cc "$bf"; then
nocc="--no-cc"