summaryrefslogtreecommitdiff
path: root/Meta/generate-libwasm-spec-test.sh
blob: 33e9c7ab800f5edb4e6d8cb601090210bf87b3bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env bash

if [ $# -ne 4 ]; then
  echo "Usage: $0 <input spec file> <output path> <name> <module output path>"
  exit 1
fi

INPUT_FILE="$1"
OUTPUT_PATH="$2"
NAME="$3"
MODULE_OUTPUT_PATH="$4"

mkdir -p "$OUTPUT_PATH"
mkdir -p "$MODULE_OUTPUT_PATH"

python3 "$(dirname "$0")/generate-libwasm-spec-test.py" "$INPUT_FILE" "$NAME" "$MODULE_OUTPUT_PATH" |\
    if $SKIP_PRETTIER; then
        cat
    else
        prettier --stdin-filepath "test-$NAME.js"
    fi > "$OUTPUT_PATH/$NAME.js"