diff options
| author | 2017-06-06 11:36:33 -0700 | |
|---|---|---|
| committer | 2017-06-12 16:30:22 -0700 | |
| commit | 84f2632f6e1e28449a566d44da7dba23bf44fcf7 (patch) | |
| tree | e576b4b9807bc3f0d6fd7d1e453dd5a26c28b96c | |
| parent | 0a50965275df2da590c49a7a955e6ff5a7c7d2ae (diff) | |
tools: Allow testing with javac on buildbot
By running these scripts with 'ANDROID_COMPILE_WITH_JACK=false',
they will instead use javac/desugar/dx to compile the .java files.
Test: art/tools/buildbot-build.sh && art/tools/run-jdwp-tests.sh --mode=host
Test: art/tools/buildbot-build.sh && art/tools/run-libcore-tests.sh --mode=device
Test: art/tools/buildbot-build.sh && art/tools/run-libcore-tests.sh --mode=host
Bug: 36902714
Bug: 37461882
Change-Id: I118d3ec2a3fa31bf85cdcef63d2772df26e07c5e
| -rwxr-xr-x | tools/buildbot-build.sh | 11 | ||||
| -rwxr-xr-x | tools/run-jdwp-tests.sh | 29 | ||||
| -rwxr-xr-x | tools/run-libcore-tests.sh | 28 |
3 files changed, 58 insertions, 10 deletions
diff --git a/tools/buildbot-build.sh b/tools/buildbot-build.sh index 963efa49a5..bf7692ab15 100755 --- a/tools/buildbot-build.sh +++ b/tools/buildbot-build.sh @@ -30,8 +30,13 @@ else out_dir=${OUT_DIR} fi +using_jack=true +if [[ $ANDROID_COMPILE_WITH_JACK == false ]]; then + using_jack=false +fi + java_libraries_dir=${out_dir}/target/common/obj/JAVA_LIBRARIES -common_targets="vogar core-tests apache-harmony-jdwp-tests-hostdex jsr166-tests mockito-target ${out_dir}/host/linux-x86/bin/jack" +common_targets="vogar core-tests apache-harmony-jdwp-tests-hostdex jsr166-tests mockito-target" mode="target" j_arg="-j$(nproc)" showcommands= @@ -58,6 +63,10 @@ while true; do fi done +if $using_jack; then + common_targets="$common_targets ${out_dir}/host/linux-x86/bin/jack" +fi + if [[ $mode == "host" ]]; then make_command="make $j_arg $showcommands build-art-host-tests $common_targets" make_command+=" ${out_dir}/host/linux-x86/lib/libjavacoretests.so " diff --git a/tools/run-jdwp-tests.sh b/tools/run-jdwp-tests.sh index d48d8579be..f7427676eb 100755 --- a/tools/run-jdwp-tests.sh +++ b/tools/run-jdwp-tests.sh @@ -23,10 +23,24 @@ if [ -z "$ANDROID_HOST_OUT" ] ; then ANDROID_HOST_OUT=${OUT_DIR-$ANDROID_BUILD_TOP/out}/host/linux-x86 fi +using_jack=true +if [[ $ANDROID_COMPILE_WITH_JACK == false ]]; then + using_jack=false +fi + +function jlib_suffix { + local str=$1 + local suffix="jar" + if $using_jack; then + suffix="jack" + fi + echo "$str.$suffix" +} + # Jar containing all the tests. -test_jack=${ANDROID_HOST_OUT}/../common/obj/JAVA_LIBRARIES/apache-harmony-jdwp-tests-hostdex_intermediates/classes.jack +test_jar=$(jlib_suffix "${ANDROID_HOST_OUT}/../common/obj/JAVA_LIBRARIES/apache-harmony-jdwp-tests-hostdex_intermediates/classes") -if [ ! -f $test_jack ]; then +if [ ! -f $test_jar ]; then echo "Before running, you must build jdwp tests and vogar:" \ "make apache-harmony-jdwp-tests-hostdex vogar" exit 1 @@ -147,6 +161,12 @@ if [[ $verbose == "yes" ]]; then art_debugee="$art_debugee -verbose:jdwp" fi +if $using_jack; then + toolchain_args="--toolchain jack --language JN --jack-arg -g" +else + toolchain_args="--toolchain jdk --language CUR" +fi + # Run the tests using vogar. vogar $vm_command \ $vm_args \ @@ -160,10 +180,9 @@ vogar $vm_command \ --vm-arg -Djpda.settings.waitingTime=$jdwp_test_timeout \ --vm-arg -Djpda.settings.transportAddress=127.0.0.1:55107 \ --vm-arg -Djpda.settings.debuggeeJavaPath="$art_debugee $image $debuggee_args" \ - --classpath $test_jack \ - --toolchain jack --language JN \ + --classpath "$test_jar" \ + $toolchain_args \ --vm-arg -Xcompiler-option --vm-arg --debuggable \ - --jack-arg -g \ $test vogar_exit_status=$? diff --git a/tools/run-libcore-tests.sh b/tools/run-libcore-tests.sh index b860a6273f..f9f375457b 100755 --- a/tools/run-libcore-tests.sh +++ b/tools/run-libcore-tests.sh @@ -25,10 +25,26 @@ else JAVA_LIBRARIES=${ANDROID_PRODUCT_OUT}/../../common/obj/JAVA_LIBRARIES fi +using_jack=true +if [[ $ANDROID_COMPILE_WITH_JACK == false ]]; then + using_jack=false +fi + +function classes_jar_path { + local var="$1" + local suffix="jar" + + if $using_jack; then + suffix="jack" + fi + + echo "${JAVA_LIBRARIES}/${var}_intermediates/classes.${suffix}" +} + function cparg { for var do - printf -- "--classpath ${JAVA_LIBRARIES}/${var}_intermediates/classes.jack "; + printf -- "--classpath $(classes_jar_path "$var") "; done } @@ -36,7 +52,7 @@ DEPS="core-tests jsr166-tests mockito-target" for lib in $DEPS do - if [ ! -f "${JAVA_LIBRARIES}/${lib}_intermediates/classes.jack" ]; then + if [[ ! -f "$(classes_jar_path "$lib")" ]]; then echo "${lib} is missing. Before running, you must run art/tools/buildbot-build.sh" exit 1 fi @@ -122,8 +138,12 @@ done # the default timeout. vogar_args="$vogar_args --timeout 480" -# Use Jack with "1.8" configuration. -vogar_args="$vogar_args --toolchain jack --language JO" +# Switch between using jack or javac+desugar+dx +if $using_jack; then + vogar_args="$vogar_args --toolchain jack --language JO" +else + vogar_args="$vogar_args --toolchain jdk --language CUR" +fi # JIT settings. if $use_jit; then |