History log of /external/vogar/src/vogar/Run.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
fe39f9e9b71d8a4b62e9b4873fbe779a004aa536 04-Jan-2018 Neil Fuller <nfuller@google.com> Remove Jack support from vogar

Jack is no longer the toolchain used to build Android
and has been deprecated. This commit removes all
references to Jack/jack/JACK, etc. from Vogar.

Test: Built/ran vogar, make vogar-tests / ran tests
Bug: 67934307
Change-Id: I51ead37ebd54b2190187e889b48adce59f57d6e8
/external/vogar/src/vogar/Run.java
639824094881c66cca8ca0fb802b93eb5b5072c7 19-Oct-2017 Neil Fuller <nfuller@google.com> Adding an enum for toolchain

Tidying up. Likely to be useful when adding
d8 support, and eventually for removing jack
support.

Added an explicit toolchain for javac
(toolchain=javac) which is forced if mode=jvm.

Renamed --toolchain=jdk to --toolchain=dx to
make the dx vs d8 more obvious: both will use
javac.

Ran vogar tests with:

make vogar-tests && java -cp ${ANDROID_BUILD_TOP}/out/host/linux-x86/framework/vogar-tests.jar \
org.junit.runner.JUnitCore vogar.AllTests

Bug: 67934307
Test: Ran vogar with --mode jvm [|--toolchain dx]
Test: Ran vogar with --mode device [|--toolchain jack|--toolchain dx]
Test: See above
Change-Id: Ieaee1bbe8092318ebf54987494a88a2b91a2d33f
/external/vogar/src/vogar/Run.java
0585c04e4930e6811cb7322f522bb0b807991da7 07-Jun-2017 Igor Murashkin <iam@google.com> android: Add support for 1.8 javac and desugar

Using --toolchain jdk will now pass the correct dx minimum api level
(enabling it to use default methods, method handles, etc).

Vogar also now calls desugar before dx to convert invoke-dynamic lambdas
into anonymous inner class lambdas (because Android does not have
a LambdaMetafactory).

Test: art/tools/run-libcore-tests.sh --mode=host
Test: art/tools/run-libcore-tests.sh --mode=device
Test: vogar --toolchain jdk --mode activity --no-multidex libcore/luni/src/test/java/libcore/java/lang/ShortTest.java
Test: vogar --toolchain jdk --benchmark --mode device libcore/benchmarks/src/benchmarks/InvokeInterface.java
Test: java -cp ${ANDROID_BUILD_TOP}/out/host/linux-x86/framework/vogar-tests.jar org.junit.runner.JUnitCore vogar.AllTests
Bug: 36902714
Bug: 37461882
Change-Id: I9553e8304c269cd7e4e2b989729d785852e85f4e
/external/vogar/src/vogar/Run.java
c6428e1bcddf0c04ed9f58bf6c89a33d70f75a95 07-Jun-2017 Andreas Gampe <agampe@google.com> Vogar: Remove Android Sampling Profiler support

The sampling profiler has been unmaintained and untested, and will
be removed.

Bug: 37272346
Test: m
Test: Device boots
Test: art/tools/run-libcore-tests.sh
Test: java -cp ${ANDROID_BUILD_TOP}/out/host/linux-x86/framework/vogar-tests.jar org.junit.runner.JUnitCore vogar.AllTests
Change-Id: I64d77244b5816ef1f605d19530b96be38f5c1bc6
/external/vogar/src/vogar/Run.java
388fcad5269758e893c6982fa9e4c2fbb474460a 14-Feb-2017 Neil Fuller <nfuller@google.com> Adding multidex support to vogar

--multidex now exists to pass the necessary flags from vogar to
dx / Jack for (native) multi-dex. This flag is true by default
but can be disabled with --no-multidex.

Primary testing was to run the command line below with a
.jack that Jack is reporting as over the 65k limit with
--no-multidex / --multidex.

vogar --classpath out/target/product/angler/obj/JAVA_LIBRARIES/core-tests_intermediates/classes.jack \
libcore.java.lang.StringTest

The change was confirmed with convoluted manual testing for
--toolchain jdk --language J17 (legacy case using dx).

Also, the vogar tests were run:
java -cp ${ANDROID_BUILD_TOP}/out/host/linux-x86/framework/vogar-tests.jar \
org.junit.runner.JUnitCore vogar.AllTests

Bug: 35308152
Test: See above
Change-Id: I90527a92f11d4d38bbcaff98cd11427ae489ee2b
/external/vogar/src/vogar/Run.java
96035279d18363648de8b9c2b10dfb45c5bd1015 07-Dec-2016 Yohann Roussel <yroussel@google.com> Allow to pass extra arguments to Jack

Test: Art jdwp test
Change-Id: Ifb35d0f709e010daeed1f8527834bdaa7feeddfa
/external/vogar/src/vogar/Run.java
5a0d2c2895b17899dc21f112e79cd550572846ee 28-Mar-2016 Paul Duffin <paulduffin@google.com> Restrict when Caliper benchmarks are run.

Caliper benchmarks will only be run when --benchmark is
specified. They also will not be allowed when --mode=activity.

This removes the need for the client to send the host the name
of the runner that ran the tests. That was only used to check
that the CaliperRunner was always run with the --benchmark
option but that will always be true as the CaliperRunner is only
used when --benchmark option is specified. That allows us to
remove the runnerClass parameter to
TargetMonitor.outcomeStarted(...).

Bug: 26716337
Change-Id: I1a1e4a9e35a6dbd0424cc1ed086ee5f2b022865c
/external/vogar/src/vogar/Run.java
963abb73aba37a071cd914516e056ae89d343426 03-Mar-2016 Neil Fuller <nfuller@google.com> Add caching for Jack artifacts

Unfortunately, the .jack format is not "stable", meaning that
two .jack files produced from the source will vary and will be
cached unnecessarily (bug 27470894) leading to repeated jack
execution. Invoking jack on a prebuilt .jar file works better.

Bug: 26814204
(cherry picked from commit 8a0258e80032761f708d96d9f98fe57fa8774f3c)

Change-Id: Icc015f4e0ba7c4becd3c24c2d1fd2f13a777484b
/external/vogar/src/vogar/Run.java
39f93c4843a86ba62c7c9bd975911562b8a298f9 23-Feb-2016 Neil Fuller <nfuller@google.com> Fix --toolchain jack --mode device --benchmark

Bug: 27312904
Change-Id: I179c6d923667a8a9104ca7a2e3c113bd1541ef38
/external/vogar/src/vogar/Run.java
4b2e7ab15323b2b057e8bb7b0cf361bb2ab880e0 11-Feb-2016 Neil Fuller <nfuller@google.com> Move to using jack for more things instead of dx

Use jack to create .dex.jar files for --mode=host and
--mode=device with --toolchain jack.

Also allow for .jack files on the classpath.

This is a quick-and-dirty change to keep things working for
Jack. Jack is required for the Java 8 work to proceed without
breaking the ART continuous build.

This change deliberately leaves the existing (toolchain=jdk)
untouched.

These changes are just intended to modify the --toolchain
jack behavior. --toolchain jdk should remain the same.

Bug: 27115876
Bug: 26753820
Change-Id: I74bb393b30970bdf1288d4408e13f5c0959a93ea
/external/vogar/src/vogar/Run.java
007321d8750847105b873a38edb9d03d402a4022 08-Jan-2016 Neil Fuller <nfuller@google.com> Rudimentary vogar support for executing Java 8 tests

A few changes:

1) vogar can now take the (currently undocumented in --help) --language
flag. Values are J17 (the default) and JN. This makes it easier to compile
code for --mode jvm that uses Java 1.8 for comparison with the RI and also
allows us to drive Jack with either 1.7 / 1.8 flags.

2) Switch from "jill" to "jack" for translation from .jar to .jack. Also
added some simple timestamp checks to avoid continual regeneration of the
vogar.jack (which is slow).

Jack must be used for host and device ART modes.

For 1.8 code the latest (Carnac) version of Jack is required. To use it:
e.g.
JACK_VERSION=3.9.ALPHA vogar --mode host --toolchain jack \
libcore/testing/InterfaceMethodTest.java

or use:

JACK_VERSION=`basename prebuilts/sdk/tools/jacks/*ALPHA* | sed 's/^jack-//' | sed 's/.jar$//'`

--mode device to run on device

Change-Id: I274e0ff64b3ea62d87e9f970cfb3641dbc14975e
/external/vogar/src/vogar/Run.java
411cb1fb67241125203629229600ecbd821eb9c7 19-Nov-2015 Paul Duffin <paulduffin@google.com> Fix escaping and grouping of arguments to the Target shells

Vogar allows custom arguments to be passed to the classes being
tested. If these contain special shell characters then the
command line used to run the tests may not be correct. e.g. If
the argument was "-Cvm.args=-Xmx256M -Xms256M" (which tells
Caliper to run the benchmark in a process with an initial and
maximum heap size of 256M) then when the command is actually run
by the adb shell they are split into two arguments,
"-Cvm.args=-Xmx256M" and "-Xms256M" which causes Caliper to fail
as the latter is an unrecognized Caliper option.

The solution is to simply escape any special shell characters
with a backslash (\) to ensure that they are treated as literal
characters.

Another bug is that any use of an argument "-c" will result in
all the following arguments being grouped into one, e.g.
fred -c wilma barney betty
will become
fred -c "wilma barney betty"

This behaviour is required when the -c option is part of "sh"
"-c" but not in any other case. This is currently implemented in
Command which is the wrong place as it's a generic class
independent of the Target and the grouping is dependent on the
target shell.

After some investigation it turns out that while grouping isn't
required for AdbTarget and SshTarget like it is for HostTarget
neither does it break anything. Therefore, for simplicity's sake
all targets will group their arguments into one when executing
the command line. That will be done before it is appended to the
targetProcessPrefix().

The escaping and grouping will be done by a new
Target.ScriptBuilder class, instances of which will be created
by a Target.newScriptBuilder() method that will make sure that
the ScriptBuilder returned will be appropriate for the target
shell.

It will provide support for specifying inline environment
variables, a working directory and adding tokens to the command
line. It will escape where necessary, e.g. it will not escape
the environment variable name or assignment but will escape the
value. It will escape all the tokens. When asked to construct an
appropriate command line to execute that script it will group
the script contents into one argument and append it to a target
specific prefix.

VmCommandBuilder will use the new ScriptBuilder to build the
command line that it then passes to Command. It will also be
changed to track environment variables explicitly (will use the
existing but unused env field and method) which it will then
pass onto the ScriptBuilder. Finally, it will track the
workingDirectory as well.

DeviceRuntime and HostRuntime will both change how they use
VmCommandBuilder to make use of the env(String, String) method
and the new workingDirectory(File).

Command will remove the processArgs() method and simply take a
copy of its args.

Added new tests for ScriptBuilder.escape(String) method and
a JUnit 4 TestSuite AllTests that can be used to run all the
tests that currently work within an IDE.

Change-Id: I0351c9fd3fe9d42c1b454251cf78ff74fafb08b2
/external/vogar/src/vogar/Run.java
7029503206e4c89fe167c3389c1062d89cf35c52 19-Nov-2015 Paul Duffin <paulduffin@google.com> Refactoring to make more testable

Prior to making a change in the behaviour to fix an issue with
the quoting of command line arguments this refactors the
existing code and adds some tests to illustrate the existing
behaviour. This will minimize the chances that the fix will
break existing code.

The changes are explained below in more detail.

This applied a couple of common refactorings to a number of
classes:
* Where classes were creating a lot of subsidiary objects in
their constructor I switched to using the dependency injection
pattern (i.e. passing in parameters to the constructor). That
makes it easier for tests to override the behaviour.

* Where classes were being given a huge object (e.g. Run) but
only required a small number of it's fields I replaced the Run
constructor parameter with the individual parts.

LocalTarget - Replaced Run with Log, Mkdir, Rm.

Run - Passed in more parameters into the constructor, moved the
code that created those objects into Vogar.run(). Also, make the
vogarJar() method work when running from a class directory to
allow it to work from within IDEA as well as when running from
jars.

SshTarget - Removed a bit of duplication of the command line
prefix used to run a script remotely.

Target - Method defaultDeviceDir() was removed and the
implementations were made static and accessed directly from
Vogar. That is necessary to break a dependency cycle; AdbTarget
required AndroidSdk, which required DeviceFileCache, which
required runnerDir, which required Target.defaultDeviceDir().
Previously, that was broken by passing the DeviceFileCache to
the AndroidSdk after construction using the setCaches() method
but that has been removed as part of this refactoring.

Vogar - Made the constructor and parseArgs(String[]) visible for
testing. Moved some of the code from Run's constructor here to
create the values to be passed into its expanded constructor.
TargetType was added to encapsulate the defaultDeviceDir() for
each Target implementation class. That allowed the cycle
described in Target to be broken.

AdbTarget - Replaced Run with individual fields. Moved
functionality from AndroidSdk that's only used by this class
into here (waitForDevice(), ensureDirectory(File), remount(),
rm(File), forwardTcp(int), push() and pull()). Bringing in
push() also required moving the pushCache from AndroidSdk as
well. Added DeviceFilesystem as a parameter to avoid having to
have a reference to AndroidSdk.

AndroidSdk - Moved logic that runs shell commands to calculate
the compilationClasspath and androidJarPath out of the
constructor and into a static method to allow tests to pass
dummy values straight into the constructor. Marked constructor
as VisibleForTesting. Removed setCaches(..) method and
pushCache, passed the HostFileCache straight into the
constructor, marking the dexCache field as final. Added explicit
exception when can't find platforms directory rather than
NullPointerException. Moved methods that are only used by either
AdbTarget or DeviceFileCache into those classes.

DeviceFileCache - Replaced AndroidSdk with DeviceFileSystem and
moved cp(File, File) and mv(File, File) from AndroidSdk into
here.

DeviceRuntime - Added a Supplier<String> parameter to provide
the device user name in order to allow tests to provide their
own. That is needed because otherwise the test will attempt
to connect to a device to determine the user name.

Command - Added method to access the args for testing, moved the
special processing of "-c" option from start() into a method
called from the constructor. That allows the test to verify the
processing of that without actually executing the command.
Cleaned up unused workingDirectory method and some minor
warnings.

Added some tests and fixed a compile issue with the
JUnitRunnerTest.

Change-Id: Ib1676ee19a4f0e7a8944b2708a6dbe3899d1d292
/external/vogar/src/vogar/Run.java
328ef3e5167b8f08057aecf67fd4a0b353d9358c 30-Sep-2015 Rayhaan Jaufeerally <rayhaan@google.com> Add support for debugging app activity in Vogar.

This change adds support to debug app activities by adding the
debuggable option to the container application manifest, and
waiting for DDMS to connect before proceeding to run the user
specified code. In particular this change adds a --debug-app
command line flag to vogar because the --debug option requires
a port (which is unused in this scenario, using DDMS instead).

Bug: 20877308

Change-Id: Ia48600f24f9a9c52dc5a8aa72b1fb5fae90a9576
/external/vogar/src/vogar/Run.java
f76a1e929a3ad46e7612a9307efffffc47222cc4 31-Jul-2015 Rayhaan Jaufeerally <rayhaan@google.com> JNI check flag in Vogar.

Add a flag to toggle the use of -Xcheck:jni when not in benchmark
mode. (see b/22310991).

Change-Id: Ibb3c78f154ff0653790f3ef75615015b4b26f64d
/external/vogar/src/vogar/Run.java
fca99ba6a930cd7a36b1807c0201f49a80cadcf6 13-Jul-2015 Rayhaan Jaufeerally <rayhaan@google.com> Experimental support for jack on host mode.
This includes adding a --toolchain={jack,jdk} option which chooses what
to compile sources with. Currently only works with host mode and pending
on b/22382563 to be able to properly compile code with dependencies on
the surrounding package. This depends on the prebuilt jack jar file in
AOSP.

Change-Id: Id4d5eaa51318009fd8a147e4c548be3c62f9c5aa
/external/vogar/src/vogar/Run.java
6373ab628b4a93a375b8cfde633229816ba101af 09-Jul-2015 Rayhaan Jaufeerally <rayhaan@google.com> Drop support for legacy modes: DEVICE_DALVIK, DEVICE_ART_KITKAT, HOST_DALVIK, HOST_ART_KITKAT.

Change-Id: I62825c2055e6865d531bf549e1a75177c0103b74
/external/vogar/src/vogar/Run.java
cef780b87ae30112756d40ea3c639a1660fd7c29 26-Feb-2015 Nicolas Geoffray <ngeoffray@google.com> Add a --test-only option to Vogar.

Option disables running caliper and classes with main.

Change-Id: I5fa5221bc9842dffd1b1f676751b0b892b876449
/external/vogar/src/vogar/Run.java
5ad56966d0c66ab4b733fe97c4b862f5f85711e8 09-Dec-2014 Nicolas Geoffray <ngeoffray@google.com> Add a new "warning" outcome type.

In order to get the same behavior as CTS (that disregards tests in the
expectation files), we need to make "result" entries of tests listed
in the files as an expectation that will just warn and not fail if
the execution result is not the same.

Change-Id: Id9b1ea17098b54df7f0cc71a169f4a1093aee113
/external/vogar/src/vogar/Run.java
5a8fd4b1d6c046471c7b951680cace3eec723fe7 28-Nov-2014 Nicolas Geoffray <ngeoffray@google.com> Add 'modes_variants' in expectation files.

Change-Id: I912d208e38b1dbddb8132f52df71a2fb220b4d34
/external/vogar/src/vogar/Run.java
c620846e4044b3b3a8abfc42ddba4adca4e545d9 05-Aug-2014 nfuller@google.com <nfuller@google.com@aa685c63-decc-881d-cd2b-7fa72aad72e1> Adding back support for Dalvik.
Laying groundwork for 64-bit ART support (--var)
Fixing app_process / activity modes.
Refactoring / renaming classes to better
reflect their purpose.

--mode device and --mode host are for ART-only
releases.
--mode device_dalvik and --mode host_dalvik are
for Dalvik releases.
--mode device_art_kitkat and --mode host_art_kitkat
are for running ART on KitKat releases. Host mode
appears broken, not sure why.

--mode app_process is ART-specific now unless run with
an SDK.

--mode activity didn't appear to work. It works for
simple tests now with ART or with an SDK.

L introduced some changes to System property
behavior which broke TestEnvironment and have been
worked around.


git-svn-id: http://vogar.googlecode.com/svn/trunk@299 aa685c63-decc-881d-cd2b-7fa72aad72e1
/external/vogar/src/vogar/Run.java
50e898cf2b0a57fe7eddb02efc5df5658a03b322 27-Jun-2014 nfuller@google.com <nfuller@google.com@aa685c63-decc-881d-cd2b-7fa72aad72e1> Update vogar to use core-libart instead of core on
device and host

The core library was deleted from AOSP recently, and the
host build defaulted to using ART some time ago.

git-svn-id: http://vogar.googlecode.com/svn/trunk@298 aa685c63-decc-881d-cd2b-7fa72aad72e1
/external/vogar/src/vogar/Run.java
f1622c3bd3278fefaab9fa78aca445908362a74a 19-Apr-2013 bdc@google.com <bdc@google.com@aa685c63-decc-881d-cd2b-7fa72aad72e1> Add --vm-command option to allow vm executable to be overridden

git-svn-id: http://vogar.googlecode.com/svn/trunk@291 aa685c63-decc-881d-cd2b-7fa72aad72e1
/external/vogar/src/vogar/Run.java
5379730d1295c75e2b7b1c6d193e74ba5f54cf17 04-Dec-2012 enh@google.com <enh@google.com@aa685c63-decc-881d-cd2b-7fa72aad72e1> Automatically add libcore resource directories to the runtime classpath.

Note that I added a new flavor of classpath. You might think I could have
just reused the existing --classpath, but that's supplied at compile time
as well as run time, and there might be all kinds of confusing files in
the resource tree that shouldn't be shown to the compiler. (This is certainly
the case with libcore. You can't build with the resource directories on the
compile time classpath.)



git-svn-id: http://vogar.googlecode.com/svn/trunk@285 aa685c63-decc-881d-cd2b-7fa72aad72e1
/external/vogar/src/vogar/Run.java
3b3cf36f62d25eb950f0bf95071a82b83e730a58 20-Dec-2011 jessewilson@google.com <jessewilson@google.com@aa685c63-decc-881d-cd2b-7fa72aad72e1> Fix --stream to run only one test at a time. Otherwise tests are run concurrently and output is interleaved. Use --no-stream to run multiple tests in parallel.

git-svn-id: http://vogar.googlecode.com/svn/trunk@275 aa685c63-decc-881d-cd2b-7fa72aad72e1
/external/vogar/src/vogar/Run.java
eddaebb1f85ac0ed0dba621f2136baf10e8f5296 07-Dec-2011 jessewilson@google.com <jessewilson@google.com@aa685c63-decc-881d-cd2b-7fa72aad72e1> don't require an Android SDK for --mode jvm

git-svn-id: http://vogar.googlecode.com/svn/trunk@274 aa685c63-decc-881d-cd2b-7fa72aad72e1
/external/vogar/src/vogar/Run.java
0eb0936e90bf11463c8ee937ca996d7bd654a098 07-Dec-2011 jessewilson@google.com <jessewilson@google.com@aa685c63-decc-881d-cd2b-7fa72aad72e1> Get most of running on a device via SSH working.

Run on a device like this:
vogar --mode device --ssh 192.168.149.198:2222 SocketTest.java

Currently this is failing because dalvikvm segfaults when invoked via SSH. I suspect it might be a problem with the SSH server running with either the wrong environment or the wrong privileges. I continue to investigate

git-svn-id: http://vogar.googlecode.com/svn/trunk@266 aa685c63-decc-881d-cd2b-7fa72aad72e1
/external/vogar/src/vogar/Run.java
db82cde9016d812b26b6c79e375fdf60ead1d9fa 02-Dec-2011 jessewilson@google.com <jessewilson@google.com@aa685c63-decc-881d-cd2b-7fa72aad72e1> Redefine Environment to Target, with "AdbTarget" and "LocalTarget" implementations. This makes it possible for a new "SshTarget" implementation.

git-svn-id: http://vogar.googlecode.com/svn/trunk@265 aa685c63-decc-881d-cd2b-7fa72aad72e1
/external/vogar/src/vogar/Run.java
6a0f4cdb51f57b4b38f9ee1ed9f44f1afc9f6da6 02-Dec-2011 jessewilson@google.com <jessewilson@google.com@aa685c63-decc-881d-cd2b-7fa72aad72e1> Cleanup registration of task dependencies. Do all of that registration in the driver.

git-svn-id: http://vogar.googlecode.com/svn/trunk@264 aa685c63-decc-881d-cd2b-7fa72aad72e1
/external/vogar/src/vogar/Run.java
f83be5e4273263df2bb9ef609946b911695b3996 02-Dec-2011 jessewilson@google.com <jessewilson@google.com@aa685c63-decc-881d-cd2b-7fa72aad72e1> Use tasks everywhere.

I still need to smash together the 'Run' and 'Vogar' classes; this is an intermediate step on the way to removing miniguice DI from vogar.

git-svn-id: http://vogar.googlecode.com/svn/trunk@263 aa685c63-decc-881d-cd2b-7fa72aad72e1
/external/vogar/src/vogar/Run.java