/
RequiredVersionTest.groovy
48 lines (36 loc) · 1.16 KB
/
RequiredVersionTest.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package org.graalvm.buildtools.gradle;
import org.graalvm.buildtools.gradle.fixtures.AbstractFunctionalTest;
class RequiredVersionTest extends AbstractFunctionalTest {
def "can build a native image with a valid required version"() {
def nativeApp = file("build/native/nativeCompile/java-application")
given:
withSample("java-application")
buildFile << """
graalvmNative.binaries.all {
requiredVersion = '22.2'
}
""".stripIndent()
when:
run 'nativeCompile'
then:
tasks {
succeeded ':jar', ':nativeCompile'
doesNotContain ':build', ':run'
}
and:
nativeApp.exists()
}
def "can't build a native image with an invalid required version"() {
given:
withSample("java-application")
buildFile << """
graalvmNative.binaries.all {
requiredVersion = '100'
}
""".stripIndent()
when:
fails 'nativeCompile'
then:
errorOutputContains "GraalVM version 100 is required but 22 has been detected, please upgrade."
}
}