Made run-test 960-964 support being run with jack compiler.
They will explicitly check that the jack compiler being used is
capable of compiling them before they do however (just to make
test-art work better).
Change-Id: I6b30c50d4159c2924886886d161479cbe869f4b0
diff --git a/test/961-default-iface-resolution-generated/build b/test/961-default-iface-resolution-generated/build
index 5eb851f..03cc624 100755
--- a/test/961-default-iface-resolution-generated/build
+++ b/test/961-default-iface-resolution-generated/build
@@ -17,8 +17,6 @@
# make us exit on a failure
set -e
-mkdir -p ./smali
-
# We will be making more files than the ulimit is set to allow. Remove it temporarily.
OLD_ULIMIT=`ulimit -S`
ulimit -S unlimited
@@ -28,20 +26,31 @@
}
trap 'restore_ulimit' ERR
+mkdir -p ./smali
+
# Generate the smali files and expected.txt or fail
./util-src/generate_smali.py ./smali ./expected.txt
-if [[ $@ == *"--jvm"* ]]; then
- # Build the Java files if we are running a --jvm test
- mkdir -p src
- mkdir -p classes
- ${ANDROID_BUILD_TOP}/art/tools/extract-embedded-java ./smali ./src
- ${JAVAC} -implicit:none -d classes $(find src -name '*.java')
+USES_JAVA="false"
+if [[ $ARGS == *"--jvm"* ]]; then
+ USES_JAVA="true"
+elif [[ $USE_JACK == "true" ]]; then
+ if "$JACK" -D jack.java.source.version=1.8 >& /dev/null; then
+ USES_JAVA="true"
+ else
+ echo "WARNING: Cannot use jack because it does not support JLS 1.8. Falling back to smali" >&2
+ fi
fi
-# Build the smali files and make a dex
-${SMALI} -JXmx512m ${SMALI_ARGS} --output classes.dex $(find smali -name '*.smali')
-zip $TEST_NAME.jar classes.dex
+if [[ "$USES_JAVA" == "true" ]]; then
+ # We are compiling java code, create it.
+ mkdir -p src
+ ${ANDROID_BUILD_TOP}/art/tools/extract-embedded-java ./smali ./src
+ # Ignore the smali directory.
+ EXTRA_ARGS="--no-smali"
+fi
+
+./default-build "$@" "$EXTRA_ARGS" --experimental default-methods
# Reset the ulimit back to its initial value
restore_ulimit