From 2877c873122e834ff95a02fe958a95a8357f04e0 Mon Sep 17 00:00:00 2001 From: jules Ivanic Date: Sun, 16 Jul 2023 18:59:04 +0400 Subject: [PATCH] Try fix scripted tests --- .../sbt-native-image/agent-test/build.sbt | 37 +++++++++---------- .../src/main/scala/example/Hello6.scala | 0 .../src/test/scala/example/Hello6Spec.scala | 0 .../sbt-test/sbt-native-image/agent-test/test | 6 +-- .../cross-build-test/project/build.properties | 1 - .../cross-build/project/build.properties | 1 - 6 files changed, 20 insertions(+), 25 deletions(-) rename plugin/src/sbt-test/sbt-native-image/agent-test/{example => }/src/main/scala/example/Hello6.scala (100%) rename plugin/src/sbt-test/sbt-native-image/agent-test/{example => }/src/test/scala/example/Hello6Spec.scala (100%) delete mode 100644 plugin/src/sbt-test/sbt-native-image/cross-build-test/project/build.properties delete mode 100644 plugin/src/sbt-test/sbt-native-image/cross-build/project/build.properties diff --git a/plugin/src/sbt-test/sbt-native-image/agent-test/build.sbt b/plugin/src/sbt-test/sbt-native-image/agent-test/build.sbt index 6df953d..27822ba 100644 --- a/plugin/src/sbt-test/sbt-native-image/agent-test/build.sbt +++ b/plugin/src/sbt-test/sbt-native-image/agent-test/build.sbt @@ -1,21 +1,18 @@ -lazy val example = project - .settings( - scalaVersion := "2.12.18", - Compile / mainClass := Some("example.Hello6"), - nativeImageTestOptions ++= Seq( - s"-H:ReflectionConfigurationFiles=${target.value / "native-image-configs" / "reflect-config.json"}", - "--initialize-at-build-time=scala.collection.immutable.VM", - ), - Test / mainClass := Some("org.scalatest.tools.Runner"), - nativeImageTestRunOptions ++= Seq("-o", "-R", (Test / classDirectory).value.absolutePath), - nativeImageCommand := List( - sys.env.getOrElse( - "NATIVE_IMAGE_COMMAND", - "missing environment variable 'NATIVE_IMAGE_COMMAND'. " + - "To fix this problem, manually install GraalVM native-image and update the environment " + - "variable to point to the absolute path of this binary." - ) - ), - libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.16" % Test +scalaVersion := "2.12.18" +Compile / mainClass := Some("example.Hello6") +nativeImageTestOptions ++= Seq( + s"-H:ReflectionConfigurationFiles=${target.value / "native-image-configs" / "reflect-config.json"}", + "--initialize-at-build-time=scala.collection.immutable.VM", +) +Test / mainClass := Some("org.scalatest.tools.Runner") +nativeImageTestRunOptions ++= Seq("-o", "-R", (Test / classDirectory).value.absolutePath) +nativeImageCommand := List( + sys.env.getOrElse( + "NATIVE_IMAGE_COMMAND", + "missing environment variable 'NATIVE_IMAGE_COMMAND'. " + + "To fix this problem, manually install GraalVM native-image and update the environment " + + "variable to point to the absolute path of this binary." ) - .enablePlugins(NativeImagePlugin) +) +libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.16" % Test +enablePlugins(NativeImagePlugin) diff --git a/plugin/src/sbt-test/sbt-native-image/agent-test/example/src/main/scala/example/Hello6.scala b/plugin/src/sbt-test/sbt-native-image/agent-test/src/main/scala/example/Hello6.scala similarity index 100% rename from plugin/src/sbt-test/sbt-native-image/agent-test/example/src/main/scala/example/Hello6.scala rename to plugin/src/sbt-test/sbt-native-image/agent-test/src/main/scala/example/Hello6.scala diff --git a/plugin/src/sbt-test/sbt-native-image/agent-test/example/src/test/scala/example/Hello6Spec.scala b/plugin/src/sbt-test/sbt-native-image/agent-test/src/test/scala/example/Hello6Spec.scala similarity index 100% rename from plugin/src/sbt-test/sbt-native-image/agent-test/example/src/test/scala/example/Hello6Spec.scala rename to plugin/src/sbt-test/sbt-native-image/agent-test/src/test/scala/example/Hello6Spec.scala diff --git a/plugin/src/sbt-test/sbt-native-image/agent-test/test b/plugin/src/sbt-test/sbt-native-image/agent-test/test index f6ea9ab..a3111e5 100644 --- a/plugin/src/sbt-test/sbt-native-image/agent-test/test +++ b/plugin/src/sbt-test/sbt-native-image/agent-test/test @@ -1,6 +1,6 @@ -> example/nativeImageTestRunAgent +> nativeImageTestRunAgent $ delete hello6.obtained -> example/nativeImageTest +> nativeImageTest $ absent hello6.obtained -> example/nativeImageTestRun +> nativeImageTestRun $ must-mirror hello6.expected hello6.obtained diff --git a/plugin/src/sbt-test/sbt-native-image/cross-build-test/project/build.properties b/plugin/src/sbt-test/sbt-native-image/cross-build-test/project/build.properties deleted file mode 100644 index 0837f7a..0000000 --- a/plugin/src/sbt-test/sbt-native-image/cross-build-test/project/build.properties +++ /dev/null @@ -1 +0,0 @@ -sbt.version=1.3.13 diff --git a/plugin/src/sbt-test/sbt-native-image/cross-build/project/build.properties b/plugin/src/sbt-test/sbt-native-image/cross-build/project/build.properties deleted file mode 100644 index 0837f7a..0000000 --- a/plugin/src/sbt-test/sbt-native-image/cross-build/project/build.properties +++ /dev/null @@ -1 +0,0 @@ -sbt.version=1.3.13