-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.wake
39 lines (34 loc) · 1.4 KB
/
build.wake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
global def exampleChiselWake =
makeScalaModuleFromJSON here "example-chisel-wake"
global def testExampleChiselWake =
makeScalaModuleFromJSON here "test-example-chisel-wake"
| setScalaModuleDeps (exampleChiselWake, Nil)
| setScalaModuleSourceDirs ("src/test/scala", Nil)
| setScalaModuleResourceDirs ("src/test/resources", Nil)
def reportScalaTest report job =
def printReport paths =
def reports = paths | filter (_.getPathName ==~ report)
match reports
report, Nil =
def res = read report
def _ = rmap println res
Pass "Success!"
# Nil suggests that ScalaTest didn't run
Nil = match paths
bad, Nil if bad.getPathError.isSome =
match bad.getPathError
Some err = Fail err
None = job.getJobStderr
x = Fail "Something has gone horribly wrong".makeError
x = Fail "Ran Scala Test expected exactly 1 report, got {format x}".makeError
match job.getJobOutputs
Nil = job.getJobStderr
output, Nil if output.getPathError.isSome =
printReport job.getJobFailedOutputs
| rmapPass (\_ Fail "ScalaTest failed!".makeError)
one, Nil = panic "bad"
outputs = printReport outputs
global def runTest tester =
def report = "test.report.txt"
runJava testExampleChiselWake.scalaModuleClasspath "org.scalatest.tools.Runner" ("-f", report, "-s", tester, Nil) Nil
| reportScalaTest report