Skip to content

Commit 9c0b91d

Browse files
Gedochaotgodzik
authored andcommitted
Add support for running the test sub-command with the bisect script (scala#22796)
Example usage: ```bash scala project/scripts/bisect.scala --jvm 17 -- --bootstrapped --releases 3.6.4-RC1-bin-20241120-bd07317-NIGHTLY... test smth.test.scala ``` `smth.test.scala` ```scala //> using dep org.scalameta::munit::1.1.0 //> using platform js class MyTests extends munit.FunSuite { test("foo") { assert(2 + 2 == 4) } } ``` Allowed to bisect scala#22794 [Cherry-picked c9eaa14]
1 parent af0e3ad commit 9c0b91d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

project/scripts/bisect.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ val usageMessage = """
2020
|The <validation-command> should be one of:
2121
|* compile <arg1> <arg2> ...
2222
|* run <arg1> <arg2> ...
23+
|* test <arg1> <arg2> ...
2324
|* <custom-validation-script-path>
2425
|
2526
|The arguments for 'compile' and 'run' should be paths to the source file(s) and optionally additional options passed directly to scala-cli.
@@ -100,20 +101,24 @@ object ScriptOptions:
100101
enum ValidationCommand:
101102
case Compile(args: Seq[String])
102103
case Run(args: Seq[String])
104+
case Test(args: Seq[String])
103105
case CustomValidationScript(scriptFile: File)
104106

105107
def validationScript: File = this match
106108
case Compile(args) =>
107109
ValidationScript.tmpScalaCliScript(command = "compile", args)
108110
case Run(args) =>
109111
ValidationScript.tmpScalaCliScript(command = "run", args)
112+
case Test(args) =>
113+
ValidationScript.tmpScalaCliScript(command = "test", args)
110114
case CustomValidationScript(scriptFile) =>
111115
ValidationScript.copiedFrom(scriptFile)
112116

113117
object ValidationCommand:
114118
def fromArgs(args: Seq[String]) = args match
115119
case Seq("compile", commandArgs*) => Compile(commandArgs)
116120
case Seq("run", commandArgs*) => Run(commandArgs)
121+
case Seq("test", commandArgs*) => Test(commandArgs)
117122
case Seq(path) => CustomValidationScript(new File(path))
118123

119124

0 commit comments

Comments
 (0)