-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
56be1a9
commit ca65f2a
Showing
5 changed files
with
30 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,28 @@ | ||
#!/usr/bin/env bats | ||
|
||
setup() { | ||
mkdir ${BATS_TMPDIR}/4-section-test | ||
} | ||
|
||
teardown() { | ||
rm -rf "$BATS_TMPDIR/OBJ" | ||
cd ../../../.. | ||
rm -rf ${BATS_TMPDIR}/4-section-test | ||
} | ||
|
||
@test "PLCC compiles with 4 sections." { | ||
# Copy the OBJ language to the temp directory for this test | ||
cp -R "${BATS_TEST_DIRNAME}/OBJ" "${BATS_TMPDIR}" | ||
cp -R "${BATS_TEST_DIRNAME}/OBJ" "${BATS_TMPDIR}/4-section-test" | ||
|
||
# Change into the temporary OBJ directory. | ||
cd "${BATS_TMPDIR}/OBJ" | ||
cd "${BATS_TMPDIR}/4-section-test/OBJ" | ||
|
||
# Use plcc to generate the Java files from the OBJ grammar file. | ||
plcc "grammar" | ||
|
||
# Change into the generated Java file. | ||
cd Java | ||
|
||
# Compile the Java files. | ||
run javac -cp "/${BATS_TEST_DIRNAME}/../../../lib/jackson/*" *.java | ||
plccmk grammar | ||
|
||
# Print stdout and stderr for debugging. | ||
echo "OUTPUT: $output" | ||
echo "ERROR: $error" | ||
|
||
# Assert success. | ||
[ "$status" -eq 0 ] | ||
[[ "$status" -eq 0 ]] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,5 +30,5 @@ teardown() { | |
echo "ERROR: $error" | ||
|
||
# Assert success. | ||
[ "$status" -eq 0 ] | ||
[[ "$status" -eq 0 ]] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters