OSDN Git Service

ART: Refactor TI tests
authorAndreas Gampe <agampe@google.com>
Fri, 20 Jan 2017 05:13:46 +0000 (21:13 -0800)
committerAndreas Gampe <agampe@google.com>
Fri, 20 Jan 2017 23:33:25 +0000 (15:33 -0800)
commit53ae7803b20650b7f36c0564dbcdc3115f399cba
tree6a163440ef06130506a0fcf21ac82d935a09dd1e
parentd713d29507fb98bea3eee9277f05422a9b641ca1
ART: Refactor TI tests

Add a helper to explicitly bind native methods in a given class,
using dlsym to look up C functions in the local environment.

Add a callback helper that hooks VmInit and calls the above function
on the Main class. Use the callback helper before calling the test-
defined or shared minimal OnLoad function.

Add a binder helper that immediately binds the Main functions. Use
the helper before calling the test-defined OnAttach function.

Remove System.loadLibrary from tests. Instead rely on the explicit
binding.

In preparation for making the tests functional on device.

Test: m test-art-host
Change-Id: I12e68f070e8c6331e51d3a1fa4b9ebd8f28dfce6
36 files changed:
test/901-hello-ti-agent/src/Main.java
test/902-hello-transformation/src/Main.java
test/903-hello-tagging/src/Main.java
test/904-object-allocation/src/Main.java
test/905-object-free/src/Main.java
test/906-iterate-heap/src/Main.java
test/907-get-loaded-classes/src/Main.java
test/908-gc-start-finish/src/Main.java
test/910-methods/src/Main.java
test/911-get-stack-trace/expected.txt
test/911-get-stack-trace/src/Main.java
test/911-get-stack-trace/stack_trace.cc
test/912-classes/src/Main.java
test/913-heaps/src/Main.java
test/914-hello-obsolescence/src/Main.java
test/915-obsolete-2/src/Main.java
test/916-obsolete-jit/src/Main.java
test/917-fields-transformation/src/Main.java
test/918-fields/src/Main.java
test/919-obsolete-fields/src/Main.java
test/921-hello-failure/src/Main.java
test/922-properties/src/Main.java
test/923-monitors/src/Main.java
test/924-threads/src/Main.java
test/925-threadgroups/src/Main.java
test/926-multi-obsolescence/src/Main.java
test/927-timers/src/Main.java
test/928-jni-table/src/Main.java
test/929-search/src/Main.java
test/930-hello-retransform/src/Main.java
test/931-agent-thread/src/Main.java
test/932-transform-saves/src/Main.java
test/ti-agent/common_helper.cc
test/ti-agent/common_helper.h
test/ti-agent/common_load.cc
test/ti-agent/common_load.h