Skip to content

Add support for running the test sub-command with the bisect script #22796

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions project/scripts/bisect.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ val usageMessage = """
|The <validation-command> should be one of:
|* compile <arg1> <arg2> ...
|* run <arg1> <arg2> ...
|* test <arg1> <arg2> ...
|* <custom-validation-script-path>
|
|The arguments for 'compile' and 'run' should be paths to the source file(s) and optionally additional options passed directly to scala-cli.
Expand Down Expand Up @@ -101,20 +102,24 @@ object ScriptOptions:
enum ValidationCommand:
case Compile(args: Seq[String])
case Run(args: Seq[String])
case Test(args: Seq[String])
case CustomValidationScript(scriptFile: File)

def validationScript: File = this match
case Compile(args) =>
ValidationScript.tmpScalaCliScript(command = "compile", args)
case Run(args) =>
ValidationScript.tmpScalaCliScript(command = "run", args)
case Test(args) =>
ValidationScript.tmpScalaCliScript(command = "test", args)
case CustomValidationScript(scriptFile) =>
ValidationScript.copiedFrom(scriptFile)

object ValidationCommand:
def fromArgs(args: Seq[String]) = args match
case Seq("compile", commandArgs*) => Compile(commandArgs)
case Seq("run", commandArgs*) => Run(commandArgs)
case Seq("test", commandArgs*) => Test(commandArgs)
case Seq(path) => CustomValidationScript(new File(path))


Expand Down
Loading