graalvm / native-build-tools

Native-image plugins for various build tools
https://graalvm.github.io/native-build-tools/
Other
348 stars 51 forks source link

[QUESTION] nativeTest with runtime arguments? #604

Open cmeiklejohn-dd opened 3 weeks ago

cmeiklejohn-dd commented 3 weeks ago

Describe the problem Is there a way to configure the native tests to set system properties -- as you can do when building and running the native image?

System Info (please complete the following information):

To Reproduce set runtimeArgs = "-Dproperty_name=true" and run ./gradlew nativeTest -- execution will invoke the test binary without the system property flag.

vjovanov commented 4 days ago

Have you tried doing the following in the gradle build:

        named("test") {
            runtimeArgs.add("-Dproperty_name=true")
        }

If this does not work, please provide relevant commands that were executed so we can inspect what happened. Even better would be to provide a reproducer as a github repo.