nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tests: add some runtime error in nitin.input
[nit.git]
/
tests
/
tests.sh
diff --git
a/tests/tests.sh
b/tests/tests.sh
index
308ff84
..
e413069
100755
(executable)
--- a/
tests/tests.sh
+++ b/
tests/tests.sh
@@
-154,6
+154,8
@@
else
HOSTNAME="hostname -s"
fi
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:
# $1 is the pattern of the test
# $2 is the file to compare to
# the result is:
@@
-373,7
+375,7
@@
need_skip()
fi
# Skip by OS
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>"
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>"
@@
-434,7
+436,7
@@
istodo()
find_nitc()
{
local name="$enginebinname"
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
if [[ "x$recent" == "x" ]]; then
echo "Could not find binary for engine $engine, aborting"
exit 1
@@
-468,6
+470,7
@@
while [ $stop = false ]; do
done
enginebinname=$engine
isinterpret=
done
enginebinname=$engine
isinterpret=
+isinteractive=
case $engine in
nitc|nitg)
engine=nitcs;
case $engine in
nitc|nitg)
engine=nitcs;
@@
-513,6
+516,10
@@
case $engine in
OPT="--vm $OPT"
savdirs="sav/niti/"
;;
OPT="--vm $OPT"
savdirs="sav/niti/"
;;
+ nitin)
+ enginebinname=nitin
+ isinteractive=true
+ ;;
nitj)
engine=nitj;
OPT="--compile-dir $compdir --ant"
nitj)
engine=nitj;
OPT="--compile-dir $compdir --ant"
@@
-530,7
+537,7
@@
case $engine in
;;
esac
;;
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
# The default nitc compiler
[ -z "$NITC" ] && find_nitc
@@
-627,6
+634,15
@@
END
> "$ff.compile.log"
ERR=0
echo 0.0 > "$ff.time.out"
> "$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"
else
if skip_cc "$bf"; then
nocc="--no-cc"