Skip to content

Commit

Permalink
build(travis): interrupt the built at the first error message
Browse files Browse the repository at this point in the history
  • Loading branch information
cipher1024 committed Feb 10, 2019
1 parent 088f753 commit d3290ec
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -34,11 +34,11 @@ jobs:
include:
- stage: Pre-build-1
script:
- travis_long "timeout 2400 leanpkg test" || true
- travis_long "timeout 2400 leanpkg test" | python scripts/detect_errors.py

- stage: Pre-build-2
script:
- travis_long "timeout 2400 leanpkg test" || true
- travis_long "timeout 2400 leanpkg test" | python scripts/detect_errors.py

- stage: Test
script:
Expand Down
15 changes: 15 additions & 0 deletions scripts/detect_errors.py
@@ -0,0 +1,15 @@

import sys

try:
for line in sys.stdin:
sys.stdout.write(line)
if 'error' in line: raise sys.exit()

This comment has been minimized.

Copy link
@rwbarton

rwbarton Feb 10, 2019

Collaborator

This raise sys.exit() is confusing. sys.exit() already works by raising an exception, so it's like writing raise (raise SystemExit) (if that was valid syntax, which it's not).

I think you actually don't need any try/except to do this, just delete all those lines and the raise sys.exit() and fix the block structure.

except:
try:
for i in range(20):
line = sys.stdin.next()
if not line: break
sys.stdout.write(line)
finally:
sys.exit(-1)
4 changes: 2 additions & 2 deletions src/tactic/interactive.lean
Expand Up @@ -182,10 +182,10 @@ optional arguments:
this tactic fails, the corresponding assumption will be rejected and
the next one will be attempted.
-/
meta def apply_assumption
meta def apply_assumptio
(asms : tactic (list expr) := local_context)
(tac : tactic unit := return ()) : tactic unit :=
tactic.apply_assumption asms tac
tactic.apply_assumptio asms tac

open nat

Expand Down

0 comments on commit d3290ec

Please sign in to comment.