From 28665a983802a4aabfcc12e74a0e6d4ac6d9a965 Mon Sep 17 00:00:00 2001 From: Severin Gehwolf Date: Mon, 15 Jan 2024 15:04:06 +0100 Subject: [PATCH] [CI] Add smoke test for --enable-preview --- .github/workflows/buildJDK.yml | 49 ++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/.github/workflows/buildJDK.yml b/.github/workflows/buildJDK.yml index 429d2ca..d63889b 100644 --- a/.github/workflows/buildJDK.yml +++ b/.github/workflows/buildJDK.yml @@ -103,8 +103,19 @@ jobs: ${MANDREL_HOME}/bin/native-image HelloStrict ./hellostrict | tee native.txt diff java.txt native.txt + rm -f java.txt native.txt ${MANDREL_HOME}/bin/native-image --macro:native-image-launcher ${MANDREL_HOME}/bin/native-image --version + echo " + void main() { + System.out.println(\"Implicitly declared classes.\"); + } + " > ImplicitClass.java + ${MANDREL_HOME}/bin/javac --enable-preview --release 21 ImplicitClass.java + ${MANDREL_HOME}/bin/java --enable-preview ImplicitClass | tee java.txt + ${MANDREL_HOME}/bin/native-image --enable-preview ImplicitClass + ./implicitclass | tee native.txt + diff java.txt native.txt - name: Upload Mandrel build uses: actions/upload-artifact@v3 with: @@ -194,8 +205,19 @@ jobs: ${MANDREL_HOME}/bin/native-image HelloStrict ./hellostrict | tee native.txt diff java.txt native.txt + rm -f java.txt native.txt ${MANDREL_HOME}/bin/native-image --macro:native-image-launcher ${MANDREL_HOME}/bin/native-image --version + echo " + void main() { + System.out.println(\"Implicitly declared classes.\"); + } + " > ImplicitClass.java + ${MANDREL_HOME}/bin/javac --enable-preview --release 21 ImplicitClass.java + ${MANDREL_HOME}/bin/java --enable-preview ImplicitClass | tee java.txt + ${MANDREL_HOME}/bin/native-image --enable-preview ImplicitClass + ./implicitclass | tee native.txt + diff java.txt native.txt - name: Upload Mandrel build uses: actions/upload-artifact@v3 with: @@ -295,7 +317,23 @@ jobs: Write-Host $DIFF exit 1 } + & Remove-Item -Path java.txt -Force + & Remove-Item -Path native.txt -Force & ${MANDREL_HOME}/bin/native-image.cmd --macro:native-image-launcher + Set-Content -Path 'ImplicitClass.java' -Value " + void main() { + System.out.println(`"Implicitly declared classes.`"); + } + " + & $MANDREL_HOME\bin\javac --enable-preview --release 21 ImplicitClass.java + & $MANDREL_HOME\bin\java --enable-preview ImplicitClass | Set-Content java.txt + & $MANDREL_HOME\bin\native-image.cmd --enable-preview ImplicitClass + & ./implicitclass | Set-Content native.txt + $DIFF=(Compare-Object -CaseSensitive (Get-Content java.txt) (Get-Content native.txt)) + if ($DIFF -ne $null) { + Write-Host $DIFF + exit 1 + } - name: Rename mandrel archive shell: bash run: | @@ -396,8 +434,19 @@ jobs: ${MANDREL_HOME}/bin/native-image HelloStrict ./hellostrict | tee native.txt diff java.txt native.txt + rm -f java.txt native.txt ${MANDREL_HOME}/bin/native-image --macro:native-image-launcher ${MANDREL_HOME}/bin/native-image --version + echo " + void main() { + System.out.println(\"Implicitly declared classes.\"); + } + " > ImplicitClass.java + ${MANDREL_HOME}/bin/javac --enable-preview --release 21 ImplicitClass.java + ${MANDREL_HOME}/bin/java --enable-preview ImplicitClass | tee java.txt + ${MANDREL_HOME}/bin/native-image --enable-preview ImplicitClass + ./implicitclass | tee native.txt + diff java.txt native.txt - name: Upload Mandrel build uses: actions/upload-artifact@v3 with: