-
Notifications
You must be signed in to change notification settings - Fork 0
/
export_to_spec.sh
executable file
·44 lines (30 loc) · 1.24 KB
/
export_to_spec.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
# Use this script to export/copy the tests in this repo to the spec repo
# Usage: ./export_to_spec.sh SPEC_REPO_PATH
# A commit we expect to see in the spec repo.
# Just used as a check to see that the repo path is valid.
SPEC_REPO_COMMIT="ec38c06717612db984314ceef08878838e1fd9ee"
function error() {
echo "Error: $1"
exit 1
}
if [[ $# -ne 1 ]] ; then
error "invalid arguments argument. Usage: ./export_to_spec.sh SPEC_REPO_PATH"
fi
spec_repo_dir=$(readlink -f $1)
if [[ ! -d "$spec_repo_dir" ]] ; then
echo 123
fi
pushd "$spec_repo_dir" || error "could not cd to $spec_repo_dir"
git rev-parse --verify "$SPEC_REPO_COMMIT" ||
error "Did not find expected commit $SPEC_REPO_COMMIT in $spec_repo_dir. Is it really a spec repo?"
popd
if [[ ! -d "$spec_repo_dir/test/core/stack-switching" ]]; then
mkdir "$spec_repo_dir/test/core/stack-switching"
fi
cp spec/stack-switching/validation.wast $spec_repo_dir/test/core/stack-switching/validation.wast
cp spec/stack-switching/validation_gc.wast $spec_repo_dir/test/core/stack-switching/validation_gc.wast
# Let's make sure that our tests actually work
cd "$spec_repo_dir"/interpreter
make || error "failed to build reference interpreter"
make test || error "New tests caused failure?"