Skip to content

Commit f2a9eae

Browse files
committed
Ensuring proepr input and output from runtime compilation to skip if needed
1 parent 6e2c100 commit f2a9eae

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

containersQa/InProcessCompileDemo.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
public class InProcessCompileDemo {
99
public static void main(String[] args) throws Exception {
10-
String jvmVersion="17";
10+
String version = System.getProperty("java.version");
11+
String jvmVersion = version.split("\\.")[0];
1112
if (args.length>0) {
1213
jvmVersion=args[0];
1314
}
@@ -35,7 +36,7 @@ public static void main(String[] args) {
3536
StandardJavaFileManager std = compiler.getStandardFileManager(diagnostics, null, null);
3637
MemoryFileManager memFM = new MemoryFileManager(std);
3738

38-
// compile for a specific release (22 here)
39+
// compile for a specific release
3940
JavaCompiler.CompilationTask task = compiler.getTask(
4041
null, memFM, diagnostics,
4142
List.of("--release", jvmVersion), null, List.of(source));

containersQa/testlib.bash

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,10 @@ function runOnBaseDirBashWithMount() {
236236
cp -r $LIBCQA_SCRIPT_DIR/*.java "${d}"
237237
chmod 777 "${d}"
238238
ls -ld ${d}
239-
${2} $PD_PROVIDER run -v="${d}:/testsDir:Z" -i "$HASH" bash -c "${1}"
239+
local r=0
240+
${2} $PD_PROVIDER run -v="${d}:/testsDir:Z" -i "$HASH" bash -c "${1}" || r=$?
240241
rm -rf "${d}"
242+
return $r
241243
}
242244

243245
function runOnBaseDirBashOtherUser() {
@@ -1183,5 +1185,5 @@ function tryJreCompilation() {
11831185
else
11841186
echo '17+, going on'
11851187
fi
1186-
runOnBaseDirBashWithMount "java /testsDir/InProcessCompileDemo.java" "$1"
1188+
runOnBaseDirBashWithMount "java /testsDir/InProcessCompileDemo.java $OTOOL_JDK_VERSION" "$1"
11871189
}

0 commit comments

Comments
 (0)