-
Notifications
You must be signed in to change notification settings - Fork 5
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
Showing
12 changed files
with
124 additions
and
76 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
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
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
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name = "importGraph" | ||
defaultTargets = ["ImportGraph", "graph"] | ||
testRunner = "test" | ||
|
||
[[require]] | ||
name = "Cli" | ||
git = "https://github.com/leanprover/lean4-cli" | ||
rev = "main" | ||
|
||
[[require]] | ||
name = "batteries" | ||
git = "https://github.com/leanprover-community/batteries" | ||
rev = "main" | ||
|
||
[[lean_lib]] | ||
name = "ImportGraph" | ||
|
||
# `lake exe graph` constructs import graphs in `.dot` or graphical formats. | ||
[[lean_exe]] | ||
name = "graph" | ||
root = "Main" | ||
# Enables the use of the Lean interpreter by the executable (e.g., `runFrontend`) | ||
# at the expense of increased binary size on Linux. | ||
# Remove this line if you do not need such functionality. | ||
supportInterpreter = true | ||
|
||
[[lean_exe]] | ||
name = "test" | ||
srcDir = "scripts" |
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 +1,2 @@ | ||
leanprover/lean4:nightly-2024-04-02 | ||
leanprover/lean4:nightly-2024-06-15 | ||
|
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/- | ||
Copyright (c) 2024 Kim Morrison. All rights reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Kim Morrison | ||
-/ | ||
open IO.Process | ||
open System | ||
|
||
/- | ||
This is a copy-paste from Batteries test runner. | ||
If https://github.com/leanprover/lean4/pull/4121 is resolved, use Batteries' script directly. | ||
-/ | ||
|
||
/-- | ||
Run tests. | ||
If no arguments are provided, run everything in the `test/` directory. | ||
If arguments are provided, assume they are names of files in the `test/` directory, | ||
and just run those. | ||
-/ | ||
def main (args : List String) : IO Unit := do | ||
-- We first run `lake build`, to ensure oleans are available. | ||
-- Alternatively, we could use `lake lean` below instead of `lake env lean`, | ||
-- but currently with parallelism this results in build jobs interfering with each other. | ||
_ ← (← IO.Process.spawn { cmd := "lake", args := #["build"] }).wait | ||
-- Collect test targets, either from the command line or by walking the `test/` directory. | ||
let targets ← match args with | ||
| [] => System.FilePath.walkDir "./test" | ||
| _ => pure <| (args.map fun t => mkFilePath [".", "test", t] |>.withExtension "lean") |>.toArray | ||
let existing ← targets.filterM fun t => do pure <| (← t.pathExists) && !(← t.isDir) | ||
-- Generate a `lake env lean` task for each test target. | ||
let tasks ← existing.mapM fun t => do | ||
IO.asTask do | ||
let out ← IO.Process.output | ||
{ cmd := "lake", | ||
args := #["env", "lean", t.toString], | ||
env := #[("LEAN_ABORT_ON_PANIC", "1")] } | ||
if out.exitCode = 0 then | ||
IO.println s!"Test succeeded: {t}" | ||
else | ||
IO.eprintln s!"Test failed: `lake env lean {t}` produced:" | ||
unless out.stdout.isEmpty do IO.eprintln out.stdout | ||
unless out.stderr.isEmpty do IO.eprintln out.stderr | ||
pure out.exitCode | ||
-- Wait on all the jobs and exit with 1 if any failed. | ||
let mut exitCode : UInt8 := 0 | ||
for t in tasks do | ||
let e ← IO.wait t | ||
match e with | ||
| .ok 0 => pure () | ||
| _ => exitCode := 1 | ||
exit exitCode |
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