Commit 9f12492c authored by Akim Demaille's avatar Akim Demaille

tests: be robust to concurrency

* tests/defs.in: Let each test work in its own temp dir.

* tests/cmp.test, tests/trace.test, tests/overflow.test: cmp is quite
useless, use diff.
parent 799684d1
#! /bin/sh
# Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
# Copyright (C) 2012-2016 EPITA Research and Development Laboratory (LRDE)
#
# This file is part of HAVM.
#
......@@ -18,13 +18,11 @@
. ./tests/defs || exit 1
set -e
HAVM_pass --trace $srcdir/tests/cmp.lir
cmp stdout $srcdir/tests/cmp.out
diff -u $srcdir/tests/cmp.out stdout
test -s stderr
HAVM_pass --trace=3 $srcdir/tests/cmp.lir 3>stdtrc
cmp stdout $srcdir/tests/cmp.out
diff -u $srcdir/tests/cmp.out stdout
test ! -s stderr
test -s stdtrc
# -*- shell-script -*-
# @configure_input@
#
# Copyright (C) 2006, 2012 EPITA Research and Development Laboratory (LRDE)
# Copyright (C) 2006-2016 EPITA Research and Development Laboratory (LRDE)
#
# This file is part of HAVM.
#
......@@ -79,11 +79,13 @@ case "$srcdir" in
;;
esac
chmod -R a+rwx testSubDir > /dev/null 2>&1
rm -rf testSubDir > /dev/null 2>&1
mkdir testSubDir
base=$(basename "$0" ".test")
testdir=$base.dir
chmod -R a+rwx "$testdir" > /dev/null 2>&1
rm -rf "$testdir" > /dev/null 2>&1
mkdir "$testdir"
cd ./testSubDir
cd ./"$testdir"
echo "=== Running test $0"
......
#! /bin/sh
# Copyright (C) 2014 EPITA Research and Development Laboratory (LRDE)
# Copyright (C) 2014-2016 EPITA Research and Development Laboratory (LRDE)
#
# This file is part of HAVM.
#
......
#! /bin/sh
# Copyright (C) 2014 EPITA Research and Development Laboratory (LRDE)
# Copyright (C) 2014-2016 EPITA Research and Development Laboratory (LRDE)
#
# This file is part of HAVM.
#
......@@ -21,10 +21,10 @@
set -e
HAVM_pass --trace $srcdir/tests/overflow.lir
cmp stdout $srcdir/tests/overflow.out
diff -u $srcdir/tests/overflow.out stdout
test -s stderr
HAVM_pass --trace=3 $srcdir/tests/overflow.lir 3>stdtrc
cmp stdout $srcdir/tests/overflow.out
diff -u $srcdir/tests/overflow.out stdout
test ! -s stderr
test -s stdtrc
#! /bin/sh
# Copyright (C) 2006 EPITA Research and Development Laboratory (LRDE)
# Copyright (C) 2006-2016 EPITA Research and Development Laboratory (LRDE)
#
# This file is part of HAVM.
#
......@@ -21,10 +21,10 @@
set -e
HAVM_pass --trace $srcdir/tests/fact.lir
cmp stdout $srcdir/tests/fact.out
diff -u $srcdir/tests/fact.out stdout
test -s stderr
HAVM_pass --trace=3 $srcdir/tests/fact.lir 3>stdtrc
cmp stdout $srcdir/tests/fact.out
diff -u $srcdir/tests/fact.out stdout
test ! -s stderr
test -s stdtrc
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment