aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtests/fuzz/test.sh3
-rwxr-xr-xtests/fuzz/testpp.sh51
-rw-r--r--tests/test_core.py5
3 files changed, 57 insertions, 2 deletions
diff --git a/tests/fuzz/test.sh b/tests/fuzz/test.sh
index af00e966..7e6b8966 100755
--- a/tests/fuzz/test.sh
+++ b/tests/fuzz/test.sh
@@ -45,4 +45,7 @@ diff fc-sh js | grep -v warning
echo "native/fc"
grep -v warning fc > fclean
diff n1 fclean | grep -v warning
+echo "native2/fc"
+grep -v warning fc > fclean
+diff n2 fclean | grep -v warning
diff --git a/tests/fuzz/testpp.sh b/tests/fuzz/testpp.sh
new file mode 100755
index 00000000..8e9f4185
--- /dev/null
+++ b/tests/fuzz/testpp.sh
@@ -0,0 +1,51 @@
+# 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 "builds"
+rm *.out *.bc *.js
+g++ $@ -I/home/alon/Dev/csmith/runtime -o n1.out &> /dev/null
+/home/alon/Dev/fastcomp/build/Release/bin/clang++ $@ -I/home/alon/Dev/csmith/runtime -o n2.out &> /dev/null
+/home/alon/Dev/fastcomp/build/Release/bin/clang++ $@ -I/home/alon/Dev/csmith/runtime -emit-llvm -c -o bc.bc &> o
+~/Dev/emscripten/em++ $@ -I/home/alon/Dev/csmith/runtime -o js.out.js &> /dev/null
+~/Dev/emscripten/em++ $@ -s UNALIGNED_MEMORY=1 -I/home/alon/Dev/csmith/runtime -o ua.out.js &> /dev/null
+~/Dev/emscripten/em++ $@ -s SAFE_HEAP=1 -I/home/alon/Dev/csmith/runtime -o sh.out.js &> /dev/null
+EMCC_FAST_COMPILER=1 ~/Dev/emscripten/em++ $@ -I/home/alon/Dev/csmith/runtime -o fc.out.js &> /dev/null
+EMCC_FAST_COMPILER=1 ~/Dev/emscripten/em++ $@ -s SAFE_HEAP=1 -I/home/alon/Dev/csmith/runtime -o fc-sh.out.js &> /dev/null
+echo "run n1"
+./n1.out &> n1
+echo "run n2"
+./n2.out &> n2
+echo "run bc"
+/home/alon/Dev/fastcomp/build/Release/bin/lli bc.bc &> bc
+echo "run js"
+mozjs js.out.js &> js
+echo "run ua"
+mozjs ua.out.js &> ua
+echo "run sh"
+mozjs sh.out.js &> sh
+echo "run fc"
+mozjs fc.out.js &> fc
+echo "run fc-sh"
+mozjs fc-sh.out.js &> fc-sh
+echo "n/n"
+diff n1 n2
+echo "n/bc"
+diff n1 bc
+echo "n/js"
+diff n1 js | grep -v warning
+echo "n/js-ua"
+diff n1 ua | grep -v warning
+echo "n/js-sh"
+diff n1 sh | grep -v warning
+echo "js/fc"
+diff fc js | grep -v warning
+echo "js/fc-sh"
+diff fc-sh js | grep -v warning
+echo "native/fc"
+grep -v warning fc > fclean
+diff n1 fclean | grep -v warning
+echo "native2/fc"
+grep -v warning fc > fclean
+diff n2 fclean | grep -v warning
+
diff --git a/tests/test_core.py b/tests/test_core.py
index e598655d..b633d514 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -5181,12 +5181,13 @@ def process(filename):
def run_all(x):
print x
- for name in glob.glob(path_from_root('tests', 'fuzz', '*.c')):
+ for name in glob.glob(path_from_root('tests', 'fuzz', '*.c')) + glob.glob(path_from_root('tests', 'fuzz', '*.cpp')):
#if os.path.basename(name) != '4.c': continue
+ if 'newfail' in name: continue
print name
self.do_run(open(path_from_root('tests', 'fuzz', name)).read(),
- open(path_from_root('tests', 'fuzz', name + '.txt')).read(), force_c=True)
+ open(path_from_root('tests', 'fuzz', name + '.txt')).read(), force_c=name.endswith('.c'))
run_all('normal')