Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise timeout time to 60 to fix Travis build #1

Merged
merged 1 commit into from
Dec 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions check.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
#!/bin/bash

# Check that self-compiling works and produces the same output.
check() {
echo 'n' | timeout 10 ./blynn classy "$1" classy2 &&
echo 'n' | timeout 10 ./blynn classy2 "$1" classy3 &&
printf '\n' && diff -qs classy2 classy3;
TIMEOUT=60
# Check that self-compiling works
stage1() {
echo 'n' | timeout $TIMEOUT ./blynn classy "$1" classy2 ||
(echo 'Stage 1 fail' && exit 1)
}

stage2() {
echo 'n' | timeout $TIMEOUT ./blynn classy2 "$1" classy3 ||
(echo 'Stage 2 fail' && exit 1)
}

check() {
stage1 "$1" &&
stage2 "$1" &&
printf '\n' &&
diff -qs classy2 classy3
}
if [[ $1 == "" ]]
then
echo "./check.sh <compiler source>"
Expand Down
25 changes: 21 additions & 4 deletions check_compile.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
#!/bin/bash

TIMEOUT=60
# Very meta. We self-compile three times because if a change was made
# the compiler's output in classy.hs, we need to compile two more
# times to propagate that change.
stage1() {
echo 'n' | timeout $TIMEOUT ./blynn classy "$1" classy2 ||
(echo 'Stage 1 fail' && exit 1)
}

stage2() {
echo 'n' | timeout $TIMEOUT ./blynn classy2 "$1" classy3 ||
(echo 'Stage 2 fail' && exit 1)
}

stage3() {
echo 'n' | timeout $TIMEOUT ./blynn classy3 "$1" classy4 ||
(echo 'Stage 3 fail' && exit 1)
}

check_compile() {
echo 'n' | timeout 10 ./blynn classy "$1" classy2 &&
echo 'n' | timeout 10 ./blynn classy2 "$1" classy3 &&
echo 'n' | timeout 10 ./blynn classy3 "$1" classy4 &&
printf '\n' && diff -qs classy3 classy4;
stage1 "$1" &&
stage2 "$1" &&
stage3 "$1" &&
printf '\n' &&
diff -qs classy3 classy4
}
if [[ $1 == "" ]]
then
Expand Down