File tree Expand file tree Collapse file tree 2 files changed +19
-6
lines changed Expand file tree Collapse file tree 2 files changed +19
-6
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
set -ueo pipefail
3
3
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.
6
7
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
8
14
9
15
cd compile-only
10
16
for options in -O0 -O2 " -O2 -flto" ; do
11
17
echo " ===== Testing compile-only with $options ====="
12
18
for file in * .c; do
13
19
echo " Testing compile-only $file ..."
14
- ../testcase.sh true clang " $options " " $file "
20
+ ../testcase.sh " " clang " $options " " $file "
15
21
done
16
22
for file in * .cc; do
17
23
echo " Testing compile-only $file ..."
18
- ../testcase.sh true clang++ " $options " " $file "
24
+ ../testcase.sh " " clang++ " $options " " $file "
19
25
done
20
26
done
21
27
cd - > /dev/null
Original file line number Diff line number Diff line change 26
26
27
27
echo " Testing $input ..."
28
28
29
- # Determine the input file to write to stdin .
29
+ # Compile the testcase .
30
30
" $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.
31
38
if [ -e " $input .stdin" ]; then
32
39
stdin=" $input .stdin"
33
40
else
You can’t perform that action at this time.
0 commit comments