aboutsummaryrefslogtreecommitdiff
path: root/tests/fuzz
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-12-20 10:50:39 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-12-20 10:50:39 -0800
commit4c698d2b1b398f015ac937cf8b60dd346911d88d (patch)
tree514a8d48843f082f27de818f1e8931bb8b351c3e /tests/fuzz
parent5f707bda116a92aadff1f14299c969203f6fdfaf (diff)
csmith fixes
Diffstat (limited to 'tests/fuzz')
-rwxr-xr-xtests/fuzz/csmith_driver.py2
-rw-r--r--tests/fuzz/test.sh20
2 files changed, 21 insertions, 1 deletions
diff --git a/tests/fuzz/csmith_driver.py b/tests/fuzz/csmith_driver.py
index c987a3be..ecf5d2dc 100755
--- a/tests/fuzz/csmith_driver.py
+++ b/tests/fuzz/csmith_driver.py
@@ -10,7 +10,7 @@ import os, sys, difflib, shutil
from distutils.spawn import find_executable
from subprocess import check_call, Popen, PIPE, STDOUT, CalledProcessError
-sys.path += [os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'tools')]
+sys.path += [os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))), 'tools')]
import shared
engine1 = eval('shared.' + sys.argv[1]) if len(sys.argv) > 1 else shared.JS_ENGINES[0]
diff --git a/tests/fuzz/test.sh b/tests/fuzz/test.sh
new file mode 100644
index 00000000..60815c9f
--- /dev/null
+++ b/tests/fuzz/test.sh
@@ -0,0 +1,20 @@
+# e.g.
+# ~/Dev/emscripten/tests/fuzz$ CSMITH=~/Dev/csmith/src/csmith CSMITH_PATH=~/Dev/csmith python ./csmith_driver.py
+# to find failures, then check those out with this script
+
+echo "0"
+gcc $1 -I/home/alon/Dev/csmith/runtime
+~/Dev/emscripten/emcc $1 -I/home/alon/Dev/csmith/runtime
+./a.out
+mozjs a.out.js
+echo "1"
+gcc -O1 $1 -I/home/alon/Dev/csmith/runtime
+~/Dev/emscripten/emcc -O1 $1 -I/home/alon/Dev/csmith/runtime
+./a.out
+mozjs a.out.js
+echo "2"
+gcc -O2 $1 -I/home/alon/Dev/csmith/runtime
+~/Dev/emscripten/emcc -O2 $1 -I/home/alon/Dev/csmith/runtime
+./a.out
+mozjs a.out.js
+