summaryrefslogtreecommitdiff
path: root/runtime/common_runtime_test.cc
Commit message (Collapse)AuthorAgeFilesLines
* Uncouple ART gtests from the ART APEX.Roland Levillain2021-07-121-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce standalone versions of ART gtests on target, not bundled with the ART APEX. So far ART gtests have always been built as debug artifacts (and linked against ART debug libraries). Make some adjustments in some of these tests so that they can also work as non-debug artifacts and be used with the Release ART APEX (which contains only non-debug artifacts). Newly added tests: * `art_standalone_cmdline_tests` * `art_standalone_compiler_tests` * `art_standalone_dex2oat_tests` * `art_standalone_dexdump_tests` * `art_standalone_dexlist_tests` * `art_standalone_dexoptanalyzer_tests` * Note: Requires root access to the device. * `art_standalone_libartbase_tests` * `art_standalone_libartpalette_tests` * `art_standalone_libdexfile_support_tests` * `art_standalone_libdexfile_tests` * `art_standalone_libprofile_tests` * `art_standalone_oatdump_tests` * `art_standalone_odrefresh_tests` * `art_standalone_profman_tests` * Note: Requires root access to the device. * Note: Some tests (2 out of 37) are failing in multi-ABI contexts and have been temporarily disabled. * `art_standalone_runtime_compiler_tests` * `art_standalone_runtime_tests` * Note: Some tests (16 out of 686) are failing and have been temporarily disabled. * Note: Some tests (4 out of 686) are failing in multi-ABI contexts and have been temporarily disabled. * `art_standalone_sigchain_tests` Tests not added: * `art_standalone_dexanalyze_tests` * Reason: ART binary `dexanalyze` is not part of the Release ART APEX. * `art_standalone_dexdiag_tests` * Reason: ART binary `dexdiag` is not part of the Release ART APEX. * `art_standalone_dexlayout_tests` * Reason: ART binary `dexlayout` is not part of the Release ART APEX. * `art_standalone_imgdiag_tests` * Reason: ART binary `imgdiag` is not part of the Release ART APEX. Tests not added (but present in AOSP): * `art_standalone_libartservice_tests` * Reason: Test `art_libartservice_tests` does not exist in this branch. * `art_standalone_libarttools_tests` * Reason: Test `art_libarttools_tests` does not exist in this branch. (cherry picked from commit f040914a122be86e280efe5e31af1168f2b7c72e) Test: atest -a art_standalone_cmdline_tests Test: atest -a art_standalone_compiler_tests Test: atest -a art_standalone_dex2oat_tests Test: atest -a art_standalone_dexdump_tests Test: atest -a art_standalone_dexlist_tests Test: atest -a art_standalone_dexoptanalyzer_tests Test: atest -a art_standalone_libartbase_tests Test: atest -a art_standalone_libartpalette_tests Test: atest -a art_standalone_libdexfile_support_tests Test: atest -a art_standalone_libdexfile_tests Test: atest -a art_standalone_libprofile_tests Test: atest -a art_standalone_oatdump_tests Test: atest -a art_standalone_odrefresh_tests Test: atest -a art_standalone_profman_tests Test: atest -a art_standalone_runtime_compiler_tests Test: atest -a art_standalone_runtime_tests Test: atest -a art_standalone_sigchain_tests Test: atest -a art_standalone_\*_tests Test: m art_chroot && atest ArtGtestsTargetChroot Bug: 193218514 Bug: 162834439 Bug: 162734417 Change-Id: I8beda9159d48c4ca495698357dc3bd95e3ff84d5 Merged-In: I8beda9159d48c4ca495698357dc3bd95e3ff84d5
* dex2oat: Expect boot image profiles for boot image.Vladimir Marko2021-04-261-2/+3
| | | | | | | | | | | | | | The profile loading is currently permissive, so this does not really matter but we intend to make it more strict soon. Also clean up ScratchFile to avoid dex2oat_image_test error logs related to ScratchFile destruction. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 148067697 Change-Id: I34526ddb0389444d54b9754afbedeb671c7b05a8
* Rewrite method matching in UnstartedRuntime.Vladimir Marko2021-01-111-0/+2
| | | | | | | | | | | | | | | Use the `ArtMethod*` as the key in the maps to avoid the `PrettyMethod()` overhead. Remove ByteOrder.isLittleEndian() implementation from UnstartedRuntime. The Java method has been removed by https://android-review.googlesource.com/151062 . Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: boots. Bug: 175869411 Change-Id: I97cf91a0abf2b28f83562d8764d28edafa1a09e2
* Update host tests to point to a dedicated boot image directory.Martin Stjernholm2020-10-201-10/+0
| | | | | | | | | | | | | | | | | | | | On device the boot image files are in the APEX, but on host they're created by the global code in dexpreopt_config.go and installed by make in the same location irrespective of the ART APEX in use (release or debug). That location is now moved to $(ANDROID_HOST_OUT)/apex/art_boot_images to avoid conflict with the APEX paths (because the release APEX is moving from com.android.art.release to com.android.art). Test: art/test/testrunner/run_build_test_target.py art-test Test: art/build/apex/runtests.sh Test: art/tools/buildbot-build.sh {--host,--target} Test: art/tools/run-gtests.sh Test: m test-art-host-gtest Test: art/test/testrunner/testrunner.py --target --64 --optimizing Test: m build-art-target-golem Bug: 169639321 Change-Id: I932a15539e170d3c6c78515b22dd4b91ce1c57b4
* Refactor arm assembly tests.David Srbecky2020-07-091-23/+0
| | | | | | | | Another step in preparation to move to the LLVM toolchain. Bug: 147817558 Test: m test-art-host-gtest Change-Id: Ie5be337165d8f24e04740de0486144fa6a62f063
* Revert^2 "Remove test_per_src from ART tests."David Srbecky2020-05-151-22/+0
| | | | | | | | | | | | | | | | | | | | | | Second attempt at this, which fixes the asan failures. Remove test_per_src since it is not supported by atest. Replace it with gtest_isolate which is transparent to atest, and which still allows us to run tests in parallel. The size of test binaries halves (from 1GB to 0.5GB). Test run-time on host is unchanged. Test run-time on target is 4x faster (tested on walleye). Added a gtest_main.cc with the gtest isolated main function, and ART-specific initialization. Bug: 147819342 Test: m test-art-host-gtest Test: art/tools/run-gtests.sh Test: art/test/testrunner/run_build_test_target.py art-gtest-asan Change-Id: I515c911bb7d44285495802fc66cd732fc8e6d8df
* Revert "Remove test_per_src from ART tests."Christopher Ferris2020-05-081-3/+3
| | | | | | | | | This reverts commit 8103e479d8f8447584582b2b70752029f7087776. Reason for revert: asan run fails in multiple ways Test: ran ./art/test/testrunner/run_build_test_target.py art-gtest-asan Change-Id: Ib9f2887436a664b64c6410f56a25ae2dd0e0aab4
* Remove test_per_src from ART tests.David Srbecky2020-05-071-3/+3
| | | | | | | | | | | | | | | Remove test_per_src since it is not supported by atest. Replace it with gtest_isolate which is transparent to atest, and which still allows us to run tests in parallel. The size of test binaries halves (from 1GB to 0.5GB). Test run-time on host is unchanged. Test run-time on target is 4x faster (tested on walleye). Bug: 147819342 Test: m test-art-host-gtest Test: art/tools/run-gtests.sh Change-Id: Id295af00d08b24baa2e421b0f3313df0b2e56fe9
* Deduplicate interned image strings.Vladimir Marko2020-03-311-10/+74
| | | | | | | | | | | | | | | Also fix a bug in relocation; even for -Xnorelocate we need to relocate second and later extension if it's not compiled against all previous boot image components. Also clean up InternTable includes. Test: New tests in image_space_test. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: aosp_taimen-userdebug boots. Bug: 152037801 Change-Id: Ie6ae70721f4ffb48950bd248ffa123dee460bcd7
* Host gtests: Use the apex boot image instead of core.art.David Srbecky2020-03-261-5/+5
| | | | | | | | Closely mirror the behaviour of target tests. Test: m test-art-host-gtest Bug: 147817558 Change-Id: If9a1d34cef022fa93c9c09c8f31adc26ac71afdc
* Remove MIPS support from runtime/.Vladimir Marko2020-02-141-6/+1
| | | | | | | | Test: aosp_taimen-userdebug boots. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 147346243 Change-Id: If1fc8be94caa69f734438d7a1f4c715addfd8876
* Introduce BaseDexClassLoader.computeClassLoaderContextsNativeDan Zimmerman2020-02-081-12/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | This will be used to compute the contexts that should be sent over to the dex load reporter. See associated changes in libcore & frameworks/base. Motivation: At the moment of committing there are two classloader context encoders- one in ART and one in the package manager. The duplicate logic is susceptible to divergences. For example at the moment if a package uses shared libraries and has secondary dex files then the context encoded for secondary dex files will be incorrect[1]. In order to eliminate this bug and future possible bugs lets centralize where all classloader context computation is done. [1]: The context will be incorrect because it doesn't take into account the shared libraries that are loaded at runtime. Test: m test-art-host-gtest-class_loader_context_test Test: m test-art-host-gtest Test: ./test/testrunner/testrunner.py --host -b Test: Introduced a set of tests for the new API(s) Test: See tests in associated libcore & framework/base commits Bug: 148494302 Change-Id: Id39293a2e1d3d05194f2864f4febb3e652bce075
* Device gtests: Use boot.art instead of core.art.David Srbecky2020-02-071-3/+87
| | | | | | | | | | | | | | | | | | | | | They are essentially the same. We can use boot.art to run gtests since it is already part of the apex, including the jar files. This will make it easier to run the tests in atest, since we will not have to worry about copying core.art to the device. The long-term goal is to avoid generating core.art altogether. Couple of tests also require "alternate" image which has no compiled code. The tests now generate it on-demand in code. The host gtests still use core.art for now (as there is no boot.art on host). The plan is to add it in future CLs. Test: m test-art-host-gtest Test: ./art/tools/run-gtests.sh Bug: 147817606 Change-Id: I3a750bb8e60eea0b4a7df1491285feffd5a0161c
* Update Transaction for boot image extension.Vladimir Marko2019-07-291-0/+37
| | | | | | | | | | | And clean up transaction-related code to keep test code out of the production binaries. Test: Add TransactionTest#Constraints to transaction_test. Test: m test-art-host-gtest Test: testrunner.py --host Test: aosp_taimen-userdebug boots. Change-Id: Iefe5f1cfde95f564069249148f9e7d71564d7a10
* ART: Ensure SlowDebug is enabled in all gtestsAndreas Gampe2019-06-261-0/+2
| | | | | | | This was missed when moving to common_art_test. Test: m test-art-gtest Change-Id: I0ff50983cf71bd86b32350222caac2a36a72ad4b
* ART: Remove superfluous loggingAndreas Gampe2019-06-041-1/+0
| | | | | | | Remove unnecessary logging used for debugging. Test: m test-art-host-gtest Change-Id: I271c9c10eea728d9e534a96d981cac095c6e2e8e
* ObjPtr<>-ify StackTraceElement and ClassLoader.Vladimir Marko2019-04-011-1/+1
| | | | | | | Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 31113334 Change-Id: I457eeda55bbfb905dd2de0abd68451ab42ef9c1f
* Support InMemoryDexClassLoader in ClassLoaderContextDavid Brazdil2019-03-221-0/+7
| | | | | | | | | | | | | | Add new class loader tag IMC to class loader context spec which represents InMemoryDexClassLoader. A special case is required to not attempt to open its dex files as the dex location does not correspond to a real file path. This is achieved by setting load-attempted variable to 'true' when encountering IMC whilst parsing a spec. Context with IMC can still have opened dex files if it was created from an existing class loader. Bug: 72131483 Test: m test-art-host-gtest-class_loader_context_text Change-Id: Ic64065819018a1e56dee0f65405d26beb8fd7bbd
* Make jni_internal_test a CommonRuntimeTest.Vladimir Marko2019-02-201-0/+7
| | | | | | | Also clean up proxy_test and reflection_test. Test: m test-art-host-gtest Change-Id: I7530855a40d7b9f7214ea7a069508ae1361b2b42
* Remove unused ICU4C headers in libartbase-art-gtest and libart-runtime-gtestVictor Chang2018-12-051-1/+0
| | | | | | Bug: 117094880 Test: m libartbase-art-gtest libart-runtime-gtest Change-Id: Iff46ce8ac9f12fb0021ae453624efe84df20a56a
* Merge "Reduce core image to core-{oj,libart,simple}."Vladimir Marko2018-12-031-6/+38
|\
| * Reduce core image to core-{oj,libart,simple}.Vladimir Marko2018-11-301-6/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And pass the -Xbootclasspath: and -Xbootclasspath-locations: options to tests. This eliminates a discrepancy between the image and boot class path (BCP). Next CL shall check the BCP stored in the primary boot image oat file against the BCP from the runtime. Use actual *-hostdex.jar/*-testdex.jar files for compiling the core.art. Since conscrypt, okhttp and bouncycastle have the dex files actually stripped from their *-testdex.jar, they are unsuitable for compilation, adding another reason to not include them in the core image. For consistency, use the same jars for core image on host. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: Pixel 3 XL boots. Test: m test-art-target-gtest Test: testrunner.py --target --optimizing Bug: 119868597 Change-Id: Iccc152ea0d5b3bd9878aa214cc649762f8f4ea9c
* | Revert^2 "Support shared libraries in CreateContextFromClassLoader."Nicolas Geoffray2018-11-301-4/+8
|/ | | | | | | | | | | This reverts commit 1717a493a4a0c1c3b69ecfcb58838627b4c75878. bug: 120036590 bug: 120031686 Reason for revert: Fix code to ensure ownership of dex files. Change-Id: I99fffb52b73e0a41d779a41605ddf2e9249c02e0
* Merge "Revert "Support shared libraries in CreateContextFromClassLoader.""Nicolas Geoffray2018-11-301-8/+4
|\
| * Revert "Support shared libraries in CreateContextFromClassLoader."Nicolas Geoffray2018-11-301-8/+4
| | | | | | | | | | | | | | | | | | | | | | This reverts commit a66d69e884b6f9f41a8da31e6d27b498984c7fa3. bug: 120036590 bug: 120031686 Reason for revert: Fails libcore Change-Id: I6bec17b1e6c0d767c10b44572ca5f8d73c5fc37e
* | Merge "C++17 compatibility: make WITH_TIDY=1 happy again."Elliott Hughes2018-11-291-1/+1
|\ \ | |/ |/|
| * C++17 compatibility: make WITH_TIDY=1 happy again.Elliott Hughes2018-11-291-1/+1
| | | | | | | | | | | | Bug: http://b/111067277 Test: builds Change-Id: I8b69ea3815e14bb6eb27f40c0dd01a85b340a355
* | Support shared libraries in CreateContextFromClassLoader.Nicolas Geoffray2018-11-291-4/+8
|/ | | | | | | | | Missed this method in my previous set of shared libraries support. bug: 120036590 bug: 120031686 Test: test.py, app startup with speed-profile Change-Id: I5c1ec567cfa5452a1f510a3279a9e15125f429ba
* ART: Add class-alloc-inl.hAndreas Gampe2018-10-261-0/+1
| | | | | | | | | | In an effort to reduce the (transitive) proliferation of heap-inl add a specific inline header for class instance allocation. Bug: 118385392 Test: mmma art Test: m test-art-host Change-Id: I32529f0221a836452c58687330a91ac0d5fde162
* ART: Add object-array-alloc-inl.hAndreas Gampe2018-10-261-0/+1
| | | | | | | | | | In an effort to reduce the (transitive) proliferation of heap-inl add a specific inline header for object array allocation. Bug: 118385392 Test: mmma art Test: m test-art-host Change-Id: I0d7c40ed53708d4c759190961b40f0cac3fe696d
* ART: Dump proc/maps on mem_map_test failureAndreas Gampe2018-10-251-14/+23
| | | | | | | | | | On any fatal failure, also dump the process maps to the log. Implemented through a gtest TestListener. Bug: 118408378 Test: m test-art-host Test: manual (add always-fail ASSERT) Change-Id: I05b1f19680f8ab020aea89e7429757833e307fd5
* Revert^2 "Delay init of classes of pre-allocated exceptions."Vladimir Marko2018-06-271-1/+1
| | | | | | | | | | | | | | | This reverts commit 29cf32bb64dc61c4f755661939630775bd36419d. Fixed heap-poisoning/gcstress tests by calling the Alloc<>() of the exception object with kInstrumented=true. Change-Id: I209ab4f020e9c6fb67319fddde69ed87e3653223 Test: m test-art-host-gtest Test: testrunner.py --host Test: Pixel 2 XL boots. Test: run_build_test_target.py art-gtest-heap-poisoning Test: run_build_test_target.py art-interpreter-gcstress Bug: 109925024
* Revert "Delay init of classes of pre-allocated exceptions."Lokesh Gidra2018-06-261-1/+1
| | | | | | | | This reverts commit cd5c181baa6f919c1156a7b640b99056baf124d5. Reason for revert: To fix build breakage Change-Id: I4ee1a28d3aeb630975ea60ae5606fc92bc5c4652
* Delay init of classes of pre-allocated exceptions.Vladimir Marko2018-06-261-1/+1
| | | | | | | | | | | Support non-trivial Throwable.<clinit>() used by upstream OpenJDK. Test: m test-art-host-gtest Test: testrunner.py --host Test: Pixel 2 XL boots. Bug: 109925024 Change-Id: I7ad732a6fd267319de16d8a003e80d1d26f5e7cc
* ART: Move JNI files to runtime/jni/ .Vladimir Marko2018-05-091-2/+2
| | | | | Test: Rely on TreeHugger. Change-Id: I9cae11191ef1567ae9453be498882a7767285140
* Add CommonArtTestDavid Sehr2018-05-011-358/+3
| | | | | | | | Add a test framework that does not start up a Runtime object. Bug: 78651010 Test: make -j 40 test-art-host Change-Id: I6c8af384af5fe1289c6cf137635e94934ac3795d
* Move profile dependent modules to libartbaseDavid Sehr2018-04-131-1/+1
| | | | | | | | | | | Move mem_map and zip_archive to libartbase. This should be the last two remaining modules that profile_compilation_info is dependent upon. Bug: 22322814 Test: make -j 50 checkbuild make and boot a device Change-Id: I136ee23e426aa8ec7441e3d3f1978f1bebf4b562
* Merge "Move most of runtime/base to libartbase/base"David Sehr2018-03-061-1/+3
|\
| * Move most of runtime/base to libartbase/baseDavid Sehr2018-03-051-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Enforce the layering that code in runtime/base should not depend on runtime by separating it into libartbase. Some of the code in runtime/base depends on the Runtime class, so it cannot be moved yet. Also, some of the tests depend on CommonRuntimeTest, which itself needs to be factored (in a subsequent CL). Bug: 22322814 Test: make -j 50 checkbuild make -j 50 test-art-host Change-Id: I8b096c1e2542f829eb456b4b057c71421b77d7e2
* | ART: Refactor known-classloader visitsAndreas Gampe2018-03-011-46/+12
|/ | | | | | | | Refactor visiting dex Elements and DexFiles in known classloaders, unifying the walking code. Test: m test-art-host Change-Id: I4203ac4fbb0ee68660aadc0dfbf8affacbc03b8b
* Header library to remove dependence on runtime/David Sehr2018-02-281-1/+1
| | | | | | | | | | | | Add a new header library to remove libdexfile and others' dependence on runtime (typically runtime/base) includes in libdexfile. Also a small step to tease dexlayout and profman away from relying on these as well. Bug: 22322814 Test: make -j 50 checkbuild make -j 50 test-art-host-gtest Change-Id: I38e2fe399a75f4bc6318c77a71954c00ea73ec2b
* Make libdexfile tests independent of runtimeDavid Sehr2018-02-061-68/+0
| | | | | | | | | Remove dependencies on common_runtime_test and related so that libdexfile's tests can be run independently of the runtime directory. Bug: 22322814 Test: make -j 50 test-art-host-gtest Change-Id: If306c1995e87cbfc944e11fb13c927bc287014ad
* Create an ART-independent DexFileLoaderDavid Sehr2018-01-121-6/+9
| | | | | | | | | | | Opening DEX files should not rely on instantiating a runtime or having a large number of dependencies on runtime components. This CL makes DexFileLoader a stub class that is independent of ART, and introduces a subclass ArtDexFileLoader that contains the current implementations. Bug: 22322814 Test: make -j 50 test-art-host Change-Id: Ia6e92ae93c347057ea0c10455525239cbbe42c03
* Create dex subdirectoryDavid Sehr2018-01-051-2/+2
| | | | | | | | | Move all the DexFile related source to a common subdirectory dex/ of runtime. Bug: 71361973 Test: make -j 50 test-art-host Change-Id: I59e984ed660b93e0776556308be3d653722f5223
* ART: Move runtime-debug flags to own filesAndreas Gampe2017-12-071-0/+1
| | | | | | | To reduce the need for base/logging.h and separate out concerns. Test: m Change-Id: Ib373357325c6e622f608ada341594c3bea2fce2e
* cpplint: Remove many unnecessary NOLINTIgor Murashkin2017-11-161-4/+4
| | | | | | | | Now that we updated to upstream cpplint, a lot of these NOLINTs are no longer necessary. Bug: 68951293 Change-Id: If8ed5ffe89727f313f907a214b6d8fd2a2eddbad
* Merge changes Idaefe0af,Ib5c12d46,Ieb28085e,Idffbb7f2Treehugger Robot2017-11-021-1/+1
|\ | | | | | | | | | | | | | | * changes: ART: Clean up global includes - jni headers ART: Clean up global includes - zlib ART: Clean up global includes - lz4 ART: Clean up global includes - icu4c
| * ART: Clean up global includes - icu4cAndreas Gampe2017-11-011-1/+1
| | | | | | | | | | | | | | Remove icu4c from the ART-global includes. Test: mmma art Change-Id: Idffbb7f29af35d78e4f3aa09d1d3480153e151fa
* | ART: Make InstructionSet an enum class and add kLast.Vladimir Marko2017-11-021-8/+8
|/ | | | | | | | | | | | | | Adding InstructionSet::kLast shall make it easier to encode the InstructionSet in fewer bits using BitField<>. However, introducing `kLast` into the `art` namespace is not a good idea, so we change the InstructionSet to an enum class. This also uncovered a case of InstructionSet::kNone being erroneously used instead of vixl32::Condition::None(), so it's good to remove `kNone` from the `art` namespace. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: I6fa6168dfba4ed6da86d021a69c80224f09997a6
* Separate file utilities from utils.ccDavid Sehr2017-11-011-0/+1
| | | | | | | | Reduce the dependencies from utils.cc to arch/ subdirectories, etc. Bug: 22322814 Test: make test-art-host Change-Id: I4decd15ff4ec460735bfb58cebb1c6a1bf32b68f