-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-java.sh
executable file
·25 lines (19 loc) · 759 Bytes
/
test-java.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
#!/bin/bash
set -eu
INPUT="$1"
OUTPUT="$(cat "$INPUT" | java -cp .:$HOME/.m2/repository/org/antlr/antlr4/4.7.3-SNAPSHOT/antlr4-4.7.3-SNAPSHOT-complete.jar org.antlr.v4.gui.TestRig Express syntax 2>&1)"
# ignore invalid STEPmod lines
# see https://github.com/lutaml/expressir/issues/7
IGNORE_LINES="$(cat ./test-ignore.txt | grep -v '^#' | grep "^${INPUT/.*iso-10303-stepmod\//} " | sed "s~.*${INPUT/.*iso-10303-stepmod\//} ~~" | tr ',' ' ' | tr '\n' ' ')"
for LINE in $IGNORE_LINES; do
OUTPUT="$(echo "$OUTPUT" | sed "s/^\(line $LINE\)/IGNORE \1/" || true)"
done
OUTPUT2="$(echo "$OUTPUT" | grep -v ^IGNORE || true)"
if [ ! -z "$OUTPUT2" ]; then
echo "FAIL $INPUT"
else
echo "PASS $INPUT"
fi
if [ ! -z "$OUTPUT" ]; then
echo "$OUTPUT"
fi