Add a way to run the testsuite in compile-only mode.

pull/92/head
Dan Gohman 6 years ago
parent a73a2b3779
commit 757c262719

@ -1,21 +1,27 @@
#!/bin/bash
set -ueo pipefail
# Top-level test runner. Usage is "run.sh <runwasi>" where <runwasi> is a
# WASI-capable runtime.
# Top-level test runner. Usage is "run.sh" to run tests in compile-only mode,
# or "run.sh <runwasi>" where <runwasi> is a WASI-capable runtime to run the
# tests in full compile and execute mode.
runwasi="$1"
# Determine the wasm runtime to use, if one is provided.
if [ $# -gt 0 ]; then
runwasi="$1"
else
runwasi=""
fi
cd compile-only
for options in -O0 -O2 "-O2 -flto"; do
echo "===== Testing compile-only with $options ====="
for file in *.c; do
echo "Testing compile-only $file..."
../testcase.sh true clang "$options" "$file"
../testcase.sh "" clang "$options" "$file"
done
for file in *.cc; do
echo "Testing compile-only $file..."
../testcase.sh true clang++ "$options" "$file"
../testcase.sh "" clang++ "$options" "$file"
done
done
cd - >/dev/null

@ -26,8 +26,15 @@ fi
echo "Testing $input..."
# Determine the input file to write to stdin.
# Compile the testcase.
"$clang" $options $file_options "$input" -o "$wasm"
# If we don't have a runwasi command, we're just doing compile-only testing.
if [ "$runwasi" == "" ]; then
exit 0
fi
# Determine the input file to write to stdin.
if [ -e "$input.stdin" ]; then
stdin="$input.stdin"
else

Loading…
Cancel
Save