File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /bin/bash
22set -ueo pipefail
33
4- # Top-level test runner. Usage is "run.sh <runwasi>" where <runwasi> is a
5- # WASI-capable runtime.
4+ # Top-level test runner. Usage is "run.sh" to run tests in compile-only mode,
5+ # or "run.sh <runwasi>" where <runwasi> is a WASI-capable runtime to run the
6+ # tests in full compile and execute mode.
67
7- runwasi=" $1 "
8+ # Determine the wasm runtime to use, if one is provided.
9+ if [ $# -gt 0 ]; then
10+ runwasi=" $1 "
11+ else
12+ runwasi=" "
13+ fi
814
915cd compile-only
1016for options in -O0 -O2 " -O2 -flto" ; do
1117 echo " ===== Testing compile-only with $options ====="
1218 for file in * .c; do
1319 echo " Testing compile-only $file ..."
14- ../testcase.sh true clang " $options " " $file "
20+ ../testcase.sh " " clang " $options " " $file "
1521 done
1622 for file in * .cc; do
1723 echo " Testing compile-only $file ..."
18- ../testcase.sh true clang++ " $options " " $file "
24+ ../testcase.sh " " clang++ " $options " " $file "
1925 done
2026done
2127cd - > /dev/null
Original file line number Diff line number Diff line change 2626
2727echo " Testing $input ..."
2828
29- # Determine the input file to write to stdin .
29+ # Compile the testcase .
3030" $clang " $options $file_options " $input " -o " $wasm "
31+
32+ # If we don't have a runwasi command, we're just doing compile-only testing.
33+ if [ " $runwasi " == " " ]; then
34+ exit 0
35+ fi
36+
37+ # Determine the input file to write to stdin.
3138if [ -e " $input .stdin" ]; then
3239 stdin=" $input .stdin"
3340else
You can’t perform that action at this time.
0 commit comments