summaryrefslogtreecommitdiffstats
path: root/test/097-duplicate-method
diff options
context:
space:
mode:
authorSebastien Hertz <shertz@google.com>2015-02-24 17:39:50 +0100
committerSebastien Hertz <shertz@google.com>2015-07-08 17:20:35 +0200
commit19ac0276208f0afef6ba8a4ab34b74a59b8d11d7 (patch)
treef8947b62f0d500e2ff5fef8edb5fb61abd21fc82 /test/097-duplicate-method
parent30502f1fc8357bdaf11b70e6fc8f5311c6237194 (diff)
downloadart-19ac0276208f0afef6ba8a4ab34b74a59b8d11d7.tar.gz
art-19ac0276208f0afef6ba8a4ab34b74a59b8d11d7.tar.bz2
art-19ac0276208f0afef6ba8a4ab34b74a59b8d11d7.zip
Support compiling run-tests with jack
This CL adds support to compile run-test source files with jack. When a test needs to rely on class files, we use jill to convert them to a jack library. We need to pass the full classpath to jack containing at least core classes (like java.lang.Object). This means the Android tree must have been compiled with jack first so we find all the necessary classes.jack files. Some tests still rely on dex files generated with the old toolchain. We keep building them this way for the moment and will update them later, when they get ready for Jack. Also updates a few tests dealing with garbage collection to avoid a situation where a reference can be retained by a local DEX register. Bug: 19467889 Change-Id: I9eedd0705d1186d28a2acd37ea42a1762cd0ace2
Diffstat (limited to 'test/097-duplicate-method')
-rw-r--r--test/097-duplicate-method/build17
1 files changed, 14 insertions, 3 deletions
diff --git a/test/097-duplicate-method/build b/test/097-duplicate-method/build
index 657677986e..a8558739de 100644
--- a/test/097-duplicate-method/build
+++ b/test/097-duplicate-method/build
@@ -18,8 +18,19 @@
set -e
mkdir classes
-${JAVAC} -d classes src/*.java
-${JASMIN} -d classes src/*.j
-${DX} --debug --dex --dump-to=classes.lst --output=classes.dex classes
+if [ ${USE_JACK} = "true" ]; then
+ ${JACK} --output-jack src.jack src
+
+ ${JASMIN} -d classes src/*.j
+ ${JILL} classes --output jasmin.jack
+
+ # We set jack.import.type.policy=keep-first to consider class definitions from jasmin first.
+ ${JACK} --import jasmin.jack --import src.jack -D jack.import.type.policy=keep-first --output-dex .
+else
+ ${JAVAC} -d classes src/*.java
+ ${JASMIN} -d classes src/*.j
+
+ ${DX} --debug --dex --dump-to=classes.lst --output=classes.dex classes
+fi
zip $TEST_NAME.jar classes.dex