Skip to content

Commit

Permalink
Use glob for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
eed3si9n committed Dec 25, 2024
1 parent 9a5e8fd commit ef473ef
Show file tree
Hide file tree
Showing 14 changed files with 12 additions and 39 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ lazy val root = (project in file("."))
}
scriptedSbt := {
scalaBinaryVersion.value match {
case "2.12" => "1.10.2"
case "2.12" => "1.10.7"
case _ => "2.0.0-M3"
}
}
Expand Down
8 changes: 0 additions & 8 deletions src/sbt-test/caching/caching/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,3 @@ lazy val root = (project in file(".")).
()
}
)

TaskKey[Unit]("fileCheck1") := {
assert((crossTarget.value / "foo.jar").exists())
}

TaskKey[Unit]("fileCheck2") := {
assert((crossTarget.value / "jarHash.txt").exists())
}
4 changes: 2 additions & 2 deletions src/sbt-test/caching/caching/test
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# check if the file gets created
> clean
> assembly
> fileCheck1
$ exists target/**/foo.jar

# run to cache the hash, then check it's consistent
> check
> checkhash
> fileCheck2
$ exists target/**/jarHash.txt
> checkhash

> assembly
Expand Down
4 changes: 0 additions & 4 deletions src/sbt-test/caching/custommergestrat/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,3 @@ def mustContain(f: File, l: Seq[String]): Unit = {
TaskKey[Unit]("copy-preserve-last-modified") := {
IO.copy(Seq((crossTarget.value / "foo.jar") -> (crossTarget.value / "foo-1.jar")), true, true, true)
}

TaskKey[Unit]("fileCheck1") := {
assert((crossTarget.value / "foo.jar").exists())
}
4 changes: 2 additions & 2 deletions src/sbt-test/caching/custommergestrat/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
> assembly
> fileCheck1
$ exists target/**/foo.jar
> check
> copyPreserveLastModified

Expand All @@ -8,6 +8,6 @@

# assembly should run again, invalidating the cache because of the custom merge strategy
> assembly
> fileCheck1
$ exists target/**/foo.jar
> check
# $ newer target/scala-2.12/foo.jar target/scala-2.12/foo-1.jar
2 changes: 1 addition & 1 deletion src/sbt-test/merging/merging/test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# check if the file gets created
> debug
> assembly
$ exists target/**/foo.jar

# check if it says hello
> check
4 changes: 0 additions & 4 deletions src/sbt-test/sbt-assembly/config/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,3 @@ lazy val root = (project in file("."))
()
}
)

TaskKey[Unit]("fileCheck") := {
assert((crossTarget.value / "foo.jar").exists())
}
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-assembly/config/test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# check if the file gets created
> Test/assembly
> fileCheck
$ exists target/**/foo.jar

# check if it says hello
> check
4 changes: 0 additions & 4 deletions src/sbt-test/sbt-assembly/deps/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,3 @@ lazy val root = (project in file("."))
()
}
)

TaskKey[Unit]("fileCheck") := {
assert((crossTarget.value / "foo.jar").exists())
}
4 changes: 0 additions & 4 deletions src/sbt-test/sbt-assembly/piecemeal/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ lazy val root = (project in file("."))
}
)

TaskKey[Unit]("fileCheck1") := {
assert((crossTarget.value / "foo-assembly-0.1.jar").exists())
}

TaskKey[Unit]("fileCheck2") := {
assert((crossTarget.value / "foo-assembly-0.1-deps.jar").exists())
}
Expand Down
6 changes: 3 additions & 3 deletions src/sbt-test/sbt-assembly/piecemeal/test
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# check if the file gets created
> assembly
> fileCheck1
$ exists target/**/foo-assembly-0.1.jar

# try running this JAR. this should fail
-> check1

# check if the file gets created
> assemblyPackageDependency
> fileCheck2
$ exists target/**/foo-assembly-0.1-deps.jar

# check if the file gets created
> assemblyPackageScala
> fileCheck3
$ exists target/**/scala-library-2.12.18-assembly.jar

# check if it says hello
> check2
4 changes: 0 additions & 4 deletions src/sbt-test/sbt-assembly/simple/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,3 @@ TaskKey[Unit]("check") := {
if (out.trim != "hello") sys.error("unexpected output: " + out)
()
}

TaskKey[Unit]("fileCheck") := {
assert((crossTarget.value / "foo.jar").exists())
}
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-assembly/simple/test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# check if the file gets created
> assembly
> fileCheck
$ exists target/**/foo.jar

# check if it says hello
> check
1 change: 1 addition & 0 deletions src/sbt-test/shading/shading/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# check if the file gets created
> assembly
$ exists target/**/foo.jar

# check if it says hello
> check

0 comments on commit ef473ef

Please sign in to comment.