Skip to content

Commit 518d63d

Browse files
Don't run commands upon HelpTests instantiation (#1762)
That slows down running tests with './mill integration.test "…"', even when no HelpTests are run.
1 parent 04dc235 commit 518d63d

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

modules/integration/src/test/scala/scala/cli/integration/HelpTests.scala

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@ package scala.cli.integration
22

33
import com.eed3si9n.expecty.Expecty.expect
44

5-
import scala.cli.integration.HelpTests.HelpVariants
6-
75
class HelpTests extends ScalaCliSuite {
8-
for { helpOptions <- HelpVariants } {
9-
val help = os.proc(TestUtil.cli, helpOptions).call(check = false)
10-
val helpOutput = help.out.trim()
6+
for (helpOptions <- HelpTests.variants) {
7+
lazy val help = os.proc(TestUtil.cli, helpOptions).call(check = false)
8+
lazy val helpOutput = help.out.trim()
119
val helpOptionsString = helpOptions.mkString(" ")
1210
test(s"$helpOptionsString works correctly") {
1311
assert(
@@ -32,6 +30,6 @@ class HelpTests extends ScalaCliSuite {
3230
}
3331

3432
object HelpTests {
35-
val HelpVariants =
33+
val variants =
3634
Seq(Seq("help"), Seq("help", "-help"), Seq("help", "--help"), Seq("-help"), Seq("--help"))
3735
}

modules/integration/src/test/scala/scala/cli/integration/SipScalaTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class SipScalaTests extends ScalaCliSuite {
122122

123123
def testHelpOutput(binaryName: String): Unit = TestInputs.empty.fromRoot { root =>
124124
val binary = binaryName.prepareBinary(root)
125-
for { helpOptions <- HelpTests.HelpVariants } {
125+
for (helpOptions <- HelpTests.variants) {
126126
val output = os.proc(binary, helpOptions).call(cwd = root).out.trim()
127127
val restrictedFeaturesMentioned = output.contains("package")
128128
if (binaryName.isSip) expect(!restrictedFeaturesMentioned)

0 commit comments

Comments
 (0)