diff options
author | Andreas Gampe <agampe@google.com> | 2014-07-22 18:52:29 -0700 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2014-07-23 10:03:00 -0700 |
commit | 1c83cbc4a817acbd7f9abb5b29a2d418a958e6a1 (patch) | |
tree | aae7ea1d5559718d6e264175aa1cb2ae1fc1e9ed | |
parent | 7dfc30b591aee167f0a38ab61a90894cc76f2066 (diff) | |
download | android_art-1c83cbc4a817acbd7f9abb5b29a2d418a958e6a1.tar.gz android_art-1c83cbc4a817acbd7f9abb5b29a2d418a958e6a1.tar.bz2 android_art-1c83cbc4a817acbd7f9abb5b29a2d418a958e6a1.zip |
ART: Make run tests out of oat tests
Transforms all former oat tests into run tests.
Change-Id: I190dd39456454c36e5538a2c044d993965a67533
-rw-r--r-- | Android.mk | 61 | ||||
-rw-r--r-- | build/Android.common_test.mk | 22 | ||||
-rw-r--r-- | patchoat/patchoat.cc | 3 | ||||
-rw-r--r-- | test/000-nop/build (renamed from test/001-nop/build) | 0 | ||||
-rw-r--r-- | test/000-nop/expected.txt (renamed from test/001-nop/expected.txt) | 0 | ||||
-rw-r--r-- | test/000-nop/info.txt (renamed from test/001-nop/info.txt) | 0 | ||||
-rw-r--r-- | test/000-nop/run (renamed from test/001-nop/run) | 0 | ||||
-rw-r--r-- | test/001-HelloWorld/expected.txt | 1 | ||||
-rw-r--r-- | test/001-HelloWorld/info.txt | 1 | ||||
-rw-r--r-- | test/001-HelloWorld/src/Main.java (renamed from test/HelloWorld/HelloWorld.java) | 4 | ||||
-rw-r--r-- | test/001-Main/expected.txt | 0 | ||||
-rw-r--r-- | test/001-Main/info.txt | 1 | ||||
-rw-r--r-- | test/001-Main/src/Main.java (renamed from test/009-instanceof2/src/Iface2.java) | 11 | ||||
-rw-r--r-- | test/004-InterfaceTest/expected.txt | 2 | ||||
-rw-r--r-- | test/004-InterfaceTest/info.txt | 1 | ||||
-rw-r--r-- | test/004-InterfaceTest/src/Main.java (renamed from test/InterfaceTest/InterfaceTest.java) | 6 | ||||
-rw-r--r-- | test/004-JniTest/expected.txt | 0 | ||||
-rw-r--r-- | test/004-JniTest/info.txt | 1 | ||||
-rw-r--r-- | test/004-JniTest/jni_test.cc (renamed from test/JniTest/jni_test.cc) | 32 | ||||
-rw-r--r-- | test/004-JniTest/src/Main.java (renamed from test/JniTest/JniTest.java) | 2 | ||||
-rw-r--r-- | test/004-NativeAllocations/expected.txt | 1 | ||||
-rw-r--r-- | test/004-NativeAllocations/info.txt | 1 | ||||
-rw-r--r-- | test/004-NativeAllocations/src/Main.java (renamed from test/NativeAllocations/NativeAllocations.java) | 2 | ||||
-rw-r--r-- | test/004-ReferenceMap/expected.txt | 0 | ||||
-rw-r--r-- | test/004-ReferenceMap/info.txt | 1 | ||||
-rw-r--r-- | test/004-ReferenceMap/src/Main.java (renamed from test/ReferenceMap/ReferenceMap.java) | 6 | ||||
-rw-r--r-- | test/004-ReferenceMap/stack_walk_refmap_jni.cc (renamed from test/ReferenceMap/stack_walk_refmap_jni.cc) | 2 | ||||
-rw-r--r-- | test/004-SignalTest/expected.txt | 5 | ||||
-rw-r--r-- | test/004-SignalTest/info.txt | 1 | ||||
-rw-r--r-- | test/004-SignalTest/signaltest.cc (renamed from test/SignalTest/signaltest.cc) | 6 | ||||
-rw-r--r-- | test/004-SignalTest/src/Main.java (renamed from test/SignalTest/SignalTest.java) | 2 | ||||
-rw-r--r-- | test/004-StackWalk/expected.txt | 4 | ||||
-rw-r--r-- | test/004-StackWalk/info.txt | 1 | ||||
-rw-r--r-- | test/004-StackWalk/src/Main.java (renamed from test/StackWalk/StackWalk.java) | 10 | ||||
-rw-r--r-- | test/004-StackWalk/stack_walk_jni.cc (renamed from test/StackWalk/stack_walk_jni.cc) | 5 | ||||
-rwxr-xr-x | test/004-ThreadStress/check | 18 | ||||
-rw-r--r-- | test/004-ThreadStress/expected.txt | 1 | ||||
-rw-r--r-- | test/004-ThreadStress/info.txt | 1 | ||||
-rw-r--r-- | test/004-ThreadStress/src/Main.java (renamed from test/ThreadStress/ThreadStress.java) | 35 | ||||
-rw-r--r-- | test/004-UnsafeTest/expected.txt | 0 | ||||
-rw-r--r-- | test/004-UnsafeTest/info.txt | 1 | ||||
-rw-r--r-- | test/004-UnsafeTest/src/Main.java (renamed from test/UnsafeTest/UnsafeTest.java) | 6 | ||||
-rw-r--r-- | test/004-UnsafeTest/unsafe_test.cc (renamed from test/UnsafeTest/unsafe_test.cc) | 4 | ||||
-rw-r--r-- | test/005-annotations/build (renamed from test/004-annotations/build) | 0 | ||||
-rw-r--r-- | test/005-annotations/expected.txt (renamed from test/004-annotations/expected.txt) | 0 | ||||
-rw-r--r-- | test/005-annotations/info.txt (renamed from test/004-annotations/info.txt) | 0 | ||||
-rw-r--r-- | test/005-annotations/src/Main.java (renamed from test/004-annotations/src/Main.java) | 0 | ||||
-rw-r--r-- | test/005-annotations/src/android/test/AnnoSimplePackage1.java (renamed from test/004-annotations/src/android/test/AnnoSimplePackage1.java) | 0 | ||||
-rw-r--r-- | test/005-annotations/src/android/test/anno/AnnoArrayField.java (renamed from test/004-annotations/src/android/test/anno/AnnoArrayField.java) | 0 | ||||
-rw-r--r-- | test/005-annotations/src/android/test/anno/AnnoFancyConstructor.java (renamed from test/004-annotations/src/android/test/anno/AnnoFancyConstructor.java) | 0 | ||||
-rw-r--r-- | test/005-annotations/src/android/test/anno/AnnoFancyField.java (renamed from test/004-annotations/src/android/test/anno/AnnoFancyField.java) | 0 | ||||
-rw-r--r-- | test/005-annotations/src/android/test/anno/AnnoFancyMethod.java (renamed from test/004-annotations/src/android/test/anno/AnnoFancyMethod.java) | 0 | ||||
-rw-r--r-- | test/005-annotations/src/android/test/anno/AnnoFancyParameter.java (renamed from test/004-annotations/src/android/test/anno/AnnoFancyParameter.java) | 0 | ||||
-rw-r--r-- | test/005-annotations/src/android/test/anno/AnnoFancyType.java (renamed from test/004-annotations/src/android/test/anno/AnnoFancyType.java) | 0 | ||||
-rw-r--r-- | test/005-annotations/src/android/test/anno/AnnoSimpleConstructor.java (renamed from test/004-annotations/src/android/test/anno/AnnoSimpleConstructor.java) | 0 | ||||
-rw-r--r-- | test/005-annotations/src/android/test/anno/AnnoSimpleField.java (renamed from test/004-annotations/src/android/test/anno/AnnoSimpleField.java) | 0 | ||||
-rw-r--r-- | test/005-annotations/src/android/test/anno/AnnoSimpleLocalVariable.java (renamed from test/004-annotations/src/android/test/anno/AnnoSimpleLocalVariable.java) | 0 | ||||
-rw-r--r-- | test/005-annotations/src/android/test/anno/AnnoSimpleMethod.java (renamed from test/004-annotations/src/android/test/anno/AnnoSimpleMethod.java) | 0 | ||||
-rw-r--r-- | test/005-annotations/src/android/test/anno/AnnoSimplePackage.java (renamed from test/004-annotations/src/android/test/anno/AnnoSimplePackage.java) | 0 | ||||
-rw-r--r-- | test/005-annotations/src/android/test/anno/AnnoSimpleParameter.java (renamed from test/004-annotations/src/android/test/anno/AnnoSimpleParameter.java) | 0 | ||||
-rw-r--r-- | test/005-annotations/src/android/test/anno/AnnoSimpleType.java (renamed from test/004-annotations/src/android/test/anno/AnnoSimpleType.java) | 0 | ||||
-rw-r--r-- | test/005-annotations/src/android/test/anno/AnnoSimpleType2.java (renamed from test/004-annotations/src/android/test/anno/AnnoSimpleType2.java) | 0 | ||||
-rw-r--r-- | test/005-annotations/src/android/test/anno/AnnoSimpleTypeInvis.java (renamed from test/004-annotations/src/android/test/anno/AnnoSimpleTypeInvis.java) | 0 | ||||
-rw-r--r-- | test/005-annotations/src/android/test/anno/ExportedProperty.java (renamed from test/004-annotations/src/android/test/anno/ExportedProperty.java) | 0 | ||||
-rw-r--r-- | test/005-annotations/src/android/test/anno/FullyNoted.java (renamed from test/004-annotations/src/android/test/anno/FullyNoted.java) | 0 | ||||
-rw-r--r-- | test/005-annotations/src/android/test/anno/INoted.java (renamed from test/004-annotations/src/android/test/anno/INoted.java) | 0 | ||||
-rw-r--r-- | test/005-annotations/src/android/test/anno/IntToString.java (renamed from test/004-annotations/src/android/test/anno/IntToString.java) | 0 | ||||
-rw-r--r-- | test/005-annotations/src/android/test/anno/MissingAnnotation.java (renamed from test/004-annotations/src/android/test/anno/MissingAnnotation.java) | 0 | ||||
-rw-r--r-- | test/005-annotations/src/android/test/anno/SimplyNoted.java (renamed from test/004-annotations/src/android/test/anno/SimplyNoted.java) | 0 | ||||
-rw-r--r-- | test/005-annotations/src/android/test/anno/SomeClass.java (renamed from test/004-annotations/src/android/test/anno/SomeClass.java) | 0 | ||||
-rw-r--r-- | test/005-annotations/src/android/test/anno/SubNoted.java (renamed from test/004-annotations/src/android/test/anno/SubNoted.java) | 0 | ||||
-rw-r--r-- | test/005-annotations/src/android/test/anno/TestAnnotations.java (renamed from test/004-annotations/src/android/test/anno/TestAnnotations.java) | 0 | ||||
-rw-r--r-- | test/005-annotations/src/android/test/anno/package-info.java (renamed from test/004-annotations/src/android/test/anno/package-info.java) | 0 | ||||
-rw-r--r-- | test/005-annotations/src/android/test/package-info.java (renamed from test/004-annotations/src/android/test/package-info.java) | 0 | ||||
-rw-r--r-- | test/006-args/expected.txt (renamed from test/005-args/expected.txt) | 0 | ||||
-rw-r--r-- | test/006-args/info.txt (renamed from test/005-args/info.txt) | 0 | ||||
-rw-r--r-- | test/006-args/src/ArgsTest.java (renamed from test/005-args/src/ArgsTest.java) | 0 | ||||
-rw-r--r-- | test/006-args/src/Main.java (renamed from test/005-args/src/Main.java) | 0 | ||||
-rw-r--r-- | test/007-count10/expected.txt (renamed from test/006-count10/expected.txt) | 0 | ||||
-rw-r--r-- | test/007-count10/info.txt (renamed from test/006-count10/info.txt) | 0 | ||||
-rw-r--r-- | test/007-count10/src/Main.java (renamed from test/006-count10/src/Main.java) | 0 | ||||
-rw-r--r-- | test/008-exceptions/expected.txt (renamed from test/007-exceptions/expected.txt) | 0 | ||||
-rw-r--r-- | test/008-exceptions/info.txt (renamed from test/007-exceptions/info.txt) | 0 | ||||
-rw-r--r-- | test/008-exceptions/src/Main.java (renamed from test/007-exceptions/src/Main.java) | 0 | ||||
-rw-r--r-- | test/008-instanceof/src/Main.java | 49 | ||||
-rw-r--r-- | test/009-instanceof/expected.txt (renamed from test/008-instanceof/expected.txt) | 5 | ||||
-rw-r--r-- | test/009-instanceof/info.txt (renamed from test/008-instanceof/info.txt) | 0 | ||||
-rw-r--r-- | test/009-instanceof/src/Iface1.java (renamed from test/008-instanceof/src/Iface1.java) | 0 | ||||
-rw-r--r-- | test/009-instanceof/src/Iface2.java (renamed from test/008-instanceof/src/Iface2.java) | 0 | ||||
-rw-r--r-- | test/009-instanceof/src/Iface2Sub1.java (renamed from test/008-instanceof/src/Iface2Sub1.java) | 0 | ||||
-rw-r--r-- | test/009-instanceof/src/ImplA.java (renamed from test/008-instanceof/src/ImplA.java) | 0 | ||||
-rw-r--r-- | test/009-instanceof/src/ImplB.java (renamed from test/008-instanceof/src/ImplB.java) | 0 | ||||
-rw-r--r-- | test/009-instanceof/src/ImplBSub.java (renamed from test/008-instanceof/src/ImplBSub.java) | 0 | ||||
-rw-r--r-- | test/009-instanceof/src/Main.java (renamed from test/009-instanceof2/src/Main.java) | 28 | ||||
-rw-r--r-- | test/009-instanceof2/expected.txt | 5 | ||||
-rw-r--r-- | test/009-instanceof2/info.txt | 6 | ||||
-rw-r--r-- | test/009-instanceof2/src/Iface1.java | 27 | ||||
-rw-r--r-- | test/009-instanceof2/src/Iface2Sub1.java | 23 | ||||
-rw-r--r-- | test/009-instanceof2/src/ImplA.java | 28 | ||||
-rw-r--r-- | test/009-instanceof2/src/ImplB.java | 30 | ||||
-rw-r--r-- | test/009-instanceof2/src/ImplBSub.java | 28 | ||||
-rw-r--r-- | test/114-ParallelGC/expected.txt | 0 | ||||
-rw-r--r-- | test/114-ParallelGC/info.txt | 1 | ||||
-rw-r--r-- | test/114-ParallelGC/src/Main.java (renamed from test/ParallelGC/ParallelGC.java) | 7 | ||||
-rw-r--r-- | test/Android.libarttest.mk | 10 | ||||
-rw-r--r-- | test/Android.oat.mk | 525 | ||||
-rw-r--r-- | test/Android.run-test.mk | 24 | ||||
-rwxr-xr-x | test/etc/default-check | 17 | ||||
-rwxr-xr-x | test/etc/host-run-test-jar | 2 | ||||
-rwxr-xr-x | test/etc/push-and-run-prebuilt-test-jar | 2 | ||||
-rwxr-xr-x | test/run-test | 23 |
111 files changed, 261 insertions, 840 deletions
diff --git a/Android.mk b/Android.mk index 2c6606ac57..c5e90f26c8 100644 --- a/Android.mk +++ b/Android.mk @@ -127,7 +127,6 @@ TEST_ART_TARGET_SYNC_DEPS := include $(art_path)/build/Android.common_test.mk include $(art_path)/build/Android.gtest.mk -include $(art_path)/test/Android.oat.mk include $(art_path)/test/Android.run-test.mk # Sync test files to the target, depends upon all things that must be pushed to the target. @@ -169,65 +168,59 @@ test-art-host-vixl: $(VIXL_TEST_DEPENDENCY) # "mm test-art-host" to build and run all host tests. .PHONY: test-art-host -test-art-host: test-art-host-gtest test-art-host-oat test-art-host-run-test test-art-host-vixl +test-art-host: test-art-host-gtest test-art-host-run-test test-art-host-vixl $(hide) $(call ART_TEST_PREREQ_FINISHED,$@) # All host tests that run solely with the default compiler. .PHONY: test-art-host-default -test-art-host-default: test-art-host-oat-default test-art-host-run-test-default +test-art-host-default: test-art-host-run-test-default $(hide) $(call ART_TEST_PREREQ_FINISHED,$@) # All host tests that run solely with the optimizing compiler. .PHONY: test-art-host-optimizing -test-art-host-optimizing: test-art-host-oat-optimizing test-art-host-run-test-optimizing +test-art-host-optimizing: test-art-host-run-test-optimizing $(hide) $(call ART_TEST_PREREQ_FINISHED,$@) # All host tests that run solely on the interpreter. .PHONY: test-art-host-interpreter -test-art-host-interpreter: test-art-host-oat-interpreter test-art-host-run-test-interpreter +test-art-host-interpreter: test-art-host-run-test-interpreter $(hide) $(call ART_TEST_PREREQ_FINISHED,$@) # Primary host architecture variants: .PHONY: test-art-host$(ART_PHONY_TEST_HOST_SUFFIX) test-art-host$(ART_PHONY_TEST_HOST_SUFFIX): test-art-host-gtest$(ART_PHONY_TEST_HOST_SUFFIX) \ - test-art-host-oat$(ART_PHONY_TEST_HOST_SUFFIX) test-art-host-run-test$(ART_PHONY_TEST_HOST_SUFFIX) + test-art-host-run-test$(ART_PHONY_TEST_HOST_SUFFIX) $(hide) $(call ART_TEST_PREREQ_FINISHED,$@) .PHONY: test-art-host-default$(ART_PHONY_TEST_HOST_SUFFIX) -test-art-host-default$(ART_PHONY_TEST_HOST_SUFFIX): test-art-host-oat-default$(ART_PHONY_TEST_HOST_SUFFIX) \ - test-art-host-run-test-default$(ART_PHONY_TEST_HOST_SUFFIX) +test-art-host-default$(ART_PHONY_TEST_HOST_SUFFIX): test-art-host-run-test-default$(ART_PHONY_TEST_HOST_SUFFIX) $(hide) $(call ART_TEST_PREREQ_FINISHED,$@) .PHONY: test-art-host-optimizing$(ART_PHONY_TEST_HOST_SUFFIX) -test-art-host-optimizing$(ART_PHONY_TEST_HOST_SUFFIX): test-art-host-oat-optimizing$(ART_PHONY_TEST_HOST_SUFFIX) \ - test-art-host-run-test-optimizing$(ART_PHONY_TEST_HOST_SUFFIX) +test-art-host-optimizing$(ART_PHONY_TEST_HOST_SUFFIX): test-art-host-run-test-optimizing$(ART_PHONY_TEST_HOST_SUFFIX) $(hide) $(call ART_TEST_PREREQ_FINISHED,$@) .PHONY: test-art-host-interpreter$(ART_PHONY_TEST_HOST_SUFFIX) -test-art-host-interpreter$(ART_PHONY_TEST_HOST_SUFFIX): test-art-host-oat-interpreter$(ART_PHONY_TEST_HOST_SUFFIX) \ - test-art-host-run-test-interpreter$(ART_PHONY_TEST_HOST_SUFFIX) +test-art-host-interpreter$(ART_PHONY_TEST_HOST_SUFFIX): test-art-host-run-test-interpreter$(ART_PHONY_TEST_HOST_SUFFIX) $(hide) $(call ART_TEST_PREREQ_FINISHED,$@) # Secondary host architecture variants: ifneq ($(HOST_PREFER_32_BIT),true) .PHONY: test-art-host$(2ND_ART_PHONY_TEST_HOST_SUFFIX) test-art-host$(2ND_ART_PHONY_TEST_HOST_SUFFIX): test-art-host-gtest$(2ND_ART_PHONY_TEST_HOST_SUFFIX) \ - test-art-host-oat$(2ND_ART_PHONY_TEST_HOST_SUFFIX) test-art-host-run-test$(2ND_ART_PHONY_TEST_HOST_SUFFIX) + test-art-host-run-test$(2ND_ART_PHONY_TEST_HOST_SUFFIX) $(hide) $(call ART_TEST_PREREQ_FINISHED,$@) .PHONY: test-art-host-default$(2ND_ART_PHONY_TEST_HOST_SUFFIX) -test-art-host-default$(2ND_ART_PHONY_TEST_HOST_SUFFIX): test-art-host-oat-default$(2ND_ART_PHONY_TEST_HOST_SUFFIX) \ - test-art-host-run-test-default$(2ND_ART_PHONY_TEST_HOST_SUFFIX) +test-art-host-default$(2ND_ART_PHONY_TEST_HOST_SUFFIX): test-art-host-run-test-default$(2ND_ART_PHONY_TEST_HOST_SUFFIX) $(hide) $(call ART_TEST_PREREQ_FINISHED,$@) .PHONY: test-art-host-optimizing$(2ND_ART_PHONY_TEST_HOST_SUFFIX) -test-art-host-optimizing$(2ND_ART_PHONY_TEST_HOST_SUFFIX): test-art-host-oat-optimizing$(2ND_ART_PHONY_TEST_HOST_SUFFIX) \ - test-art-host-run-test-optimizing$(2ND_ART_PHONY_TEST_HOST_SUFFIX) +test-art-host-optimizing$(2ND_ART_PHONY_TEST_HOST_SUFFIX): test-art-host-run-test-optimizing$(2ND_ART_PHONY_TEST_HOST_SUFFIX) $(hide) $(call ART_TEST_PREREQ_FINISHED,$@) .PHONY: test-art-host-interpreter$(2ND_ART_PHONY_TEST_HOST_SUFFIX) -test-art-host-interpreter$(2ND_ART_PHONY_TEST_HOST_SUFFIX): test-art-host-oat-interpreter$(2ND_ART_PHONY_TEST_HOST_SUFFIX) \ - test-art-host-run-test-interpreter$(2ND_ART_PHONY_TEST_HOST_SUFFIX) +test-art-host-interpreter$(2ND_ART_PHONY_TEST_HOST_SUFFIX): test-art-host-run-test-interpreter$(2ND_ART_PHONY_TEST_HOST_SUFFIX) $(hide) $(call ART_TEST_PREREQ_FINISHED,$@) endif @@ -236,65 +229,59 @@ endif # "mm test-art-target" to build and run all target tests. .PHONY: test-art-target -test-art-target: test-art-target-gtest test-art-target-oat test-art-target-run-test +test-art-target: test-art-target-gtest test-art-target-run-test $(hide) $(call ART_TEST_PREREQ_FINISHED,$@) # All target tests that run solely with the default compiler. .PHONY: test-art-target-default -test-art-target-default: test-art-target-oat-default test-art-target-run-test-default +test-art-target-default: test-art-target-run-test-default $(hide) $(call ART_TEST_PREREQ_FINISHED,$@) # All target tests that run solely with the optimizing compiler. .PHONY: test-art-target-optimizing -test-art-target-optimizing: test-art-target-oat-optimizing test-art-target-run-test-optimizing +test-art-target-optimizing: test-art-target-run-test-optimizing $(hide) $(call ART_TEST_PREREQ_FINISHED,$@) # All target tests that run solely on the interpreter. .PHONY: test-art-target-interpreter -test-art-target-interpreter: test-art-target-oat-interpreter test-art-target-run-test-interpreter +test-art-target-interpreter: test-art-target-run-test-interpreter $(hide) $(call ART_TEST_PREREQ_FINISHED,$@) # Primary target architecture variants: .PHONY: test-art-target$(ART_PHONY_TEST_TARGET_SUFFIX) test-art-target$(ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-gtest$(ART_PHONY_TEST_TARGET_SUFFIX) \ - test-art-target-oat$(ART_PHONY_TEST_TARGET_SUFFIX) test-art-target-run-test$(ART_PHONY_TEST_TARGET_SUFFIX) + test-art-target-run-test$(ART_PHONY_TEST_TARGET_SUFFIX) $(hide) $(call ART_TEST_PREREQ_FINISHED,$@) .PHONY: test-art-target-default$(ART_PHONY_TEST_TARGET_SUFFIX) -test-art-target-default$(ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-oat-default$(ART_PHONY_TEST_TARGET_SUFFIX) \ - test-art-target-run-test-default$(ART_PHONY_TEST_TARGET_SUFFIX) +test-art-target-default$(ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-run-test-default$(ART_PHONY_TEST_TARGET_SUFFIX) $(hide) $(call ART_TEST_PREREQ_FINISHED,$@) .PHONY: test-art-target-optimizing$(ART_PHONY_TEST_TARGET_SUFFIX) -test-art-target-optimizing$(ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-oat-optimizing$(ART_PHONY_TEST_TARGET_SUFFIX) \ - test-art-target-run-test-optimizing$(ART_PHONY_TEST_TARGET_SUFFIX) +test-art-target-optimizing$(ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-run-test-optimizing$(ART_PHONY_TEST_TARGET_SUFFIX) $(hide) $(call ART_TEST_PREREQ_FINISHED,$@) .PHONY: test-art-target-interpreter$(ART_PHONY_TEST_TARGET_SUFFIX) -test-art-target-interpreter$(ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-oat-interpreter$(ART_PHONY_TEST_TARGET_SUFFIX) \ - test-art-target-run-test-interpreter$(ART_PHONY_TEST_TARGET_SUFFIX) +test-art-target-interpreter$(ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-run-test-interpreter$(ART_PHONY_TEST_TARGET_SUFFIX) $(hide) $(call ART_TEST_PREREQ_FINISHED,$@) # Secondary target architecture variants: ifdef TARGET_2ND_ARCH .PHONY: test-art-target$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) test-art-target$(2ND_ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-gtest$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) \ - test-art-target-oat$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) test-art-target-run-test$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) + test-art-target-run-test$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) $(hide) $(call ART_TEST_PREREQ_FINISHED,$@) .PHONY: test-art-target-default$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) -test-art-target-default$(2ND_ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-oat-default$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) \ - test-art-target-run-test-default$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) +test-art-target-default$(2ND_ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-run-test-default$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) $(hide) $(call ART_TEST_PREREQ_FINISHED,$@) .PHONY: test-art-target-optimizing$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) -test-art-target-optimizing$(2ND_ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-oat-optimizing$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) \ - test-art-target-run-test-optimizing$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) +test-art-target-optimizing$(2ND_ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-run-test-optimizing$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) $(hide) $(call ART_TEST_PREREQ_FINISHED,$@) .PHONY: test-art-target-interpreter$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) -test-art-target-interpreter$(2ND_ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-oat-interpreter$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) \ - test-art-target-run-test-interpreter$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) +test-art-target-interpreter$(2ND_ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-run-test-interpreter$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) $(hide) $(call ART_TEST_PREREQ_FINISHED,$@) endif diff --git a/build/Android.common_test.mk b/build/Android.common_test.mk index f26bca0257..c50b4ae240 100644 --- a/build/Android.common_test.mk +++ b/build/Android.common_test.mk @@ -21,7 +21,27 @@ include art/build/Android.common_path.mk # List of known broken tests that we won't attempt to execute. The test name must be the full # rule name such as test-art-host-oat-optimizing-HelloWorld64. -ART_TEST_KNOWN_BROKEN := +ART_TEST_KNOWN_BROKEN := \ + test-art-host-run-test-gcstress-optimizing-no-prebuild-004-SignalTest32 \ + test-art-host-run-test-gcstress-optimizing-prebuild-004-SignalTest32 \ + test-art-host-run-test-gcstress-optimizing-norelocate-004-SignalTest32 \ + test-art-host-run-test-gcstress-optimizing-relocate-004-SignalTest32 \ + test-art-host-run-test-gcverify-optimizing-no-prebuild-004-SignalTest32 \ + test-art-host-run-test-gcverify-optimizing-prebuild-004-SignalTest32 \ + test-art-host-run-test-gcverify-optimizing-norelocate-004-SignalTest32 \ + test-art-host-run-test-gcverify-optimizing-relocate-004-SignalTest32 \ + test-art-host-run-test-optimizing-no-prebuild-004-SignalTest32 \ + test-art-host-run-test-optimizing-prebuild-004-SignalTest32 \ + test-art-host-run-test-optimizing-norelocate-004-SignalTest32 \ + test-art-host-run-test-optimizing-relocate-004-SignalTest32 \ + test-art-target-run-test-gcstress-optimizing-prebuild-004-SignalTest32 \ + test-art-target-run-test-gcstress-optimizing-norelocate-004-SignalTest32 \ + test-art-target-run-test-gcstress-default-prebuild-004-SignalTest32 \ + test-art-target-run-test-gcstress-default-norelocate-004-SignalTest32 \ + test-art-target-run-test-gcstress-optimizing-relocate-004-SignalTest32 \ + test-art-target-run-test-gcstress-default-relocate-004-SignalTest32 \ + test-art-target-run-test-gcstress-optimizing-no-prebuild-004-SignalTest32 \ + test-art-target-run-test-gcstress-default-no-prebuild-004-SignalTest32 # List of known failing tests that when executed won't cause test execution to not finish. # The test name must be the full rule name such as test-art-host-oat-optimizing-HelloWorld64. diff --git a/patchoat/patchoat.cc b/patchoat/patchoat.cc index 55d582f772..4c88c9ea6d 100644 --- a/patchoat/patchoat.cc +++ b/patchoat/patchoat.cc @@ -1024,6 +1024,9 @@ static int patchoat(int argc, char **argv) { } else { CHECK(!input_oat_filename.empty()); input_oat.reset(OS::OpenFileForReading(input_oat_filename.c_str())); + if (input_oat.get() == nullptr) { + LOG(ERROR) << "Could not open input oat file: " << strerror(errno); + } } if (output_oat_fd != -1) { diff --git a/test/001-nop/build b/test/000-nop/build index 5233a2d716..5233a2d716 100644 --- a/test/001-nop/build +++ b/test/000-nop/build diff --git a/test/001-nop/expected.txt b/test/000-nop/expected.txt index 80a233e745..80a233e745 100644 --- a/test/001-nop/expected.txt +++ b/test/000-nop/expected.txt diff --git a/test/001-nop/info.txt b/test/000-nop/info.txt index 9942f10dad..9942f10dad 100644 --- a/test/001-nop/info.txt +++ b/test/000-nop/info.txt diff --git a/test/001-nop/run b/test/000-nop/run index 210296b57c..210296b57c 100644 --- a/test/001-nop/run +++ b/test/000-nop/run diff --git a/test/001-HelloWorld/expected.txt b/test/001-HelloWorld/expected.txt new file mode 100644 index 0000000000..af5626b4a1 --- /dev/null +++ b/test/001-HelloWorld/expected.txt @@ -0,0 +1 @@ +Hello, world! diff --git a/test/001-HelloWorld/info.txt b/test/001-HelloWorld/info.txt new file mode 100644 index 0000000000..641dd9aa24 --- /dev/null +++ b/test/001-HelloWorld/info.txt @@ -0,0 +1 @@ +Imported from oat test. Print "Hello World." diff --git a/test/HelloWorld/HelloWorld.java b/test/001-HelloWorld/src/Main.java index c6861ced7a..1ef6289559 100644 --- a/test/HelloWorld/HelloWorld.java +++ b/test/001-HelloWorld/src/Main.java @@ -14,8 +14,8 @@ * limitations under the License. */ -class HelloWorld { +public class Main { public static void main(String[] args) { - System.logI("Hello, world!"); + System.out.println("Hello, world!"); } } diff --git a/test/001-Main/expected.txt b/test/001-Main/expected.txt new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/test/001-Main/expected.txt diff --git a/test/001-Main/info.txt b/test/001-Main/info.txt new file mode 100644 index 0000000000..e4b33a052d --- /dev/null +++ b/test/001-Main/info.txt @@ -0,0 +1 @@ +Import of a previous oat test. Empty main, just test starting up the runtime. diff --git a/test/009-instanceof2/src/Iface2.java b/test/001-Main/src/Main.java index 2b33c39ab3..3486866a2a 100644 --- a/test/009-instanceof2/src/Iface2.java +++ b/test/001-Main/src/Main.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006 The Android Open Source Project + * Copyright (C) 2011 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,7 @@ * limitations under the License. */ -/** - * Another interface. - */ -public interface Iface2 { - - public int iFunc2(int ii); +public class Main { + public static void main(String args[]) { + } } diff --git a/test/004-InterfaceTest/expected.txt b/test/004-InterfaceTest/expected.txt new file mode 100644 index 0000000000..4854e24149 --- /dev/null +++ b/test/004-InterfaceTest/expected.txt @@ -0,0 +1,2 @@ +test_virtual done +test_interface done diff --git a/test/004-InterfaceTest/info.txt b/test/004-InterfaceTest/info.txt new file mode 100644 index 0000000000..00b0d9ab15 --- /dev/null +++ b/test/004-InterfaceTest/info.txt @@ -0,0 +1 @@ +Imported from oat tests. diff --git a/test/InterfaceTest/InterfaceTest.java b/test/004-InterfaceTest/src/Main.java index ed18eb3dc7..9ebac59445 100644 --- a/test/InterfaceTest/InterfaceTest.java +++ b/test/004-InterfaceTest/src/Main.java @@ -17,7 +17,7 @@ import java.util.Map; import java.util.HashMap; -class InterfaceTest { +public class Main { public static long test_virtual(HashMap map) { Integer intobj = new Integer(0); @@ -44,10 +44,10 @@ class InterfaceTest { public static void main(String[] args) { HashMap hashmap = new HashMap(); long elapsed = test_virtual(hashmap); - System.logI("virtual map put: " + elapsed); + System.out.println("test_virtual done"); hashmap.clear(); elapsed = test_interface(hashmap); - System.logI("interface map put: " + elapsed); + System.out.println("test_interface done"); } } diff --git a/test/004-JniTest/expected.txt b/test/004-JniTest/expected.txt new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/test/004-JniTest/expected.txt diff --git a/test/004-JniTest/info.txt b/test/004-JniTest/info.txt new file mode 100644 index 0000000000..00b0d9ab15 --- /dev/null +++ b/test/004-JniTest/info.txt @@ -0,0 +1 @@ +Imported from oat tests. diff --git a/test/JniTest/jni_test.cc b/test/004-JniTest/jni_test.cc index 36cad72ace..4909a4a77c 100644 --- a/test/JniTest/jni_test.cc +++ b/test/004-JniTest/jni_test.cc @@ -42,7 +42,7 @@ static void* testFindClassOnAttachedNativeThread(void*) { int attach_result = jvm->AttachCurrentThread(&env, &args); assert(attach_result == 0); - jclass clazz = env->FindClass("JniTest"); + jclass clazz = env->FindClass("Main"); assert(clazz != NULL); assert(!env->ExceptionCheck()); @@ -56,7 +56,7 @@ static void* testFindClassOnAttachedNativeThread(void*) { } // http://b/10994325 -extern "C" JNIEXPORT void JNICALL Java_JniTest_testFindClassOnAttachedNativeThread(JNIEnv*, +extern "C" JNIEXPORT void JNICALL Java_Main_testFindClassOnAttachedNativeThread(JNIEnv*, jclass) { pthread_t pthread; int pthread_create_result = pthread_create(&pthread, @@ -76,7 +76,7 @@ static void* testFindFieldOnAttachedNativeThread(void*) { int attach_result = jvm->AttachCurrentThread(&env, &args); assert(attach_result == 0); - jclass clazz = env->FindClass("JniTest"); + jclass clazz = env->FindClass("Main"); assert(clazz != NULL); assert(!env->ExceptionCheck()); @@ -91,7 +91,7 @@ static void* testFindFieldOnAttachedNativeThread(void*) { return NULL; } -extern "C" JNIEXPORT void JNICALL Java_JniTest_testFindFieldOnAttachedNativeThreadNative(JNIEnv*, +extern "C" JNIEXPORT void JNICALL Java_Main_testFindFieldOnAttachedNativeThreadNative(JNIEnv*, jclass) { pthread_t pthread; int pthread_create_result = pthread_create(&pthread, @@ -111,7 +111,7 @@ static void* testReflectFieldGetFromAttachedNativeThread(void*) { int attach_result = jvm->AttachCurrentThread(&env, &args); assert(attach_result == 0); - jclass clazz = env->FindClass("JniTest"); + jclass clazz = env->FindClass("Main"); assert(clazz != NULL); assert(!env->ExceptionCheck()); @@ -151,7 +151,7 @@ static void* testReflectFieldGetFromAttachedNativeThread(void*) { } // http://b/15539150 -extern "C" JNIEXPORT void JNICALL Java_JniTest_testReflectFieldGetFromAttachedNativeThreadNative( +extern "C" JNIEXPORT void JNICALL Java_Main_testReflectFieldGetFromAttachedNativeThreadNative( JNIEnv*, jclass) { pthread_t pthread; int pthread_create_result = pthread_create(&pthread, @@ -165,22 +165,22 @@ extern "C" JNIEXPORT void JNICALL Java_JniTest_testReflectFieldGetFromAttachedNa // http://b/11243757 -extern "C" JNIEXPORT void JNICALL Java_JniTest_testCallStaticVoidMethodOnSubClassNative(JNIEnv* env, +extern "C" JNIEXPORT void JNICALL Java_Main_testCallStaticVoidMethodOnSubClassNative(JNIEnv* env, jclass) { - jclass super_class = env->FindClass("JniTest$testCallStaticVoidMethodOnSubClass_SuperClass"); + jclass super_class = env->FindClass("Main$testCallStaticVoidMethodOnSubClass_SuperClass"); assert(super_class != NULL); jmethodID execute = env->GetStaticMethodID(super_class, "execute", "()V"); assert(execute != NULL); - jclass sub_class = env->FindClass("JniTest$testCallStaticVoidMethodOnSubClass_SubClass"); + jclass sub_class = env->FindClass("Main$testCallStaticVoidMethodOnSubClass_SubClass"); assert(sub_class != NULL); env->CallStaticVoidMethod(sub_class, execute); } -extern "C" JNIEXPORT jobject JNICALL Java_JniTest_testGetMirandaMethodNative(JNIEnv* env, jclass) { - jclass abstract_class = env->FindClass("JniTest$testGetMirandaMethod_MirandaAbstract"); +extern "C" JNIEXPORT jobject JNICALL Java_Main_testGetMirandaMethodNative(JNIEnv* env, jclass) { + jclass abstract_class = env->FindClass("Main$testGetMirandaMethod_MirandaAbstract"); assert(abstract_class != NULL); jmethodID miranda_method = env->GetMethodID(abstract_class, "inInterface", "()Z"); assert(miranda_method != NULL); @@ -188,7 +188,7 @@ extern "C" JNIEXPORT jobject JNICALL Java_JniTest_testGetMirandaMethodNative(JNI } // https://code.google.com/p/android/issues/detail?id=63055 -extern "C" void JNICALL Java_JniTest_testZeroLengthByteBuffers(JNIEnv* env, jclass) { +extern "C" void JNICALL Java_Main_testZeroLengthByteBuffers(JNIEnv* env, jclass) { std::vector<uint8_t> buffer(1); jobject byte_buffer = env->NewDirectByteBuffer(&buffer[0], 0); assert(byte_buffer != NULL); @@ -201,7 +201,7 @@ extern "C" void JNICALL Java_JniTest_testZeroLengthByteBuffers(JNIEnv* env, jcla constexpr size_t kByteReturnSize = 7; jbyte byte_returns[kByteReturnSize] = { 0, 1, 2, 127, -1, -2, -128 }; -extern "C" jbyte JNICALL Java_JniTest_byteMethod(JNIEnv* env, jclass klass, jbyte b1, jbyte b2, +extern "C" jbyte JNICALL Java_Main_byteMethod(JNIEnv* env, jclass klass, jbyte b1, jbyte b2, jbyte b3, jbyte b4, jbyte b5, jbyte b6, jbyte b7, jbyte b8, jbyte b9, jbyte b10) { // We use b1 to drive the output. @@ -226,7 +226,7 @@ jshort short_returns[kShortReturnSize] = { 0, 1, 2, 127, 32767, -1, -2, -128, static_cast<jshort>(0x8000) }; // The weird static_cast is because short int is only guaranteed down to -32767, not Java's -32768. -extern "C" jshort JNICALL Java_JniTest_shortMethod(JNIEnv* env, jclass klass, jshort s1, jshort s2, +extern "C" jshort JNICALL Java_Main_shortMethod(JNIEnv* env, jclass klass, jshort s1, jshort s2, jshort s3, jshort s4, jshort s5, jshort s6, jshort s7, jshort s8, jshort s9, jshort s10) { // We use s1 to drive the output. @@ -246,7 +246,7 @@ extern "C" jshort JNICALL Java_JniTest_shortMethod(JNIEnv* env, jclass klass, js return short_returns[s1]; } -extern "C" jboolean JNICALL Java_JniTest_booleanMethod(JNIEnv* env, jclass klass, jboolean b1, +extern "C" jboolean JNICALL Java_Main_booleanMethod(JNIEnv* env, jclass klass, jboolean b1, jboolean b2, jboolean b3, jboolean b4, jboolean b5, jboolean b6, jboolean b7, jboolean b8, jboolean b9, jboolean b10) { @@ -268,7 +268,7 @@ extern "C" jboolean JNICALL Java_JniTest_booleanMethod(JNIEnv* env, jclass klass constexpr size_t kCharReturnSize = 8; jchar char_returns[kCharReturnSize] = { 0, 1, 2, 127, 255, 256, 15000, 34000 }; -extern "C" jchar JNICALL Java_JniTest_charMethod(JNIEnv* env, jclass klacc, jchar c1, jchar c2, +extern "C" jchar JNICALL Java_Main_charMethod(JNIEnv* env, jclass klacc, jchar c1, jchar c2, jchar c3, jchar c4, jchar c5, jchar c6, jchar c7, jchar c8, jchar c9, jchar c10) { // We use c1 to drive the output. diff --git a/test/JniTest/JniTest.java b/test/004-JniTest/src/Main.java index 33418a98b2..11c80f5a59 100644 --- a/test/JniTest/JniTest.java +++ b/test/004-JniTest/src/Main.java @@ -16,7 +16,7 @@ import java.lang.reflect.Method; -class JniTest { +public class Main { public static void main(String[] args) { System.loadLibrary("arttest"); testFindClassOnAttachedNativeThread(); diff --git a/test/004-NativeAllocations/expected.txt b/test/004-NativeAllocations/expected.txt new file mode 100644 index 0000000000..f75da10caf --- /dev/null +++ b/test/004-NativeAllocations/expected.txt @@ -0,0 +1 @@ +Test complete diff --git a/test/004-NativeAllocations/info.txt b/test/004-NativeAllocations/info.txt new file mode 100644 index 0000000000..00b0d9ab15 --- /dev/null +++ b/test/004-NativeAllocations/info.txt @@ -0,0 +1 @@ +Imported from oat tests. diff --git a/test/NativeAllocations/NativeAllocations.java b/test/004-NativeAllocations/src/Main.java index 9423b91c16..483c667915 100644 --- a/test/NativeAllocations/NativeAllocations.java +++ b/test/004-NativeAllocations/src/Main.java @@ -16,7 +16,7 @@ import java.lang.reflect.*; -class NativeAllocations { +public class Main { static Object nativeLock = new Object(); static int nativeBytes = 0; static Object runtime; diff --git a/test/004-ReferenceMap/expected.txt b/test/004-ReferenceMap/expected.txt new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/test/004-ReferenceMap/expected.txt diff --git a/test/004-ReferenceMap/info.txt b/test/004-ReferenceMap/info.txt new file mode 100644 index 0000000000..00b0d9ab15 --- /dev/null +++ b/test/004-ReferenceMap/info.txt @@ -0,0 +1 @@ +Imported from oat tests. diff --git a/test/ReferenceMap/ReferenceMap.java b/test/004-ReferenceMap/src/Main.java index c746b688e3..f9a5498d9e 100644 --- a/test/ReferenceMap/ReferenceMap.java +++ b/test/004-ReferenceMap/src/Main.java @@ -14,8 +14,8 @@ * limitations under the License. */ -public class ReferenceMap { - public ReferenceMap() { +public class Main { + public Main() { } Object f() { @@ -41,7 +41,7 @@ public class ReferenceMap { } public static void main(String[] args) { - ReferenceMap rm = new ReferenceMap(); + Main rm = new Main(); rm.f(); } } diff --git a/test/ReferenceMap/stack_walk_refmap_jni.cc b/test/004-ReferenceMap/stack_walk_refmap_jni.cc index e5a1786102..79295549c9 100644 --- a/test/ReferenceMap/stack_walk_refmap_jni.cc +++ b/test/004-ReferenceMap/stack_walk_refmap_jni.cc @@ -271,7 +271,7 @@ struct ReferenceMap2Visitor : public StackVisitor { // 0x0032 - 0x0033 reg=2 y Ljava/lang/Object; // 0x0000 - 0x0033 reg=8 this LReferenceMap; -extern "C" JNIEXPORT jint JNICALL Java_ReferenceMap_refmap(JNIEnv*, jobject, jint count) { +extern "C" JNIEXPORT jint JNICALL Java_Main_refmap(JNIEnv*, jobject, jint count) { // Visitor ScopedObjectAccess soa(Thread::Current()); ReferenceMap2Visitor mapper(soa.Self()); diff --git a/test/004-SignalTest/expected.txt b/test/004-SignalTest/expected.txt new file mode 100644 index 0000000000..fd5ec00067 --- /dev/null +++ b/test/004-SignalTest/expected.txt @@ -0,0 +1,5 @@ +init signal test +Caught NullPointerException +Caught StackOverflowError +signal caught +Signal test OK diff --git a/test/004-SignalTest/info.txt b/test/004-SignalTest/info.txt new file mode 100644 index 0000000000..00b0d9ab15 --- /dev/null +++ b/test/004-SignalTest/info.txt @@ -0,0 +1 @@ +Imported from oat tests. diff --git a/test/SignalTest/signaltest.cc b/test/004-SignalTest/signaltest.cc index dfe319712e..a2dd66459c 100644 --- a/test/SignalTest/signaltest.cc +++ b/test/004-SignalTest/signaltest.cc @@ -41,7 +41,7 @@ static void signalhandler(int sig, siginfo_t* info, void* context) { static struct sigaction oldaction; -extern "C" JNIEXPORT void JNICALL Java_SignalTest_initSignalTest(JNIEnv*, jclass) { +extern "C" JNIEXPORT void JNICALL Java_Main_initSignalTest(JNIEnv*, jclass) { struct sigaction action; action.sa_sigaction = signalhandler; sigemptyset(&action.sa_mask); @@ -53,7 +53,7 @@ extern "C" JNIEXPORT void JNICALL Java_SignalTest_initSignalTest(JNIEnv*, jclass sigaction(SIGSEGV, &action, &oldaction); } -extern "C" JNIEXPORT void JNICALL Java_SignalTest_terminateSignalTest(JNIEnv*, jclass) { +extern "C" JNIEXPORT void JNICALL Java_Main_terminateSignalTest(JNIEnv*, jclass) { sigaction(SIGSEGV, &oldaction, nullptr); } @@ -61,7 +61,7 @@ extern "C" JNIEXPORT void JNICALL Java_SignalTest_terminateSignalTest(JNIEnv*, j // to nullptr. char *p = nullptr; -extern "C" JNIEXPORT jint JNICALL Java_SignalTest_testSignal(JNIEnv*, jclass) { +extern "C" JNIEXPORT jint JNICALL Java_Main_testSignal(JNIEnv*, jclass) { #ifdef __arm__ // On ARM we cause a real SEGV. *p = 'a'; diff --git a/test/SignalTest/SignalTest.java b/test/004-SignalTest/src/Main.java index 7f15aeae76..0391592543 100644 --- a/test/SignalTest/SignalTest.java +++ b/test/004-SignalTest/src/Main.java @@ -14,7 +14,7 @@ * limitations under the License. */ -class SignalTest { +public class Main { private static native void initSignalTest(); private static native void terminateSignalTest(); private static native int testSignal(); diff --git a/test/004-StackWalk/expected.txt b/test/004-StackWalk/expected.txt new file mode 100644 index 0000000000..bde00246a3 --- /dev/null +++ b/test/004-StackWalk/expected.txt @@ -0,0 +1,4 @@ +1st call +172001234567891011121314151617181920652310201919 +2nd call +172001234567891011121314151617181920652310201919 diff --git a/test/004-StackWalk/info.txt b/test/004-StackWalk/info.txt new file mode 100644 index 0000000000..00b0d9ab15 --- /dev/null +++ b/test/004-StackWalk/info.txt @@ -0,0 +1 @@ +Imported from oat tests. diff --git a/test/StackWalk/StackWalk.java b/test/004-StackWalk/src/Main.java index f7c78ff1f1..1e2a91b5a1 100644 --- a/test/StackWalk/StackWalk.java +++ b/test/004-StackWalk/src/Main.java @@ -1,5 +1,5 @@ -public class StackWalk { - public StackWalk() { +public class Main { + public Main() { } int f() { @@ -76,18 +76,18 @@ public class StackWalk { s4 = s18 = s19; s += s4; s += s18; - refmap(0); + stackmap(0); return s; } - native int refmap(int x); + native int stackmap(int x); static { System.loadLibrary("arttest"); } public static void main(String[] args) { - StackWalk st = new StackWalk(); + Main st = new Main(); st.f(); } } diff --git a/test/StackWalk/stack_walk_jni.cc b/test/004-StackWalk/stack_walk_jni.cc index e404f6ab7d..30a0d5906a 100644 --- a/test/StackWalk/stack_walk_jni.cc +++ b/test/004-StackWalk/stack_walk_jni.cc @@ -95,13 +95,12 @@ struct TestReferenceMapVisitor : public StackVisitor { CHECK_REGS(2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 25); } } - LOG(INFO) << reinterpret_cast<const void*>(reg_bitmap); return true; } }; -extern "C" JNIEXPORT jint JNICALL Java_StackWalk_refmap(JNIEnv*, jobject, jint count) { +extern "C" JNIEXPORT jint JNICALL Java_Main_stackmap(JNIEnv*, jobject, jint count) { ScopedObjectAccess soa(Thread::Current()); CHECK_EQ(count, 0); gJava_StackWalk_refmap_calls++; @@ -113,7 +112,7 @@ extern "C" JNIEXPORT jint JNICALL Java_StackWalk_refmap(JNIEnv*, jobject, jint c return count + 1; } -extern "C" JNIEXPORT jint JNICALL Java_StackWalk2_refmap2(JNIEnv*, jobject, jint count) { +extern "C" JNIEXPORT jint JNICALL Java_Main_refmap2(JNIEnv*, jobject, jint count) { ScopedObjectAccess soa(Thread::Current()); gJava_StackWalk_refmap_calls++; diff --git a/test/004-ThreadStress/check b/test/004-ThreadStress/check new file mode 100755 index 0000000000..ffbb8cf17e --- /dev/null +++ b/test/004-ThreadStress/check @@ -0,0 +1,18 @@ +#!/bin/bash +# +# Copyright (C) 2014 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Only compare the last line. +tail -n 1 "$2" | diff --strip-trailing-cr -q "$1" - >/dev/null
\ No newline at end of file diff --git a/test/004-ThreadStress/expected.txt b/test/004-ThreadStress/expected.txt new file mode 100644 index 0000000000..a26fb4f191 --- /dev/null +++ b/test/004-ThreadStress/expected.txt @@ -0,0 +1 @@ +Finishing worker diff --git a/test/004-ThreadStress/info.txt b/test/004-ThreadStress/info.txt new file mode 100644 index 0000000000..00b0d9ab15 --- /dev/null +++ b/test/004-ThreadStress/info.txt @@ -0,0 +1 @@ +Imported from oat tests. diff --git a/test/ThreadStress/ThreadStress.java b/test/004-ThreadStress/src/Main.java index 5dccc689c2..0c1c97d4e3 100644 --- a/test/ThreadStress/ThreadStress.java +++ b/test/004-ThreadStress/src/Main.java @@ -14,9 +14,7 @@ * limitations under the License. */ -import android.system.ErrnoException; -import android.system.Os; -import android.system.OsConstants; +import java.lang.reflect.*; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -26,7 +24,7 @@ import java.util.Map; // Run on host with: // javac ThreadTest.java && java ThreadStress && rm *.class -class ThreadStress implements Runnable { +public class Main implements Runnable { public static final boolean DEBUG = false; @@ -80,7 +78,7 @@ class ThreadStress implements Runnable { // Fill in the Operation[] array for each thread by laying // down references to operation according to their desired // frequency. - final ThreadStress[] threadStresses = new ThreadStress[numberOfThreads]; + final Main[] threadStresses = new Main[numberOfThreads]; for (int t = 0; t < threadStresses.length; t++) { Operation[] operations = new Operation[operationsPerThread]; int o = 0; @@ -98,7 +96,7 @@ class ThreadStress implements Runnable { } // Randomize the oepration order Collections.shuffle(Arrays.asList(operations)); - threadStresses[t] = new ThreadStress(lock, t, operations); + threadStresses[t] = new Main(lock, t, operations); } // Enable to dump operation counds per thread to make sure its @@ -129,9 +127,9 @@ class ThreadStress implements Runnable { // operationsPerThread. Thread[] runners = new Thread[numberOfThreads]; for (int r = 0; r < runners.length; r++) { - final ThreadStress ts = threadStresses[r]; + final Main ts = threadStresses[r]; runners[r] = new Thread("Runner thread " + r) { - final ThreadStress threadStress = ts; + final Main threadStress = ts; public void run() { int id = threadStress.id; System.out.println("Starting worker for " + id); @@ -146,7 +144,7 @@ class ThreadStress implements Runnable { + (operationsPerThread - threadStress.nextOperation) + " operations remaining."); } - System.out.println("Finishing worker for " + id); + System.out.println("Finishing worker"); } }; } @@ -179,7 +177,7 @@ class ThreadStress implements Runnable { private int nextOperation; - private ThreadStress(Object lock, int id, Operation[] operations) { + private Main(Object lock, int id, Operation[] operations) { this.lock = lock; this.id = id; this.operations = operations; @@ -204,8 +202,8 @@ class ThreadStress implements Runnable { } case SIGQUIT: { try { - Os.kill(Os.getpid(), OsConstants.SIGQUIT); - } catch (ErrnoException ex) { + SIGQUIT(); + } catch (Exception ex) { } } case SLEEP: { @@ -267,4 +265,17 @@ class ThreadStress implements Runnable { } } } + + private static void SIGQUIT() throws Exception { + Class<?> osClass = Class.forName("android.system.Os"); + Method getpid = osClass.getDeclaredMethod("getpid"); + int pid = (Integer)getpid.invoke(null); + + Class<?> osConstants = Class.forName("android.system.OsConstants"); + Field sigquitField = osConstants.getDeclaredField("SIGQUIT"); + int sigquit = (Integer)sigquitField.get(null); + + Method kill = osClass.getDeclaredMethod("kill", int.class, int.class); + kill.invoke(null, pid, sigquit); + } } diff --git a/test/004-UnsafeTest/expected.txt b/test/004-UnsafeTest/expected.txt new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/test/004-UnsafeTest/expected.txt diff --git a/test/004-UnsafeTest/info.txt b/test/004-UnsafeTest/info.txt new file mode 100644 index 0000000000..00b0d9ab15 --- /dev/null +++ b/test/004-UnsafeTest/info.txt @@ -0,0 +1 @@ +Imported from oat tests. diff --git a/test/UnsafeTest/UnsafeTest.java b/test/004-UnsafeTest/src/Main.java index 9e2ff876b7..8c8ad163c5 100644 --- a/test/UnsafeTest/UnsafeTest.java +++ b/test/004-UnsafeTest/src/Main.java @@ -17,21 +17,21 @@ import java.lang.reflect.Field; import sun.misc.Unsafe; -public class UnsafeTest { +public class Main { static { System.loadLibrary("arttest"); } private static void check(int actual, int expected, String msg) { if (actual != expected) { - System.logE(msg + " : " + actual + " != " + expected); + System.out.println(msg + " : " + actual + " != " + expected); System.exit(-1); } } private static void check(long actual, long expected, String msg) { if (actual != expected) { - System.logE(msg + " : " + actual + " != " + expected); + System.out.println(msg + " : " + actual + " != " + expected); System.exit(-1); } } diff --git a/test/UnsafeTest/unsafe_test.cc b/test/004-UnsafeTest/unsafe_test.cc index e36ee149f0..ca0e39e122 100644 --- a/test/UnsafeTest/unsafe_test.cc +++ b/test/004-UnsafeTest/unsafe_test.cc @@ -24,14 +24,14 @@ namespace art { -extern "C" JNIEXPORT jint JNICALL Java_UnsafeTest_vmArrayBaseOffset(JNIEnv* env, jclass, jobject classObj) { +extern "C" JNIEXPORT jint JNICALL Java_Main_vmArrayBaseOffset(JNIEnv* env, jclass, jobject classObj) { ScopedObjectAccess soa(env); mirror::Class* klass = soa.Decode<mirror::Class*>(classObj); return mirror::Array::DataOffset( Primitive::ComponentSize(klass->GetComponentType()->GetPrimitiveType())).Int32Value(); } -extern "C" JNIEXPORT jint JNICALL Java_UnsafeTest_vmArrayIndexScale(JNIEnv* env, jclass, jobject classObj) { +extern "C" JNIEXPORT jint JNICALL Java_Main_vmArrayIndexScale(JNIEnv* env, jclass, jobject classObj) { ScopedObjectAccess soa(env); mirror::Class* klass = soa.Decode<mirror::Class*>(classObj); return Primitive::ComponentSize(klass->GetComponentType()->GetPrimitiveType()); diff --git a/test/004-annotations/build b/test/005-annotations/build index 1690213130..1690213130 100644 --- a/test/004-annotations/build +++ b/test/005-annotations/build diff --git a/test/004-annotations/expected.txt b/test/005-annotations/expected.txt index 36b38687f9..36b38687f9 100644 --- a/test/004-annotations/expected.txt +++ b/test/005-annotations/expected.txt diff --git a/test/004-annotations/info.txt b/test/005-annotations/info.txt index c8c9280c32..c8c9280c32 100644 --- a/test/004-annotations/info.txt +++ b/test/005-annotations/info.txt diff --git a/test/004-annotations/src/Main.java b/test/005-annotations/src/Main.java index e44722fc42..e44722fc42 100644 --- a/test/004-annotations/src/Main.java +++ b/test/005-annotations/src/Main.java diff --git a/test/004-annotations/src/android/test/AnnoSimplePackage1.java b/test/005-annotations/src/android/test/AnnoSimplePackage1.java index 629cb7dc05..629cb7dc05 100644 --- a/test/004-annotations/src/android/test/AnnoSimplePackage1.java +++ b/test/005-annotations/src/android/test/AnnoSimplePackage1.java diff --git a/test/004-annotations/src/android/test/anno/AnnoArrayField.java b/test/005-annotations/src/android/test/anno/AnnoArrayField.java index 681045c36c..681045c36c 100644 --- a/test/004-annotations/src/android/test/anno/AnnoArrayField.java +++ b/test/005-annotations/src/android/test/anno/AnnoArrayField.java diff --git a/test/004-annotations/src/android/test/anno/AnnoFancyConstructor.java b/test/005-annotations/src/android/test/anno/AnnoFancyConstructor.java index 19dadecc95..19dadecc95 100644 --- a/test/004-annotations/src/android/test/anno/AnnoFancyConstructor.java +++ b/test/005-annotations/src/android/test/anno/AnnoFancyConstructor.java diff --git a/test/004-annotations/src/android/test/anno/AnnoFancyField.java b/test/005-annotations/src/android/test/anno/AnnoFancyField.java index 855ba56146..855ba56146 100644 --- a/test/004-annotations/src/android/test/anno/AnnoFancyField.java +++ b/test/005-annotations/src/android/test/anno/AnnoFancyField.java diff --git a/test/004-annotations/src/android/test/anno/AnnoFancyMethod.java b/test/005-annotations/src/android/test/anno/AnnoFancyMethod.java index 3088866647..3088866647 100644 --- a/test/004-annotations/src/android/test/anno/AnnoFancyMethod.java +++ b/test/005-annotations/src/android/test/anno/AnnoFancyMethod.java diff --git a/test/004-annotations/src/android/test/anno/AnnoFancyParameter.java b/test/005-annotations/src/android/test/anno/AnnoFancyParameter.java index bc2ba7c293..bc2ba7c293 100644 --- a/test/004-annotations/src/android/test/anno/AnnoFancyParameter.java +++ b/test/005-annotations/src/android/test/anno/AnnoFancyParameter.java diff --git a/test/004-annotations/src/android/test/anno/AnnoFancyType.java b/test/005-annotations/src/android/test/anno/AnnoFancyType.java index 745f8386ad..745f8386ad 100644 --- a/test/004-annotations/src/android/test/anno/AnnoFancyType.java +++ b/test/005-annotations/src/android/test/anno/AnnoFancyType.java diff --git a/test/004-annotations/src/android/test/anno/AnnoSimpleConstructor.java b/test/005-annotations/src/android/test/anno/AnnoSimpleConstructor.java index d66b9aef29..d66b9aef29 100644 --- a/test/004-annotations/src/android/test/anno/AnnoSimpleConstructor.java +++ b/test/005-annotations/src/android/test/anno/AnnoSimpleConstructor.java diff --git a/test/004-annotations/src/android/test/anno/AnnoSimpleField.java b/test/005-annotations/src/android/test/anno/AnnoSimpleField.java index 04193d227c..04193d227c 100644 --- a/test/004-annotations/src/android/test/anno/AnnoSimpleField.java +++ b/test/005-annotations/src/android/test/anno/AnnoSimpleField.java diff --git a/test/004-annotations/src/android/test/anno/AnnoSimpleLocalVariable.java b/test/005-annotations/src/android/test/anno/AnnoSimpleLocalVariable.java index a839fa22dd..a839fa22dd 100644 --- a/test/004-annotations/src/android/test/anno/AnnoSimpleLocalVariable.java +++ b/test/005-annotations/src/android/test/anno/AnnoSimpleLocalVariable.java diff --git a/test/004-annotations/src/android/test/anno/AnnoSimpleMethod.java b/test/005-annotations/src/android/test/anno/AnnoSimpleMethod.java index fcd9c0f5f2..fcd9c0f5f2 100644 --- a/test/004-annotations/src/android/test/anno/AnnoSimpleMethod.java +++ b/test/005-annotations/src/android/test/anno/AnnoSimpleMethod.java diff --git a/test/004-annotations/src/android/test/anno/AnnoSimplePackage.java b/test/005-annotations/src/android/test/anno/AnnoSimplePackage.java index 4aadfe7bfb..4aadfe7bfb 100644 --- a/test/004-annotations/src/android/test/anno/AnnoSimplePackage.java +++ b/test/005-annotations/src/android/test/anno/AnnoSimplePackage.java diff --git a/test/004-annotations/src/android/test/anno/AnnoSimpleParameter.java b/test/005-annotations/src/android/test/anno/AnnoSimpleParameter.java index 6e26ca3a49..6e26ca3a49 100644 --- a/test/004-annotations/src/android/test/anno/AnnoSimpleParameter.java +++ b/test/005-annotations/src/android/test/anno/AnnoSimpleParameter.java diff --git a/test/004-annotations/src/android/test/anno/AnnoSimpleType.java b/test/005-annotations/src/android/test/anno/AnnoSimpleType.java index 3bba3dbfbf..3bba3dbfbf 100644 --- a/test/004-annotations/src/android/test/anno/AnnoSimpleType.java +++ b/test/005-annotations/src/android/test/anno/AnnoSimpleType.java diff --git a/test/004-annotations/src/android/test/anno/AnnoSimpleType2.java b/test/005-annotations/src/android/test/anno/AnnoSimpleType2.java index f74b291193..f74b291193 100644 --- a/test/004-annotations/src/android/test/anno/AnnoSimpleType2.java +++ b/test/005-annotations/src/android/test/anno/AnnoSimpleType2.java diff --git a/test/004-annotations/src/android/test/anno/AnnoSimpleTypeInvis.java b/test/005-annotations/src/android/test/anno/AnnoSimpleTypeInvis.java index 541d82eedb..541d82eedb 100644 --- a/test/004-annotations/src/android/test/anno/AnnoSimpleTypeInvis.java +++ b/test/005-annotations/src/android/test/anno/AnnoSimpleTypeInvis.java diff --git a/test/004-annotations/src/android/test/anno/ExportedProperty.java b/test/005-annotations/src/android/test/anno/ExportedProperty.java index 810d28f8fd..810d28f8fd 100644 --- a/test/004-annotations/src/android/test/anno/ExportedProperty.java +++ b/test/005-annotations/src/android/test/anno/ExportedProperty.java diff --git a/test/004-annotations/src/android/test/anno/FullyNoted.java b/test/005-annotations/src/android/test/anno/FullyNoted.java index 76a7b0411d..76a7b0411d 100644 --- a/test/004-annotations/src/android/test/anno/FullyNoted.java +++ b/test/005-annotations/src/android/test/anno/FullyNoted.java diff --git a/test/004-annotations/src/android/test/anno/INoted.java b/test/005-annotations/src/android/test/anno/INoted.java index b2cd007d94..b2cd007d94 100644 --- a/test/004-annotations/src/android/test/anno/INoted.java +++ b/test/005-annotations/src/android/test/anno/INoted.java diff --git a/test/004-annotations/src/android/test/anno/IntToString.java b/test/005-annotations/src/android/test/anno/IntToString.java index e84fcfa3aa..e84fcfa3aa 100644 --- a/test/004-annotations/src/android/test/anno/IntToString.java +++ b/test/005-annotations/src/android/test/anno/IntToString.java diff --git a/test/004-annotations/src/android/test/anno/MissingAnnotation.java b/test/005-annotations/src/android/test/anno/MissingAnnotation.java index 56da15a252..56da15a252 100644 --- a/test/004-annotations/src/android/test/anno/MissingAnnotation.java +++ b/test/005-annotations/src/android/test/anno/MissingAnnotation.java diff --git a/test/004-annotations/src/android/test/anno/SimplyNoted.java b/test/005-annotations/src/android/test/anno/SimplyNoted.java index b75746589f..b75746589f 100644 --- a/test/004-annotations/src/android/test/anno/SimplyNoted.java +++ b/test/005-annotations/src/android/test/anno/SimplyNoted.java diff --git a/test/004-annotations/src/android/test/anno/SomeClass.java b/test/005-annotations/src/android/test/anno/SomeClass.java index c21d68dc5f..c21d68dc5f 100644 --- a/test/004-annotations/src/android/test/anno/SomeClass.java +++ b/test/005-annotations/src/android/test/anno/SomeClass.java diff --git a/test/004-annotations/src/android/test/anno/SubNoted.java b/test/005-annotations/src/android/test/anno/SubNoted.java index 2530346dcd..2530346dcd 100644 --- a/test/004-annotations/src/android/test/anno/SubNoted.java +++ b/test/005-annotations/src/android/test/anno/SubNoted.java diff --git a/test/004-annotations/src/android/test/anno/TestAnnotations.java b/test/005-annotations/src/android/test/anno/TestAnnotations.java index 4eabb12b35..4eabb12b35 100644 --- a/test/004-annotations/src/android/test/anno/TestAnnotations.java +++ b/test/005-annotations/src/android/test/anno/TestAnnotations.java diff --git a/test/004-annotations/src/android/test/anno/package-info.java b/test/005-annotations/src/android/test/anno/package-info.java index 74b11f99ad..74b11f99ad 100644 --- a/test/004-annotations/src/android/test/anno/package-info.java +++ b/test/005-annotations/src/android/test/anno/package-info.java diff --git a/test/004-annotations/src/android/test/package-info.java b/test/005-annotations/src/android/test/package-info.java index e188cdaefd..e188cdaefd 100644 --- a/test/004-annotations/src/android/test/package-info.java +++ b/test/005-annotations/src/android/test/package-info.java diff --git a/test/005-args/expected.txt b/test/006-args/expected.txt index 094fbbbcfd..094fbbbcfd 100644 --- a/test/005-args/expected.txt +++ b/test/006-args/expected.txt diff --git a/test/005-args/info.txt b/test/006-args/info.txt index 08127da231..08127da231 100644 --- a/test/005-args/info.txt +++ b/test/006-args/info.txt diff --git a/test/005-args/src/ArgsTest.java b/test/006-args/src/ArgsTest.java index 2b874cd29c..2b874cd29c 100644 --- a/test/005-args/src/ArgsTest.java +++ b/test/006-args/src/ArgsTest.java diff --git a/test/005-args/src/Main.java b/test/006-args/src/Main.java index 8abb63c1ba..8abb63c1ba 100644 --- a/test/005-args/src/Main.java +++ b/test/006-args/src/Main.java diff --git a/test/006-count10/expected.txt b/test/007-count10/expected.txt index 8b1acc12b6..8b1acc12b6 100644 --- a/test/006-count10/expected.txt +++ b/test/007-count10/expected.txt diff --git a/test/006-count10/info.txt b/test/007-count10/info.txt index 08127da231..08127da231 100644 --- a/test/006-count10/info.txt +++ b/test/007-count10/info.txt diff --git a/test/006-count10/src/Main.java b/test/007-count10/src/Main.java index 8fd2947dc2..8fd2947dc2 100644 --- a/test/006-count10/src/Main.java +++ b/test/007-count10/src/Main.java diff --git a/test/007-exceptions/expected.txt b/test/008-exceptions/expected.txt index ef6eaff59a..ef6eaff59a 100644 --- a/test/007-exceptions/expected.txt +++ b/test/008-exceptions/expected.txt diff --git a/test/007-exceptions/info.txt b/test/008-exceptions/info.txt index 08127da231..08127da231 100644 --- a/test/007-exceptions/info.txt +++ b/test/008-exceptions/info.txt diff --git a/test/007-exceptions/src/Main.java b/test/008-exceptions/src/Main.java index 1f76f12460..1f76f12460 100644 --- a/test/007-exceptions/src/Main.java +++ b/test/008-exceptions/src/Main.java diff --git a/test/008-instanceof/src/Main.java b/test/008-instanceof/src/Main.java deleted file mode 100644 index 77f3f515c0..0000000000 --- a/test/008-instanceof/src/Main.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Test instanceof - */ -public class Main { - public static void main(String args[]) { - Iface1 face1; - ImplA aa = new ImplA(); - ImplBSub bb = new ImplBSub(); - boolean aaOkay, bbOkay; - - face1 = aa; - face1 = bb; - - System.out.println("iface1.mFloaty = " + face1.mFloaty + " " + face1.mWahoo); - System.out.println("aa.mFloaty = " + aa.mFloaty + " " + aa.mWahoo); - System.out.println("bb.mWhoami = " + bb.mWhoami); - - aaOkay = face1 instanceof ImplA; - System.out.print("aaOkay (false) = "); - System.out.println(aaOkay); - bbOkay = face1 instanceof ImplB; - System.out.print("bbOkay (true) = "); - System.out.println(bbOkay); - - bb = (ImplBSub) face1; - try { - aa = (ImplA) face1; - } - catch (ClassCastException cce) { - System.out.println("Caught a ClassCastException (expected)"); - } - } -} diff --git a/test/008-instanceof/expected.txt b/test/009-instanceof/expected.txt index 77fd0cbc7b..967c0bf4d5 100644 --- a/test/008-instanceof/expected.txt +++ b/test/009-instanceof/expected.txt @@ -4,3 +4,8 @@ bb.mWhoami = ImplB! aaOkay (false) = false bbOkay (true) = true Caught a ClassCastException (expected) +instanceof Serializable = true +instanceof Cloneable = true +instanceof Runnable = false +aaOkay (false) = false +bbOkay (true) = true diff --git a/test/008-instanceof/info.txt b/test/009-instanceof/info.txt index 08127da231..08127da231 100644 --- a/test/008-instanceof/info.txt +++ b/test/009-instanceof/info.txt diff --git a/test/008-instanceof/src/Iface1.java b/test/009-instanceof/src/Iface1.java index d7f5376833..d7f5376833 100644 --- a/test/008-instanceof/src/Iface1.java +++ b/test/009-instanceof/src/Iface1.java diff --git a/test/008-instanceof/src/Iface2.java b/test/009-instanceof/src/Iface2.java index 2b33c39ab3..2b33c39ab3 100644 --- a/test/008-instanceof/src/Iface2.java +++ b/test/009-instanceof/src/Iface2.java diff --git a/test/008-instanceof/src/Iface2Sub1.java b/test/009-instanceof/src/Iface2Sub1.java index bcff8ab1fc..bcff8ab1fc 100644 --- a/test/008-instanceof/src/Iface2Sub1.java +++ b/test/009-instanceof/src/Iface2Sub1.java diff --git a/test/008-instanceof/src/ImplA.java b/test/009-instanceof/src/ImplA.java index 27364f2c62..27364f2c62 100644 --- a/test/008-instanceof/src/ImplA.java +++ b/test/009-instanceof/src/ImplA.java diff --git a/test/008-instanceof/src/ImplB.java b/test/009-instanceof/src/ImplB.java index 8b05702a97..8b05702a97 100644 --- a/test/008-instanceof/src/ImplB.java +++ b/test/009-instanceof/src/ImplB.java diff --git a/test/008-instanceof/src/ImplBSub.java b/test/009-instanceof/src/ImplBSub.java index a94ae4d19a..a94ae4d19a 100644 --- a/test/008-instanceof/src/ImplBSub.java +++ b/test/009-instanceof/src/ImplBSub.java diff --git a/test/009-instanceof2/src/Main.java b/test/009-instanceof/src/Main.java index 15a1e507fe..807ae69671 100644 --- a/test/009-instanceof2/src/Main.java +++ b/test/009-instanceof/src/Main.java @@ -19,10 +19,36 @@ */ public class Main { public static void main(String args[]) { + Iface1 face1; + ImplA aa = new ImplA(); + ImplBSub bb = new ImplBSub(); + boolean aaOkay, bbOkay; + + face1 = aa; + face1 = bb; + + System.out.println("iface1.mFloaty = " + face1.mFloaty + " " + face1.mWahoo); + System.out.println("aa.mFloaty = " + aa.mFloaty + " " + aa.mWahoo); + System.out.println("bb.mWhoami = " + bb.mWhoami); + + aaOkay = face1 instanceof ImplA; + System.out.print("aaOkay (false) = "); + System.out.println(aaOkay); + bbOkay = face1 instanceof ImplB; + System.out.print("bbOkay (true) = "); + System.out.println(bbOkay); + + bb = (ImplBSub) face1; + try { + aa = (ImplA) face1; + } + catch (ClassCastException cce) { + System.out.println("Caught a ClassCastException (expected)"); + } + Iface1[] faceArray; ImplA[] aaArray = new ImplA[5]; ImplBSub[] bbArray = new ImplBSub[5]; - boolean aaOkay, bbOkay; faceArray = aaArray; faceArray = bbArray; diff --git a/test/009-instanceof2/expected.txt b/test/009-instanceof2/expected.txt deleted file mode 100644 index 74ad202937..0000000000 --- a/test/009-instanceof2/expected.txt +++ /dev/null @@ -1,5 +0,0 @@ -instanceof Serializable = true -instanceof Cloneable = true -instanceof Runnable = false -aaOkay (false) = false -bbOkay (true) = true diff --git a/test/009-instanceof2/info.txt b/test/009-instanceof2/info.txt deleted file mode 100644 index 08127da231..0000000000 --- a/test/009-instanceof2/info.txt +++ /dev/null @@ -1,6 +0,0 @@ -This is a miscellaneous test that was imported into the new-at-the-time -runtime test framework. The test is intended to exercise basic features, -and as such cannot be build on top of junit, since failure of such basic -features might disrupt junit. - -TODO: Real description goes here. diff --git a/test/009-instanceof2/src/Iface1.java b/test/009-instanceof2/src/Iface1.java deleted file mode 100644 index d7f5376833..0000000000 --- a/test/009-instanceof2/src/Iface1.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2005 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Test stuff. - */ -public interface Iface1 { - - public int iFunc1(int ii); - - public float mFloaty = 5.0f; - - public String mWahoo = new String("wahoo"); -} diff --git a/test/009-instanceof2/src/Iface2Sub1.java b/test/009-instanceof2/src/Iface2Sub1.java deleted file mode 100644 index bcff8ab1fc..0000000000 --- a/test/009-instanceof2/src/Iface2Sub1.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2006 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Another interface. - */ -public interface Iface2Sub1 extends Iface2, Cloneable { - - //public int iFunc2(int ii); -} diff --git a/test/009-instanceof2/src/ImplA.java b/test/009-instanceof2/src/ImplA.java deleted file mode 100644 index 27364f2c62..0000000000 --- a/test/009-instanceof2/src/ImplA.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2006 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Blah. - */ -public class ImplA implements Iface1, Iface2 { - - public int iFunc1(int ii) { - return ii+1; - } - public int iFunc2(int ii) { - return ii+2; - } -} diff --git a/test/009-instanceof2/src/ImplB.java b/test/009-instanceof2/src/ImplB.java deleted file mode 100644 index 8b05702a97..0000000000 --- a/test/009-instanceof2/src/ImplB.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2006 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Blah. - */ -public class ImplB implements Iface1, Iface2 { - - public int iFunc1(int ii) { - return ii+10; - } - public int iFunc2(int ii) { - return ii+20; - } - - public static String mWhoami = new String("ImplB!"); -} diff --git a/test/009-instanceof2/src/ImplBSub.java b/test/009-instanceof2/src/ImplBSub.java deleted file mode 100644 index a94ae4d19a..0000000000 --- a/test/009-instanceof2/src/ImplBSub.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2006 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Interface test. - */ -public class ImplBSub extends ImplB implements /*Iface2,*/ Iface2Sub1 { - - public int iFunc1(int ii) { - return ii+100; - } - public int iFunc2(int ii) { - return ii+200; - } -} diff --git a/test/114-ParallelGC/expected.txt b/test/114-ParallelGC/expected.txt new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/test/114-ParallelGC/expected.txt diff --git a/test/114-ParallelGC/info.txt b/test/114-ParallelGC/info.txt new file mode 100644 index 0000000000..246b4e6270 --- /dev/null +++ b/test/114-ParallelGC/info.txt @@ -0,0 +1 @@ +Imported from oat tests. Allocates and frees objects with multiple threads. diff --git a/test/ParallelGC/ParallelGC.java b/test/114-ParallelGC/src/Main.java index eb9e04e70a..01a30231cb 100644 --- a/test/ParallelGC/ParallelGC.java +++ b/test/114-ParallelGC/src/Main.java @@ -17,11 +17,11 @@ import java.util.ArrayList; import java.util.List; -class ParallelGC implements Runnable { +public class Main implements Runnable { public static void main(String[] args) throws Exception { Thread[] threads = new Thread[16]; for (int i = 0; i < threads.length; i++) { - threads[i] = new Thread(new ParallelGC(i)); + threads[i] = new Thread(new Main(i)); } for (Thread thread : threads) { thread.start(); @@ -33,7 +33,7 @@ class ParallelGC implements Runnable { private final int id; - private ParallelGC(int id) { + private Main(int id) { this.id = id; } @@ -41,7 +41,6 @@ class ParallelGC implements Runnable { List l = new ArrayList(); for (int i = 0; i < 1000; i++) { l.add(new ArrayList(i)); - System.out.print(id); } } } diff --git a/test/Android.libarttest.mk b/test/Android.libarttest.mk index bf3e2aa655..f3563a4af0 100644 --- a/test/Android.libarttest.mk +++ b/test/Android.libarttest.mk @@ -19,11 +19,11 @@ LOCAL_PATH := $(call my-dir) include art/build/Android.common_build.mk LIBARTTEST_COMMON_SRC_FILES := \ - JniTest/jni_test.cc \ - SignalTest/signaltest.cc \ - ReferenceMap/stack_walk_refmap_jni.cc \ - StackWalk/stack_walk_jni.cc \ - UnsafeTest/unsafe_test.cc + 004-JniTest/jni_test.cc \ + 004-SignalTest/signaltest.cc \ + 004-ReferenceMap/stack_walk_refmap_jni.cc \ + 004-StackWalk/stack_walk_jni.cc \ + 004-UnsafeTest/unsafe_test.cc ART_TARGET_LIBARTTEST_$(ART_PHONY_TEST_TARGET_SUFFIX) += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libarttest.so ifdef TARGET_2ND_ARCH diff --git a/test/Android.oat.mk b/test/Android.oat.mk deleted file mode 100644 index ad6b7b781f..0000000000 --- a/test/Android.oat.mk +++ /dev/null @@ -1,525 +0,0 @@ -# Copyright (C) 2011 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -LOCAL_PATH := $(call my-dir) -LOCAL_PID := $(shell echo $$PPID) - -include art/build/Android.common_test.mk - -######################################################################## - -# Subdirectories in art/test which contain dex files used as inputs for oat tests. Declare the -# simplest tests (Main, HelloWorld) first, the rest are alphabetical. -TEST_OAT_DIRECTORIES := \ - Main \ - HelloWorld \ - InterfaceTest \ - JniTest \ - SignalTest \ - NativeAllocations \ - ParallelGC \ - ReferenceMap \ - StackWalk \ - ThreadStress \ - UnsafeTest - -# TODO: Enable when the StackWalk2 tests are passing -# StackWalk2 \ - -# Create build rules for each dex file recording the dependency. -$(foreach dir,$(TEST_OAT_DIRECTORIES), $(eval $(call build-art-test-dex,art-oat-test,$(dir), \ - $(ART_TARGET_TEST_OUT),$(LOCAL_PATH)/Android.oat.mk,ART_TEST_TARGET_OAT_$(dir)_DEX, \ - ART_TEST_HOST_OAT_$(dir)_DEX))) - -######################################################################## - -include $(LOCAL_PATH)/Android.libarttest.mk - -ART_TEST_TARGET_OAT_DEFAULT$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES := -ART_TEST_TARGET_OAT_DEFAULT$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES := -ART_TEST_TARGET_OAT_DEFAULT_RULES := -ART_TEST_TARGET_OAT_OPTIMIZING$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES := -ART_TEST_TARGET_OAT_OPTIMIZING$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES := -ART_TEST_TARGET_OAT_OPTIMIZING_RULES := -ART_TEST_TARGET_OAT_INTERPRETER$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES := -ART_TEST_TARGET_OAT_INTERPRETER$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES := -ART_TEST_TARGET_OAT_INTERPRETER_RULES := -ART_TEST_TARGET_OAT$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES := -ART_TEST_TARGET_OAT$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES := -ART_TEST_TARGET_OAT_RULES := - -# We need dex2oat and dalvikvm on the target as well as the core image. -TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_EXECUTABLES) $(TARGET_CORE_IMG_OUT) $(2ND_TARGET_CORE_IMG_OUT) $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libarttest.so -ifdef TARGET_2ND_ARCH -TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libarttest.so -endif - -# Define rule to run an individual oat test on the host. Output from the test is written to the -# host in /tmp/android-data in a directory named after test's rule name (its target) and the parent -# process' PID (ie the PID of make). On failure the output is dumped to the console. To test for -# success on the target device a file is created following a successful test and this is pulled -# onto the host. If the pull fails then the file wasn't created because the test failed. -# $(1): directory - the name of the test we're building such as HelloWorld. -# $(2): 2ND_ or undefined - used to differentiate between the primary and secondary architecture. -# $(3): the target (rule name), e.g. test-art-target-oat-default-HelloWorld64 -# $(4): -Xint or undefined - do we want to run with the interpreter or default. -define define-test-art-oat-rule-target - # Add the test dependencies to test-art-target-sync, which will be a prerequisite for the test - # to ensure files are pushed to the device. - TEST_ART_TARGET_SYNC_DEPS += $$(ART_TEST_TARGET_OAT_$(1)_DEX) - -.PHONY: $(3) -$(3): test-art-target-sync - $(hide) mkdir -p $(ART_HOST_TEST_DIR)/android-data-$$@ - $(hide) echo Running: $$@ - $(hide) adb shell touch $(ART_TARGET_TEST_DIR)/$(TARGET_$(2)ARCH)/$$@-$(LOCAL_PID) - $(hide) adb shell rm $(ART_TARGET_TEST_DIR)/$(TARGET_$(2)ARCH)/$$@-$(LOCAL_PID) - $(hide) $$(call ART_TEST_SKIP,$$@) && \ - adb shell "/system/bin/dalvikvm$($(2)ART_PHONY_TEST_TARGET_SUFFIX) \ - $(DALVIKVM_FLAGS) $(4) -XXlib:libartd.so -Ximage:$(ART_TARGET_TEST_DIR)/core.art \ - -classpath $(ART_TARGET_TEST_DIR)/art-oat-test-$(1).jar \ - -Djava.library.path=$(ART_TARGET_TEST_DIR)/$(TARGET_$(2)ARCH) $(1) \ - && touch $(ART_TARGET_TEST_DIR)/$(TARGET_$(2)ARCH)/$$@-$(LOCAL_PID)" \ - > $(ART_HOST_TEST_DIR)/android-data-$$@/output.txt 2>&1 && \ - (adb pull $(ART_TARGET_TEST_DIR)/$(TARGET_$(2)ARCH)/$$@-$(LOCAL_PID) $(ART_HOST_TEST_DIR)/android-data-$$@ \ - && $$(call ART_TEST_PASSED,$$@)) \ - || (([ ! -f $(ART_HOST_TEST_DIR)/android-data-$$@/output.txt ] || \ - cat $(ART_HOST_TEST_DIR)/android-data-$$@/output.txt >&2 ) && $$(call ART_TEST_FAILED,$$@)) - $$(hide) (echo $(MAKECMDGOALS) | grep -q $$@ && \ - echo "run-test run as top-level target, removing test directory $(ART_HOST_TEST_DIR)" && \ - rm -r $(ART_HOST_TEST_DIR)) || true - -endef # define-test-art-oat-rule-target - -# Define rules to run oat tests on the target. -# $(1): directory - the name of the test we're building such as HelloWorld. -# $(2): 2ND_ or undefined - used to differentiate between the primary and secondary architecture. -# $(3): additional options -# $(4): name-addition -define define-test-art-oat-rules-target - # Define a phony rule to run a target oat test using the default compiler. - default_test_rule := test-art-target-oat-default$(4)-$(1)$($(2)ART_PHONY_TEST_TARGET_SUFFIX) - $(call define-test-art-oat-rule-target,$(1),$(2),$$(default_test_rule),$(3)) - - ART_TEST_TARGET_OAT_DEFAULT$$($(2)ART_PHONY_TEST_TARGET_SUFFIX)_RULES += $$(default_test_rule) - ART_TEST_TARGET_OAT_DEFAULT_RULES += $$(default_test_rule) - ART_TEST_TARGET_OAT_DEFAULT_$(1)_RULES += $$(default_test_rule) - - optimizing_test_rule := test-art-target-oat-optimizing$(4)-$(1)$($(2)ART_PHONY_TEST_TARGET_SUFFIX) - ifeq ($$(ART_TEST_OPTIMIZING),true) - $(call define-test-art-oat-rule-target,$(1),$(2),$$(optimizing_test_rule), \ - -Xcompiler-option --compiler-backend=Optimizing $(3)) - else - .PHONY: $$(optimizing_test_rule) -$$(optimizing_test_rule): - - endif - - ART_TEST_TARGET_OAT_OPTIMIZING$$($(2)ART_PHONY_TEST_TARGET_SUFFIX)_RULES += $$(optimizing_test_rule) - ART_TEST_TARGET_OAT_OPTIMIZING_RULES += $$(optimizing_test_rule) - ART_TEST_TARGET_OAT_OPTIMIZING_$(1)_RULES += $$(optimizing_test_rule) - - # Define a phony rule to run a target oat test using the interpeter. - interpreter_test_rule := test-art-target-oat-interpreter$(4)-$(1)$($(2)ART_PHONY_TEST_TARGET_SUFFIX) - $(call define-test-art-oat-rule-target,$(1),$(2),$$(interpreter_test_rule),-Xint $(3)) - - ART_TEST_TARGET_OAT_INTERPRETER$$($(2)ART_PHONY_TEST_TARGET_SUFFIX)_RULES += $$(interpreter_test_rule) - ART_TEST_TARGET_OAT_INTERPRETER_RULES += $$(interpreter_test_rule) - ART_TEST_TARGET_OAT_INTERPRETER_$(1)_RULES += $$(interpreter_test_rule) - - # Define a phony rule to run both the default and interpreter variants. - all_test_rule := test-art-target-oat$(4)-$(1)$($(2)ART_PHONY_TEST_TARGET_SUFFIX) -.PHONY: $$(all_test_rule) -$$(all_test_rule): $$(default_test_rule) $$(optimizing_test_rule) $$(interpreter_test_rule) - $(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@) - - ART_TEST_TARGET_OAT$$($(2)ART_PHONY_TEST_TARGET_SUFFIX)_RULES += $$(all_test_rule) - ART_TEST_TARGET_OAT_RULES += $$(all_test_rule) - ART_TEST_TARGET_OAT_$(1)_RULES += $$(all_test_rule) - - # Clear locally defined variables. - interpreter_test_rule := - default_test_rule := - optimizing_test_rule := - all_test_rule := -endef # define-test-art-oat-rules-target - -ART_TEST_HOST_OAT_DEFAULT$(ART_PHONY_TEST_HOST_SUFFIX)_RULES := -ART_TEST_HOST_OAT_DEFAULT$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES := -ART_TEST_HOST_OAT_DEFAULT_RULES := -ART_TEST_HOST_OAT_OPTIMIZING$(ART_PHONY_TEST_HOST_SUFFIX)_RULES := -ART_TEST_HOST_OAT_OPTIMIZING$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES := -ART_TEST_HOST_OAT_OPTIMIZING_RULES := -ART_TEST_HOST_OAT_INTERPRETER$(ART_PHONY_TEST_HOST_SUFFIX)_RULES := -ART_TEST_HOST_OAT_INTERPRETER$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES := -ART_TEST_HOST_OAT_INTERPRETER_RULES := -ART_TEST_HOST_OAT$(ART_PHONY_TEST_HOST_SUFFIX)_RULES := -ART_TEST_HOST_OAT$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES := -ART_TEST_HOST_OAT_RULES := - -# All tests require the host executables, libarttest and the core images. -ART_TEST_HOST_OAT_DEPENDENCIES := \ - $(ART_HOST_EXECUTABLES) \ - $(ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \ - $(ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) \ - $(HOST_CORE_IMG_OUT) - -ifneq ($(HOST_PREFER_32_BIT),true) -ART_TEST_HOST_OAT_DEPENDENCIES += \ - $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \ - $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) \ - $(2ND_HOST_CORE_IMG_OUT) -endif - -# Define rule to run an individual oat test on the host. Output from the test is written to the -# host in /tmp/android-data in a directory named after test's rule name (its target) and the parent -# process' PID (ie the PID of make). On failure the output is dumped to the console. -# $(1): directory - the name of the test we're building such as HelloWorld. -# $(2): 2ND_ or undefined - used to differentiate between the primary and secondary architecture. -# $(3): the target (rule name), e.g. test-art-host-oat-default-HelloWorld64 -# $(4): argument to dex2oat -# $(5): argument to runtime, e.g. -Xint or undefined -define define-test-art-oat-rule-host - # Remove the leading / from /tmp for the test directory. - dex_file := $$(subst /tmp,tmp,$(ART_HOST_TEST_DIR))/android-data-$(3)/oat-test-dex-$(1).jar - oat_file := $(ART_HOST_TEST_DIR)/android-data-$(3)/dalvik-cache/$$($(2)ART_HOST_ARCH)/$$(subst /,@,$$(dex_file))@classes.dex -$(3): PRIVATE_DEX_FILE := /$$(dex_file) -$(3): PRIVATE_OAT_FILE := $$(oat_file) -.PHONY: $(3) -$(3): $$(ART_TEST_HOST_OAT_$(1)_DEX) $(ART_TEST_HOST_OAT_DEPENDENCIES) - $(hide) mkdir -p $(ART_HOST_TEST_DIR)/android-data-$$@/dalvik-cache/$$($(2)ART_HOST_ARCH) - $(hide) cp $$(realpath $$<) $(ART_HOST_TEST_DIR)/android-data-$$@/oat-test-dex-$(1).jar - $(hide) $(DEX2OATD) $(DEX2OAT_FLAGS) --runtime-arg -Xms$(DEX2OAT_XMS) --runtime-arg -Xmx$(DEX2OAT_XMX) $(4) \ - --boot-image=$$(HOST_CORE_IMG_LOCATION) --include-patch-information \ - --dex-file=$$(PRIVATE_DEX_FILE) --oat-file=$$(PRIVATE_OAT_FILE) \ - --instruction-set=$($(2)ART_HOST_ARCH) --host --android-root=$(HOST_OUT) \ - || $$(call ART_TEST_FAILED,$$@) - $(hide) $$(call ART_TEST_SKIP,$$@) && \ - ANDROID_DATA=$(ART_HOST_TEST_DIR)/android-data-$$@/ \ - ANDROID_ROOT=$(HOST_OUT) \ - ANDROID_LOG_TAGS='*:d' \ - LD_LIBRARY_PATH=$$($(2)ART_HOST_OUT_SHARED_LIBRARIES) \ - LD_PRELOAD=libsigchain$$(ART_HOST_SHLIB_EXTENSION) \ - $(HOST_OUT_EXECUTABLES)/dalvikvm$$($(2)ART_PHONY_TEST_HOST_SUFFIX) $(DALVIKVM_FLAGS) $(5) \ - -XXlib:libartd$(HOST_SHLIB_SUFFIX) -Ximage:$$(HOST_CORE_IMG_LOCATION) \ - -classpath $(ART_HOST_TEST_DIR)/android-data-$$@/oat-test-dex-$(1).jar \ - -Djava.library.path=$$($(2)ART_HOST_OUT_SHARED_LIBRARIES) $(1) \ - > $(ART_HOST_TEST_DIR)/android-data-$$@/output.txt 2>&1 \ - && $$(call ART_TEST_PASSED,$$@) \ - || (([ ! -f $(ART_HOST_TEST_DIR)/android-data-$$@/output.txt ] || \ - cat $(ART_HOST_TEST_DIR)/android-data-$$@/output.txt >&2 ) && $$(call ART_TEST_FAILED,$$@)) - $$(hide) (echo $(MAKECMDGOALS) | grep -q $$@ && \ - echo "run-test run as top-level target, removing test directory $(ART_HOST_TEST_DIR)" && \ - rm -r $(ART_HOST_TEST_DIR)) || true -endef # define-test-art-oat-rule-host - -# Define rules to run oat tests on the host. -# $(1): directory - the name of the test we're building such as HelloWorld. -# $(2): 2ND_ or undefined - used to differentiate between the primary and secondary architecture. -define define-test-art-oat-rules-host - # Create a rule to run the host oat test with the default compiler. - default_test_rule := test-art-host-oat-default-$(1)$$($(2)ART_PHONY_TEST_HOST_SUFFIX) - $(call define-test-art-oat-rule-host,$(1),$(2),$$(default_test_rule),,) - - ART_TEST_HOST_OAT_DEFAULT$$($(2)ART_PHONY_TEST_HOST_SUFFIX)_RULES += $$(default_test_rule) - ART_TEST_HOST_OAT_DEFAULT_RULES += $$(default_test_rule) - ART_TEST_HOST_OAT_DEFAULT_$(1)_RULES += $$(default_test_rule) - - gcverify_test_rule := test-art-host-oat-gcverify-default-$(1)$$($(2)ART_PHONY_TEST_HOST_SUFFIX) - ifeq ($$(ART_TEST_GC_VERIFY),true) - $(call define-test-art-oat-rule-host,$(1),$(2),$$(gcverify_test_rule),,-Xgc:preverify -Xgc:postverify -Xgc:preverify_rosalloc -Xgc:postverify_rosalloc) - else - .PHONY: $$(gcverify_test_rule) -$$(gcverify_test_rule): - - endif - - ART_TEST_HOST_OAT_DEFAULT$$($(2)ART_PHONY_TEST_HOST_SUFFIX)_RULES += $$(gcverify_test_rule) - ART_TEST_HOST_OAT_DEFAULT_RULES += $$(gcverify_test_rule) - ART_TEST_HOST_OAT_DEFAULT_$(1)_RULES += $$(gcverify_test_rule) - - gcstress_test_rule := test-art-host-oat-gcstress-default-$(1)$$($(2)ART_PHONY_TEST_HOST_SUFFIX) - ifeq ($$(ART_TEST_GC_STRESS),true) - $(call define-test-art-oat-rule-host,$(1),$(2),$$(gcstress_test_rule),,-Xgc:SS -Xms2m -Xmx2m -Xgc:preverify -Xgc:postverify) - else - .PHONY: $$(gcstress_test_rule) -$$(gcstress_test_rule): - - endif - - ART_TEST_HOST_OAT_DEFAULT$$($(2)ART_PHONY_TEST_HOST_SUFFIX)_RULES += $$(gcstress_test_rule) - ART_TEST_HOST_OAT_DEFAULT_RULES += $$(gcstress_test_rule) - ART_TEST_HOST_OAT_DEFAULT_$(1)_RULES += $$(gcstress_test_rule) - - # Create a rule to run the host oat test with the optimizing compiler. - optimizing_test_rule := test-art-host-oat-optimizing-$(1)$$($(2)ART_PHONY_TEST_HOST_SUFFIX) - ifeq ($$(ART_TEST_OPTIMIZING),true) - $(call define-test-art-oat-rule-host,$(1),$(2),$$(optimizing_test_rule),--compiler-backend=Optimizing,) - else - .PHONY: $$(optimizing_test_rule) -$$(optimizing_test_rule): - - endif - - ART_TEST_HOST_OAT_OPTIMIZING$$($(2)ART_PHONY_TEST_HOST_SUFFIX)_RULES += $$(optimizing_test_rule) - ART_TEST_HOST_OAT_OPTIMIZING_RULES += $$(optimizing_test_rule) - ART_TEST_HOST_OAT_OPTIMIZING_$(1)_RULES += $$(optimizing_test_rule) - - # Create a rule to run the host oat test with the interpreter. - interpreter_test_rule := test-art-host-oat-interpreter-$(1)$$($(2)ART_PHONY_TEST_HOST_SUFFIX) - $(call define-test-art-oat-rule-host,$(1),$(2),$$(interpreter_test_rule),--compiler-filter=interpret-only,-Xint) - - ART_TEST_HOST_OAT_INTERPRETER$$($(2)ART_PHONY_TEST_HOST_SUFFIX)_RULES += $$(interpreter_test_rule) - ART_TEST_HOST_OAT_INTERPRETER_RULES += $$(interpreter_test_rule) - ART_TEST_HOST_OAT_INTERPRETER_$(1)_RULES += $$(interpreter_test_rule) - - # Define a phony rule to run both the default and interpreter variants. - all_test_rule := test-art-host-oat-$(1)$$($(2)ART_PHONY_TEST_HOST_SUFFIX) -.PHONY: $$(all_test_rule) -$$(all_test_rule): $$(default_test_rule) $$(gcverify_test_rule) $$(gcstress_test_rule) $$(interpreter_test_rule) $$(optimizing_test_rule) - $(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@) - - ART_TEST_HOST_OAT$$($(2)ART_PHONY_TEST_HOST_SUFFIX)_RULES += $$(all_test_rule) - ART_TEST_HOST_OAT_RULES += $$(all_test_rule) - ART_TEST_HOST_OAT_$(1)_RULES += $$(all_test_rule) - - # Clear locally defined variables. - default_test_rule := - gcverify_test_rule := - optimizing_test_rule := - interpreter_test_rule := - all_test_rule := -endef # define-test-art-oat-rules-host - -# For a given test create all the combinations of host/target, compiler and suffix such as: -# test-art-host-oat-HelloWord or test-art-target-oat-interpreter-HelloWorld64 -# $(1): test name, e.g. HelloWorld -# $(2): host or target -# $(3): HOST or TARGET -# $(4): undefined, -default, -optimizing or -interpreter -# $(5): undefined, _DEFAULT, _OPTIMIZING or _INTERPRETER -define define-test-art-oat-combination-for-test - ifeq ($(2),host) - ifneq ($(3),HOST) - $$(error argument mismatch $(2) and ($3)) - endif - else - ifneq ($(2),target) - $$(error found $(2) expected host or target) - endif - ifneq ($(3),TARGET) - $$(error argument mismatch $(2) and ($3)) - endif - endif - - rule_name := test-art-$(2)-oat$(4)-$(1) - dependencies := $$(ART_TEST_$(3)_OAT$(5)_$(1)_RULES) - - ifeq ($$(dependencies),) - ifneq ($(4),-optimizing) - $$(error $$(rule_name) has no dependencies) - endif - endif - -.PHONY: $$(rule_name) -$$(rule_name): $$(dependencies) - $(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@) - - # Clear locally defined variables. - rule_name := - dependencies := -endef # define-test-art-oat-combination - -# Define target and host oat test rules for the differing multilib flavors and default vs -# interpreter runs. The format of the generated rules (for running an individual test) is: -# test-art-(host|target)-oat-(default|interpreter)-${directory}(32|64) -# The rules are appended to various lists to enable shorter phony build rules to be built. -# $(1): directory -define define-test-art-oat-rules - # Define target tests. - ART_TEST_TARGET_OAT_DEFAULT_$(1)_RULES := - ART_TEST_TARGET_OAT_OPTIMIZING_$(1)_RULES := - ART_TEST_TARGET_OAT_INTERPRETER_$(1)_RULES := - ART_TEST_TARGET_OAT_$(1)_RULES := - ifeq ($(ART_TEST_OAT_NO_RELOCATE),true) - $(call define-test-art-oat-rules-target,$(1),, \ - -Xnorelocate -Xcompiler-option --no-include-patch-information,-norelocate) - ifdef TARGET_2ND_ARCH - $(call define-test-art-oat-rules-target,$(1),2ND_, \ - -Xnorelocate -Xcompiler-option --no-include-patch-information,-norelocate) - endif - endif - ifeq ($(ART_TEST_OAT_RELOCATE),true) - $(call define-test-art-oat-rules-target,$(1),, \ - -Xrelocate -Xcompiler-option --include-patch-information,-relocate) - ifdef TARGET_2ND_ARCH - $(call define-test-art-oat-rules-target,$(1),2ND_, \ - -Xrelocate -Xcompiler-option --include-patch-information,-relocate) - endif - endif - $(call define-test-art-oat-combination-for-test,$(1),target,TARGET,,)) - $(call define-test-art-oat-combination-for-test,$(1),target,TARGET,-default,_DEFAULT)) - $(call define-test-art-oat-combination-for-test,$(1),target,TARGET,-optimizing,_OPTIMIZING)) - $(call define-test-art-oat-combination-for-test,$(1),target,TARGET,-interpreter,_INTERPRETER)) - - # Define host tests. - ART_TEST_HOST_OAT_DEFAULT_$(1)_RULES := - ART_TEST_HOST_OAT_OPTIMIZING_$(1)_RULES := - ART_TEST_HOST_OAT_INTERPRETER_$(1)_RULES := - ART_TEST_HOST_OAT_$(1)_RULES := - $(call define-test-art-oat-rules-host,$(1),) - ifneq ($(HOST_PREFER_32_BIT),true) - $(call define-test-art-oat-rules-host,$(1),2ND_) - endif - $(call define-test-art-oat-combination-for-test,$(1),host,HOST,,) - $(call define-test-art-oat-combination-for-test,$(1),host,HOST,-default,_DEFAULT) - $(call define-test-art-oat-combination-for-test,$(1),host,HOST,-optimizing,_OPTIMIZING) - $(call define-test-art-oat-combination-for-test,$(1),host,HOST,-interpreter,_INTERPRETER) - - # Clear locally defined variables. - ART_TEST_TARGET_OAT_DEFAULT_$(1)_RULES := - ART_TEST_TARGET_OAT_OPTIMIZING_$(1)_RULES := - ART_TEST_TARGET_OAT_INTERPRETER_$(1)_RULES := - ART_TEST_TARGET_OAT_$(1)_RULES := - ART_TEST_HOST_OAT_DEFAULT_$(1)_RULES := - ART_TEST_HOST_OAT_OPTIMIZING_$(1)_RULES := - ART_TEST_HOST_OAT_INTERPRETER_$(1)_RULES := - ART_TEST_HOST_OAT_$(1)_RULES := -endef # define-test-art-oat-rules -$(foreach dir,$(TEST_OAT_DIRECTORIES), $(eval $(call define-test-art-oat-rules,$(dir)))) - -# Define all the combinations of host/target, compiler and suffix such as: -# test-art-host-oat or test-art-target-oat-interpreter64 -# $(1): host or target -# $(2): HOST or TARGET -# $(3): undefined, -default, -optimizing or -interpreter -# $(4): undefined, _DEFAULT, _OPTIMIZING or _INTERPRETER -# $(5): undefined, 32 or 64 -define define-test-art-oat-combination - ifeq ($(1),host) - ifneq ($(2),HOST) - $$(error argument mismatch $(1) and ($2)) - endif - else - ifneq ($(1),target) - $$(error found $(1) expected host or target) - endif - ifneq ($(2),TARGET) - $$(error argument mismatch $(1) and ($2)) - endif - endif - - rule_name := test-art-$(1)-oat$(3)$(5) - dependencies := $$(ART_TEST_$(2)_OAT$(4)$(5)_RULES) - - ifeq ($$(dependencies),) - ifneq ($(3),-optimizing) - $$(error $$(rule_name) has no dependencies) - endif - endif - -.PHONY: $$(rule_name) -$$(rule_name): $$(dependencies) - $(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@) - - # Clear locally defined variables. - rule_name := - dependencies := - -endef # define-test-art-oat-combination - -$(eval $(call define-test-art-oat-combination,target,TARGET,,,)) -$(eval $(call define-test-art-oat-combination,target,TARGET,-default,_DEFAULT,)) -$(eval $(call define-test-art-oat-combination,target,TARGET,-optimizing,_OPTIMIZING,)) -$(eval $(call define-test-art-oat-combination,target,TARGET,-interpreter,_INTERPRETER,)) -$(eval $(call define-test-art-oat-combination,target,TARGET,,,$(ART_PHONY_TEST_TARGET_SUFFIX))) -$(eval $(call define-test-art-oat-combination,target,TARGET,-default,_DEFAULT,$(ART_PHONY_TEST_TARGET_SUFFIX))) -$(eval $(call define-test-art-oat-combination,target,TARGET,-optimizing,_OPTIMIZING,$(ART_PHONY_TEST_TARGET_SUFFIX))) -$(eval $(call define-test-art-oat-combination,target,TARGET,-interpreter,_INTERPRETER,$(ART_PHONY_TEST_TARGET_SUFFIX))) -ifdef TARGET_2ND_ARCH -$(eval $(call define-test-art-oat-combination,target,TARGET,,,$(2ND_ART_PHONY_TEST_TARGET_SUFFIX))) -$(eval $(call define-test-art-oat-combination,target,TARGET,-default,_DEFAULT,$(2ND_ART_PHONY_TEST_TARGET_SUFFIX))) -$(eval $(call define-test-art-oat-combination,target,TARGET,-optimizing,_OPTIMIZING,$(2ND_ART_PHONY_TEST_TARGET_SUFFIX))) -$(eval $(call define-test-art-oat-combination,target,TARGET,-interpreter,_INTERPRETER,$(2ND_ART_PHONY_TEST_TARGET_SUFFIX))) -endif - -$(eval $(call define-test-art-oat-combination,host,HOST,,,)) -$(eval $(call define-test-art-oat-combination,host,HOST,-default,_DEFAULT,)) -$(eval $(call define-test-art-oat-combination,host,HOST,-optimizing,_OPTIMIZING,)) -$(eval $(call define-test-art-oat-combination,host,HOST,-interpreter,_INTERPRETER,)) -$(eval $(call define-test-art-oat-combination,host,HOST,,,$(ART_PHONY_TEST_HOST_SUFFIX))) -$(eval $(call define-test-art-oat-combination,host,HOST,-default,_DEFAULT,$(ART_PHONY_TEST_HOST_SUFFIX))) -$(eval $(call define-test-art-oat-combination,host,HOST,-optimizing,_OPTIMIZING,$(ART_PHONY_TEST_HOST_SUFFIX))) -$(eval $(call define-test-art-oat-combination,host,HOST,-interpreter,_INTERPRETER,$(ART_PHONY_TEST_HOST_SUFFIX))) -ifneq ($(HOST_PREFER_32_BIT),true) -$(eval $(call define-test-art-oat-combination,host,HOST,,,$(2ND_ART_PHONY_TEST_HOST_SUFFIX))) -$(eval $(call define-test-art-oat-combination,host,HOST,-default,_DEFAULT,$(2ND_ART_PHONY_TEST_HOST_SUFFIX))) -$(eval $(call define-test-art-oat-combination,host,HOST,-optimizing,_OPTIMIZING,$(2ND_ART_PHONY_TEST_HOST_SUFFIX))) -$(eval $(call define-test-art-oat-combination,host,HOST,-interpreter,_INTERPRETER,$(2ND_ART_PHONY_TEST_HOST_SUFFIX))) -endif - -# List -relocate version on the target as broken. - -# List all the test names for target and compiler variants. -# $(1): test name, e.g. Main -# $(2): -relocate, -norelocate, -prebuild, or undefined. -define all-oat-test-target-names - test-art-target-oat-default$(2)-$(1)32 \ - test-art-target-oat-optimizing$(2)-$(1)32 \ - test-art-target-oat-interpreter$(2)-$(1)32 \ - test-art-target-oat-default$(2)-$(1)64 \ - test-art-target-oat-optimizing$(2)-$(1)64 \ - test-art-target-oat-interpreter$(2)-$(1)64 -endef # all-oat-test-target-names - -ART_TEST_KNOWN_BROKEN += $(foreach test, $(TEST_OAT_DIRECTORIES), $(call all-oat-test-target-names,$(test),-relocate)) - -# Clear locally defined variables. -define-test-art-oat-rule-target := -define-test-art-oat-rules-target := -define-test-art-oat-rule-host := -define-test-art-oat-rules-host := -define-test-art-oat-combination-for-test := -define-test-art-oat-combination := -ART_TEST_TARGET_OAT_DEFAULT$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES := -ART_TEST_TARGET_OAT_DEFAULT$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES := -ART_TEST_TARGET_OAT_DEFAULT_RULES := -ART_TEST_TARGET_OAT_OPTIMIZING$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES := -ART_TEST_TARGET_OAT_OPTIMIZING$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES := -ART_TEST_TARGET_OAT_OPTIMIZING_RULES := -ART_TEST_TARGET_OAT_INTERPRETER$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES := -ART_TEST_TARGET_OAT_INTERPRETER$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES := -ART_TEST_TARGET_OAT_INTERPRETER_RULES := -ART_TEST_TARGET_OAT$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES := -ART_TEST_TARGET_OAT$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES := -ART_TEST_TARGET_OAT_RULES := -ART_TEST_HOST_OAT_DEFAULT$(ART_PHONY_TEST_HOST_SUFFIX)_RULES := -ART_TEST_HOST_OAT_DEFAULT$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES := -ART_TEST_HOST_OAT_DEFAULT_RULES := -ART_TEST_HOST_OAT_OPTIMIZING$(ART_PHONY_TEST_HOST_SUFFIX)_RULES := -ART_TEST_HOST_OAT_OPTIMIZING$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES := -ART_TEST_HOST_OAT_OPTIMIZING_RULES := -ART_TEST_HOST_OAT_INTERPRETER$(ART_PHONY_TEST_HOST_SUFFIX)_RULES := -ART_TEST_HOST_OAT_INTERPRETER$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES := -ART_TEST_HOST_OAT_INTERPRETER_RULES := -ART_TEST_HOST_OAT$(ART_PHONY_TEST_HOST_SUFFIX)_RULES := -ART_TEST_HOST_OAT$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES := -ART_TEST_HOST_OAT_RULES := -ART_TEST_HOST_OAT_DEPENDENCIES := -$(foreach dir,$(TEST_OAT_DIRECTORIES), $(eval ART_TEST_TARGET_OAT_$(dir)_DEX :=)) -$(foreach dir,$(TEST_OAT_DIRECTORIES), $(eval ART_TEST_HOST_OAT_$(dir)_DEX :=)) -TEST_OAT_DIRECTORIES := -LOCAL_PID := -LOCAL_PATH := diff --git a/test/Android.run-test.mk b/test/Android.run-test.mk index 4f03347335..7ee5a04e44 100644 --- a/test/Android.run-test.mk +++ b/test/Android.run-test.mk @@ -72,7 +72,10 @@ endif # Tests that are broken in --trace mode. TEST_ART_BROKEN_TRACE_RUN_TESTS := \ 003-omnibus-opcodes \ - 004-annotations \ + 004-InterfaceTest \ + 004-SignalTest \ + 004-ThreadStress \ + 005-annotations \ 012-math \ 018-stack-overflow \ 023-many-interfaces \ @@ -97,6 +100,7 @@ TEST_ART_BROKEN_TRACE_RUN_TESTS := \ 103-string-append \ 107-int-math2 \ 112-double-math \ + 114-ParallelGC \ 700-LoadArgRegs \ 701-easy-div-rem @@ -108,7 +112,8 @@ ART_TEST_KNOWN_BROKEN += $(foreach test, $(TEST_ART_BROKEN_TRACE_RUN_TESTS), $(c # Tests that need more than 2MB of RAM or are running into other corner cases in GC stress related # to OOMEs. -TEST_ART_BROKEN_GCSTRESS_RUN_TESTS := +TEST_ART_BROKEN_GCSTRESS_RUN_TESTS := \ + 114-ParallelGC ART_TEST_KNOWN_BROKEN += $(foreach test, $(TEST_ART_BROKEN_GCSTRESS_RUN_TESTS), $(call all-run-test-names,$(test),-gcstress,-relocate)) ART_TEST_KNOWN_BROKEN += $(foreach test, $(TEST_ART_BROKEN_GCSTRESS_RUN_TESTS), $(call all-run-test-names,$(test),-gcstress,-no-prebuild)) @@ -280,14 +285,22 @@ ART_TEST_HOST_RUN_TEST_OPTIMIZING_PREBUILD$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULE # We need dex2oat and dalvikvm on the target as well as the core image. TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_EXECUTABLES) $(TARGET_CORE_IMG_OUT) $(2ND_TARGET_CORE_IMG_OUT) +# Also need libarttest. +TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libarttest.so +ifdef TARGET_2ND_ARCH +TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libarttest.so +endif + # All tests require the host executables and the core images. ART_TEST_HOST_RUN_TEST_DEPENDENCIES := \ $(ART_HOST_EXECUTABLES) \ + $(ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \ $(ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) \ $(HOST_CORE_IMG_OUT) ifneq ($(HOST_PREFER_32_BIT),true) ART_TEST_HOST_RUN_TEST_DEPENDENCIES += \ + $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \ $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) \ $(2ND_HOST_CORE_IMG_OUT) endif @@ -464,10 +477,6 @@ define define-test-art-run-test-group-type endif endif - ART_TEST_$$(group_uc_host_or_target)_RUN_TEST_DEFAULT_$(1)_RULES := - ART_TEST_$$(group_uc_host_or_target)_RUN_TEST_INTERPRETER_$(1)_RULES := - ART_TEST_$$(group_uc_host_or_target)_RUN_TEST_OPTIMIZING_$(1)_RULES := - ART_TEST_$$(group_uc_host_or_target)_RUN_TEST_$(1)_RULES := $$(eval $$(call define-test-art-run-test,$(1),$(2),default,$$(ART_PHONY_TEST_$$(group_uc_host_or_target)_SUFFIX),,$(3))) $$(eval $$(call define-test-art-run-test,$(1),$(2),interpreter,$$(ART_PHONY_TEST_$$(group_uc_host_or_target)_SUFFIX),,$(3))) $$(eval $$(call define-test-art-run-test,$(1),$(2),optimizing,$$(ART_PHONY_TEST_$$(group_uc_host_or_target)_SUFFIX),,$(3))) @@ -795,6 +804,9 @@ ifneq ($(HOST_PREFER_32_BIT),true) $(ART_TEST_HOST_RUN_TEST_OPTIMIZING_RELOCATE$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES))) endif +# include libarttest build rules. +include $(LOCAL_PATH)/Android.libarttest.mk + define-test-art-run-test := define-test-art-run-test-group-rule := define-test-art-run-test-group := diff --git a/test/etc/default-check b/test/etc/default-check new file mode 100755 index 0000000000..46a095c254 --- /dev/null +++ b/test/etc/default-check @@ -0,0 +1,17 @@ +#!/bin/bash +# +# Copyright (C) 2014 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +diff --strip-trailing-cr -q "$1" "$2" >/dev/null
\ No newline at end of file diff --git a/test/etc/host-run-test-jar b/test/etc/host-run-test-jar index d69180b697..d72e997fd1 100755 --- a/test/etc/host-run-test-jar +++ b/test/etc/host-run-test-jar @@ -183,4 +183,4 @@ if [ "$DEV_MODE" = "y" ]; then fi cd $ANDROID_BUILD_TOP -$mkdir_cmd && $prebuild_cmd && $cmdline "$@" +$mkdir_cmd && $prebuild_cmd && LD_PRELOAD=libsigchain.so $cmdline "$@" diff --git a/test/etc/push-and-run-prebuilt-test-jar b/test/etc/push-and-run-prebuilt-test-jar index 2b9604b515..df9c0d562d 100755 --- a/test/etc/push-and-run-prebuilt-test-jar +++ b/test/etc/push-and-run-prebuilt-test-jar @@ -26,6 +26,8 @@ FLAGS="" TARGET_SUFFIX="" COMPILE_FLAGS="" +echo "$@" + while true; do if [ "x$1" = "x--quiet" ]; then QUIET="y" diff --git a/test/run-test b/test/run-test index 5bfa6878a0..71a1d70281 100755 --- a/test/run-test +++ b/test/run-test @@ -56,6 +56,7 @@ info="info.txt" build="build" run="run" expected="expected.txt" +check_cmd="check" output="output.txt" build_output="build-output.txt" lib="libartd.so" @@ -187,6 +188,18 @@ while true; do done mkdir -p $tmp_dir +# Most interesting target architecture variables are Makefile variables, not environment variables. +# Try to map the suffix64 flag and what we find in ${OUT}/data/art-test to an architecture name. +function guess_arch_name() { + grep32bit=`ls ${OUT}/data/art-test | grep -E '^(arm|x86|mips)$'` + grep64bit=`ls ${OUT}/data/art-test | grep -E '^(arm64|x86_64)$'` + if [ "x${suffix64}" = "x64" ]; then + target_arch_name=${grep64bit} + else + target_arch_name=${grep32bit} + fi +} + if [ "$target_mode" = "no" ]; then if [ "$runtime" = "jvm" ]; then RUN="${progdir}/etc/reference-run-test-classes" @@ -228,7 +241,10 @@ elif [ "$runtime" = "art" ]; then export ANDROID_HOST_OUT=$ANDROID_BUILD_TOP/out/host/linux-x86 fi run_args="${run_args} --boot -Ximage:${ANDROID_HOST_OUT}/framework/core.art" + run_args="${run_args} --runtime-option -Djava.library.path=${ANDROID_HOST_OUT}/lib${suffix64}" else + guess_arch_name + run_args="${run_args} --runtime-option -Djava.library.path=/data/art-test/${target_arch_name}" run_args="${run_args} --boot -Ximage:/data/art-test/core.art" fi if [ "$relocate" = "yes" ]; then @@ -340,8 +356,13 @@ if [ '!' -r "$run" ]; then cp "${progdir}/etc/default-run" run fi +if [ '!' -r "$check_cmd" ]; then + cp "${progdir}/etc/default-check" check +fi + chmod 755 "$build" chmod 755 "$run" +chmod 755 "$check_cmd" export TEST_NAME=`basename ${test_dir}` @@ -408,7 +429,7 @@ else cp "$build_output" "$output" echo "build exit status: $build_exit" >>"$output" fi - diff --strip-trailing-cr -q "$expected" "$output" >/dev/null + ./$check_cmd "$expected" "$output" if [ "$?" = "0" ]; then # output == expected good="yes" |