Skip to content

Commit

Permalink
stdlib: Fix refactor typo (#1660)
Browse files Browse the repository at this point in the history
* stdlib: Fix refactor typo

* Add test
  • Loading branch information
V-FEXrt authored Oct 1, 2024
1 parent 6bf30ff commit d38dd06
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion share/wake/lib/system/job.wake
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def runAlways cmd env dir stdin res uusage finputs foutputs vis keep run echo st
run job (Pass (RunnerInput label cmd vis env dir stdin res prefix usage isatty finputs foutputs))

def final _ = match output
Fail e -> primJobFailLaunch job e
Fail e -> primJobFailFinish job e
Pass (RunnerOutput inputs outputs cleanable reality) ->
def hashedOutputs =
outputs
Expand Down
1 change: 1 addition & 0 deletions tests/standard-library/runner/.wakeroot
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"log_header":"", "log_header_source_width":0}
9 changes: 9 additions & 0 deletions tests/standard-library/runner/pass.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#! /bin/sh

WAKE="${1:+$1/wake}"

# Since we are writing jobs to the database in this test we should clear it for each run if it
# happens to exist from a previous run
rm -f wake.db wake.log

"${WAKE:-wake}" --stdout=warning,report testRunnerFailFinish
1 change: 1 addition & 0 deletions tests/standard-library/runner/stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
False
13 changes: 13 additions & 0 deletions tests/standard-library/runner/test.wake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export def testRunnerFailFinish _ =
def run job input =
def (Runner _ virtRun) = virtualRunner
require Pass _ = virtRun job (Pass input)

# Force a failure outside of the actual job
failWithError "Mark job as failure"

def testRunner = makeRunner "" run

makeExecPlan ("<test>", Nil) Nil
| runJobWith testRunner
| isJobOk

0 comments on commit d38dd06

Please sign in to comment.