Revert "Remove test_per_src from ART tests."
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
diff --git a/build/Android.gtest.mk b/build/Android.gtest.mk
index 1002cab..ab9d594 100644
--- a/build/Android.gtest.mk
+++ b/build/Android.gtest.mk
@@ -501,7 +501,6 @@
gtest_exe := $(2)
# Dependencies for all host gtests.
gtest_deps := $$(ART_HOST_DEX_DEPENDENCIES) \
- $$(ART_TEST_HOST_GTEST_DEPENDENCIES) \
$$(HOST_BOOT_IMAGE_JARS) \
$$($(3)ART_HOST_OUT_SHARED_LIBRARIES)/libicu_jni$$(ART_HOST_SHLIB_EXTENSION) \
$$($(3)ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$$(ART_HOST_SHLIB_EXTENSION) \
@@ -533,20 +532,20 @@
gtest_deps += $$($(3)HOST_BOOT_IMAGE)
endif
+ ART_TEST_HOST_GTEST_DEPENDENCIES += $$(gtest_deps)
+
.PHONY: $$(gtest_rule)
$$(gtest_rule): $$(gtest_output)
# Re-run the tests, even if nothing changed. Until the build system has a dedicated "no cache"
# option, claim to write a file that is never produced.
$$(gtest_output): .KATI_IMPLICIT_OUTPUTS := $$(gtest_output)-nocache
-# Limit concurrent runs. Each test itself is already highly parallel (and thus memory hungry).
-$$(gtest_output): .KATI_NINJA_POOL := highmem_pool
$$(gtest_output): NAME := $$(gtest_rule)
ifeq (,$(SANITIZE_HOST))
$$(gtest_output): $$(gtest_exe) $$(gtest_deps)
$(hide) ($$(call ART_TEST_SKIP,$$(NAME)) && \
timeout --foreground -k 120s 2400s $(HOST_OUT_EXECUTABLES)/signal_dumper -s 15 \
- $$< --gtest_output=xml:$$@ --deadline_threshold_ms=600000 && \
+ $$< --gtest_output=xml:$$@ && \
$$(call ART_TEST_PASSED,$$(NAME))) || $$(call ART_TEST_FAILED,$$(NAME))
else
# Note: envsetup currently exports ASAN_OPTIONS=detect_leaks=0 to suppress leak detection, as some
@@ -580,40 +579,6 @@
gtest_suffix :=
endef # define-art-gtest-rule-host
-# Global list of all dependencies. All tests depend on all tools.
-# Removal of test_per_src broke the naming convention for dependencies,
-# so the fine-grained dependencies no longer work for now.
-# TODO: Move all dependency tracking to the blueprint file.
-ART_GTEST_ALL_DEX_DEPS := \
- EmptyUncompressed \
- EmptyUncompressedAligned \
- LinkageTest \
- MainStripped \
- MainUncompressedAligned \
- MultiDexUncompressedAligned \
- VerifierDeps \
- VerifierDepsMulti \
- VerifySoftFailDuringClinit \
- $(foreach dir,$(GTEST_DEX_DIRECTORIES),$(dir))
-ART_TEST_HOST_GTEST_DEPENDENCIES += \
- $(HOST_OUT_EXECUTABLES)/dex2oatd \
- $(HOST_OUT_EXECUTABLES)/dex2oatds \
- $(HOST_OUT_EXECUTABLES)/dexanalyze \
- $(HOST_OUT_EXECUTABLES)/dexdiag \
- $(HOST_OUT_EXECUTABLES)/dexdump \
- $(HOST_OUT_EXECUTABLES)/dexlayoutd \
- $(HOST_OUT_EXECUTABLES)/dexlist \
- $(HOST_OUT_EXECUTABLES)/dexoptanalyzerd \
- $(HOST_OUT_EXECUTABLES)/hiddenapid \
- $(HOST_OUT_EXECUTABLES)/imgdiagd \
- $(HOST_OUT_EXECUTABLES)/oatdumpd \
- $(HOST_OUT_EXECUTABLES)/oatdumpds \
- $(HOST_OUT_EXECUTABLES)/profmand \
- $(foreach file,$(ART_GTEST_ALL_DEX_DEPS),$(ART_TEST_HOST_GTEST_$(file)_DEX))
-ART_TEST_TARGET_GTEST_DEPENDENCIES += \
- $(TESTING_ART_APEX) \
- $(foreach file,$(ART_GTEST_ALL_DEX_DEPS),$(ART_TEST_TARGET_GTEST_$(file)_DEX))
-
# Add the additional dependencies for the specified test
# $(1): test name
define add-art-gtest-dependencies
diff --git a/build/apex/art_apex_test.py b/build/apex/art_apex_test.py
index b97ac23..aa95eb7 100755
--- a/build/apex/art_apex_test.py
+++ b/build/apex/art_apex_test.py
@@ -728,27 +728,246 @@
return 'Testing (Target) Checker'
def run(self):
- # Check ART test binaries.
- self._checker.check_art_test_executable('art_cmdline_tests')
- self._checker.check_art_test_executable('art_compiler_tests')
- self._checker.check_art_test_executable('art_dex2oat_tests')
- self._checker.check_art_test_executable('art_dexanalyze_tests')
- self._checker.check_art_test_executable('art_dexdiag_tests')
- self._checker.check_art_test_executable('art_dexdump_tests')
- self._checker.check_art_test_executable('art_dexlayout_tests')
- self._checker.check_art_test_executable('art_dexlist_tests')
- self._checker.check_art_test_executable('art_dexoptanalyzer_tests')
- self._checker.check_art_test_executable('art_imgdiag_tests')
- self._checker.check_art_test_executable('art_libartbase_tests')
- self._checker.check_art_test_executable('art_libartpalette_tests')
+ # Check cmdline tests.
+ self._checker.check_optional_art_test_executable('cmdline_parser_test')
+
+ # Check compiler tests.
+ self._checker.check_art_test_executable('atomic_dex_ref_map_test')
+ self._checker.check_art_test_executable('bounds_check_elimination_test')
+ self._checker.check_art_test_executable('codegen_test')
+ self._checker.check_art_test_executable('compiled_method_storage_test')
+ self._checker.check_art_test_executable('data_type_test')
+ self._checker.check_art_test_executable('dedupe_set_test')
+ self._checker.check_art_test_executable('dominator_test')
+ self._checker.check_art_test_executable('dwarf_test')
+ self._checker.check_art_test_executable('exception_test')
+ self._checker.check_art_test_executable('find_loops_test')
+ self._checker.check_art_test_executable('graph_checker_test')
+ self._checker.check_art_test_executable('graph_test')
+ self._checker.check_art_test_executable('gvn_test')
+ self._checker.check_art_test_executable('induction_var_analysis_test')
+ self._checker.check_art_test_executable('induction_var_range_test')
+ self._checker.check_art_test_executable('jni_cfi_test')
+ self._checker.check_art_test_executable('jni_compiler_test')
+ self._checker.check_art_test_executable('licm_test')
+ self._checker.check_art_test_executable('linker_patch_test')
+ self._checker.check_art_test_executable('live_interval_test')
+ self._checker.check_art_test_executable('load_store_analysis_test')
+ self._checker.check_art_test_executable('load_store_elimination_test')
+ self._checker.check_art_test_executable('loop_optimization_test')
+ self._checker.check_art_test_executable('nodes_test')
+ self._checker.check_art_test_executable('nodes_vector_test')
+ self._checker.check_art_test_executable('optimizing_cfi_test')
+ self._checker.check_art_test_executable('output_stream_test')
+ self._checker.check_art_test_executable('parallel_move_test')
+ self._checker.check_art_test_executable('pretty_printer_test')
+ self._checker.check_art_test_executable('reference_type_propagation_test')
+ self._checker.check_art_test_executable('scheduler_test')
+ self._checker.check_art_test_executable('select_generator_test')
+ self._checker.check_art_test_executable('side_effects_test')
+ self._checker.check_art_test_executable('src_map_elem_test')
+ self._checker.check_art_test_executable('ssa_liveness_analysis_test')
+ self._checker.check_art_test_executable('ssa_test')
+ self._checker.check_art_test_executable('stack_map_test')
+ self._checker.check_art_test_executable('superblock_cloner_test')
+ self._checker.check_art_test_executable('suspend_check_test')
+ self._checker.check_art_test_executable('swap_space_test')
+ # These tests depend on a specific code generator and are conditionally included.
+ self._checker.check_optional_art_test_executable('constant_folding_test')
+ self._checker.check_optional_art_test_executable('dead_code_elimination_test')
+ self._checker.check_optional_art_test_executable('linearize_test')
+ self._checker.check_optional_art_test_executable('live_ranges_test')
+ self._checker.check_optional_art_test_executable('liveness_test')
+ self._checker.check_optional_art_test_executable('managed_register_arm64_test')
+ self._checker.check_optional_art_test_executable('managed_register_arm_test')
+ self._checker.check_optional_art_test_executable('managed_register_x86_64_test')
+ self._checker.check_optional_art_test_executable('managed_register_x86_test')
+ self._checker.check_optional_art_test_executable('register_allocator_test')
+
+ # Check dex2oat tests.
+ self._checker.check_art_test_executable('compiler_driver_test')
+ self._checker.check_art_test_executable('dex2oat_image_test')
+ self._checker.check_art_test_executable('dex2oat_test')
+ self._checker.check_art_test_executable('dex_to_dex_decompiler_test')
+ self._checker.check_art_test_executable('elf_writer_test')
+ self._checker.check_art_test_executable('image_test')
+ self._checker.check_art_test_executable('image_write_read_test')
+ self._checker.check_art_test_executable('index_bss_mapping_encoder_test')
+ self._checker.check_art_test_executable('multi_oat_relative_patcher_test')
+ self._checker.check_art_test_executable('oat_writer_test')
+ self._checker.check_art_test_executable('verifier_deps_test')
+ # These tests depend on a specific code generator and are conditionally included.
+ self._checker.check_optional_art_test_executable('relative_patcher_arm64_test')
+ self._checker.check_optional_art_test_executable('relative_patcher_thumb2_test')
+ self._checker.check_optional_art_test_executable('relative_patcher_x86_64_test')
+ self._checker.check_optional_art_test_executable('relative_patcher_x86_test')
+
+ # Check dexanalyze tests.
+ self._checker.check_optional_art_test_executable('dexanalyze_test')
+
+ # Check dexdiag tests.
+ self._checker.check_optional_art_test_executable('dexdiag_test')
+
+ # Check dexdump tests.
+ self._checker.check_art_test_executable('dexdump_test')
+
+ # Check dexlayout tests.
+ self._checker.check_optional_art_test_executable('dexlayout_test')
+
+ # Check dexlist tests.
+ self._checker.check_art_test_executable('dexlist_test')
+
+ # Check dexoptanalyzer tests.
+ self._checker.check_art_test_executable('dexoptanalyzer_test')
+
+ # Check imgdiag tests.
+ self._checker.check_art_test_executable('imgdiag_test')
+
+ # Check libartbase tests.
+ self._checker.check_art_test_executable('arena_allocator_test')
+ self._checker.check_art_test_executable('bit_field_test')
+ self._checker.check_art_test_executable('bit_memory_region_test')
+ self._checker.check_art_test_executable('bit_string_test')
+ self._checker.check_art_test_executable('bit_struct_test')
+ self._checker.check_art_test_executable('bit_table_test')
+ self._checker.check_art_test_executable('bit_utils_test')
+ self._checker.check_art_test_executable('bit_vector_test')
+ self._checker.check_art_test_executable('fd_file_test')
+ self._checker.check_art_test_executable('file_utils_test')
+ self._checker.check_art_test_executable('hash_set_test')
+ self._checker.check_art_test_executable('hex_dump_test')
+ self._checker.check_art_test_executable('histogram_test')
+ self._checker.check_art_test_executable('indenter_test')
+ self._checker.check_art_test_executable('instruction_set_test')
+ self._checker.check_art_test_executable('intrusive_forward_list_test')
+ self._checker.check_art_test_executable('leb128_test')
+ self._checker.check_art_test_executable('logging_test')
+ self._checker.check_art_test_executable('mem_map_test')
+ self._checker.check_art_test_executable('membarrier_test')
+ self._checker.check_art_test_executable('memfd_test')
+ self._checker.check_art_test_executable('memory_region_test')
+ self._checker.check_art_test_executable('safe_copy_test')
+ self._checker.check_art_test_executable('scoped_flock_test')
+ self._checker.check_art_test_executable('time_utils_test')
+ self._checker.check_art_test_executable('transform_array_ref_test')
+ self._checker.check_art_test_executable('transform_iterator_test')
+ self._checker.check_art_test_executable('utils_test')
+ self._checker.check_art_test_executable('variant_map_test')
+ self._checker.check_art_test_executable('zip_archive_test')
+
+ # Check libartpalette tests.
+ self._checker.check_art_test_executable('palette_test')
+
+ # Check libdexfile tests.
+ self._checker.check_art_test_executable('art_dex_file_loader_test')
self._checker.check_art_test_executable('art_libdexfile_support_tests')
- self._checker.check_art_test_executable('art_libdexfile_tests')
- self._checker.check_art_test_executable('art_libprofile_tests')
- self._checker.check_art_test_executable('art_oatdump_tests')
- self._checker.check_art_test_executable('art_profman_tests')
- self._checker.check_art_test_executable('art_runtime_compiler_tests')
- self._checker.check_art_test_executable('art_runtime_tests')
- self._checker.check_art_test_executable('art_sigchain_tests')
+ self._checker.check_art_test_executable('class_accessor_test')
+ self._checker.check_art_test_executable('code_item_accessors_test')
+ self._checker.check_art_test_executable('compact_dex_file_test')
+ self._checker.check_art_test_executable('compact_offset_table_test')
+ self._checker.check_art_test_executable('descriptors_names_test')
+ self._checker.check_art_test_executable('dex_file_loader_test')
+ self._checker.check_art_test_executable('dex_file_verifier_test')
+ self._checker.check_art_test_executable('dex_instruction_test')
+ self._checker.check_art_test_executable('primitive_test')
+ self._checker.check_art_test_executable('string_reference_test')
+ self._checker.check_art_test_executable('test_dex_file_builder_test')
+ self._checker.check_art_test_executable('type_lookup_table_test')
+ self._checker.check_art_test_executable('utf_test')
+
+ # Check libprofile tests.
+ self._checker.check_optional_art_test_executable('profile_boot_info_test')
+ self._checker.check_optional_art_test_executable('profile_compilation_info_test')
+
+ # Check oatdump tests.
+ self._checker.check_art_test_executable('oatdump_app_test')
+ self._checker.check_art_test_executable('oatdump_image_test')
+ self._checker.check_art_test_executable('oatdump_test')
+
+ # Check profman tests.
+ self._checker.check_art_test_executable('profile_assistant_test')
+
+ # Check runtime compiler tests.
+ self._checker.check_art_test_executable('module_exclusion_test')
+ self._checker.check_art_test_executable('reflection_test')
+
+ # Check runtime tests.
+ self._checker.check_art_test_executable('arch_test')
+ self._checker.check_art_test_executable('barrier_test')
+ self._checker.check_art_test_executable('card_table_test')
+ self._checker.check_art_test_executable('cha_test')
+ self._checker.check_art_test_executable('class_linker_test')
+ self._checker.check_art_test_executable('class_loader_context_test')
+ self._checker.check_art_test_executable('class_table_test')
+ self._checker.check_art_test_executable('compiler_filter_test')
+ self._checker.check_art_test_executable('dex_cache_test')
+ self._checker.check_art_test_executable('dlmalloc_space_random_test')
+ self._checker.check_art_test_executable('dlmalloc_space_static_test')
+ self._checker.check_art_test_executable('entrypoints_order_test')
+ self._checker.check_art_test_executable('exec_utils_test')
+ self._checker.check_art_test_executable('gtest_test')
+ self._checker.check_art_test_executable('handle_scope_test')
+ self._checker.check_art_test_executable('heap_test')
+ self._checker.check_art_test_executable('heap_verification_test')
+ self._checker.check_art_test_executable('hidden_api_test')
+ self._checker.check_art_test_executable('image_space_test')
+ self._checker.check_art_test_executable('immune_spaces_test')
+ self._checker.check_art_test_executable('imtable_test')
+ self._checker.check_art_test_executable('indirect_reference_table_test')
+ self._checker.check_art_test_executable('instruction_set_features_arm64_test')
+ self._checker.check_art_test_executable('instruction_set_features_arm_test')
+ self._checker.check_art_test_executable('instruction_set_features_test')
+ self._checker.check_art_test_executable('instruction_set_features_x86_64_test')
+ self._checker.check_art_test_executable('instruction_set_features_x86_test')
+ self._checker.check_art_test_executable('instrumentation_test')
+ self._checker.check_art_test_executable('intern_table_test')
+ self._checker.check_art_test_executable('java_vm_ext_test')
+ self._checker.check_art_test_executable('jit_memory_region_test')
+ self._checker.check_art_test_executable('jni_internal_test')
+ self._checker.check_art_test_executable('large_object_space_test')
+ self._checker.check_art_test_executable('math_entrypoints_test')
+ self._checker.check_art_test_executable('memcmp16_test')
+ self._checker.check_art_test_executable('method_handles_test')
+ self._checker.check_art_test_executable('method_type_test')
+ self._checker.check_art_test_executable('method_verifier_test')
+ self._checker.check_art_test_executable('mod_union_table_test')
+ self._checker.check_art_test_executable('monitor_pool_test')
+ self._checker.check_art_test_executable('monitor_test')
+ self._checker.check_art_test_executable('mutex_test')
+ self._checker.check_art_test_executable('oat_file_assistant_test')
+ self._checker.check_art_test_executable('oat_file_test')
+ self._checker.check_art_test_executable('object_test')
+ self._checker.check_art_test_executable('parsed_options_test')
+ self._checker.check_art_test_executable('prebuilt_tools_test')
+ self._checker.check_art_test_executable('profiling_info_test')
+ self._checker.check_art_test_executable('profile_saver_test')
+ self._checker.check_art_test_executable('proxy_test')
+ self._checker.check_art_test_executable('quick_trampoline_entrypoints_test')
+ self._checker.check_art_test_executable('reference_queue_test')
+ self._checker.check_art_test_executable('reference_table_test')
+ self._checker.check_art_test_executable('reg_type_test')
+ self._checker.check_art_test_executable('rosalloc_space_random_test')
+ self._checker.check_art_test_executable('rosalloc_space_static_test')
+ self._checker.check_art_test_executable('runtime_callbacks_test')
+ self._checker.check_art_test_executable('runtime_test')
+ self._checker.check_art_test_executable('safe_math_test')
+ self._checker.check_art_test_executable('space_bitmap_test')
+ self._checker.check_art_test_executable('space_create_test')
+ self._checker.check_art_test_executable('stub_test')
+ self._checker.check_art_test_executable('subtype_check_info_test')
+ self._checker.check_art_test_executable('subtype_check_test')
+ self._checker.check_art_test_executable('system_weak_test')
+ self._checker.check_art_test_executable('task_processor_test')
+ self._checker.check_art_test_executable('thread_pool_test')
+ self._checker.check_art_test_executable('timing_logger_test')
+ self._checker.check_art_test_executable('transaction_test')
+ self._checker.check_art_test_executable('two_runtimes_test')
+ self._checker.check_art_test_executable('unstarted_runtime_test')
+ self._checker.check_art_test_executable('var_handle_test')
+ self._checker.check_art_test_executable('vdex_file_test')
+
+ # Check sigchainlib tests.
+ self._checker.check_art_test_executable('sigchain_test')
# Check ART test (internal) libraries.
self._checker.check_native_library('libart-gtest')
diff --git a/compiler/optimizing/codegen_test_utils.h b/compiler/optimizing/codegen_test_utils.h
index 9d15f1f..9fbd7d6 100644
--- a/compiler/optimizing/codegen_test_utils.h
+++ b/compiler/optimizing/codegen_test_utils.h
@@ -313,25 +313,25 @@
}
#ifdef ART_ENABLE_CODEGEN_arm
-inline CodeGenerator* create_codegen_arm_vixl32(HGraph* graph, const CompilerOptions& compiler_options) {
+CodeGenerator* create_codegen_arm_vixl32(HGraph* graph, const CompilerOptions& compiler_options) {
return new (graph->GetAllocator()) TestCodeGeneratorARMVIXL(graph, compiler_options);
}
#endif
#ifdef ART_ENABLE_CODEGEN_arm64
-inline CodeGenerator* create_codegen_arm64(HGraph* graph, const CompilerOptions& compiler_options) {
+CodeGenerator* create_codegen_arm64(HGraph* graph, const CompilerOptions& compiler_options) {
return new (graph->GetAllocator()) TestCodeGeneratorARM64(graph, compiler_options);
}
#endif
#ifdef ART_ENABLE_CODEGEN_x86
-inline CodeGenerator* create_codegen_x86(HGraph* graph, const CompilerOptions& compiler_options) {
+CodeGenerator* create_codegen_x86(HGraph* graph, const CompilerOptions& compiler_options) {
return new (graph->GetAllocator()) TestCodeGeneratorX86(graph, compiler_options);
}
#endif
#ifdef ART_ENABLE_CODEGEN_x86_64
-inline CodeGenerator* create_codegen_x86_64(HGraph* graph, const CompilerOptions& compiler_options) {
+CodeGenerator* create_codegen_x86_64(HGraph* graph, const CompilerOptions& compiler_options) {
return new (graph->GetAllocator()) x86_64::CodeGeneratorX86_64(graph, compiler_options);
}
#endif
diff --git a/compiler/optimizing/optimizing_unit_test.h b/compiler/optimizing/optimizing_unit_test.h
index 670f91c..eb262bc 100644
--- a/compiler/optimizing/optimizing_unit_test.h
+++ b/compiler/optimizing/optimizing_unit_test.h
@@ -56,11 +56,11 @@
#define FIVE_REGISTERS_CODE_ITEM(...) N_REGISTERS_CODE_ITEM(5, __VA_ARGS__)
#define SIX_REGISTERS_CODE_ITEM(...) N_REGISTERS_CODE_ITEM(6, __VA_ARGS__)
-inline LiveInterval* BuildInterval(const size_t ranges[][2],
- size_t number_of_ranges,
- ScopedArenaAllocator* allocator,
- int reg = -1,
- HInstruction* defined_by = nullptr) {
+LiveInterval* BuildInterval(const size_t ranges[][2],
+ size_t number_of_ranges,
+ ScopedArenaAllocator* allocator,
+ int reg = -1,
+ HInstruction* defined_by = nullptr) {
LiveInterval* interval =
LiveInterval::MakeInterval(allocator, DataType::Type::kInt32, defined_by);
if (defined_by != nullptr) {
@@ -73,7 +73,7 @@
return interval;
}
-inline void RemoveSuspendChecks(HGraph* graph) {
+void RemoveSuspendChecks(HGraph* graph) {
for (HBasicBlock* block : graph->GetBlocks()) {
if (block != nullptr) {
if (block->GetLoopInformation() != nullptr) {
diff --git a/libartbase/base/common_art_test.cc b/libartbase/base/common_art_test.cc
index 9c35dd4..5f3574d 100644
--- a/libartbase/base/common_art_test.cc
+++ b/libartbase/base/common_art_test.cc
@@ -462,8 +462,7 @@
std::string prefix = GetAndroidBuildTop();
for (std::string& location : result) {
CHECK_GT(location.size(), prefix.size());
- CHECK_EQ(location.compare(0u, prefix.size(), prefix), 0)
- << " prefix=" << prefix << " location=" << location;
+ CHECK_EQ(location.compare(0u, prefix.size(), prefix), 0);
location.erase(0u, prefix.size());
}
}
diff --git a/libartbase/base/utils_test.cc b/libartbase/base/utils_test.cc
index e24794b..631a225 100644
--- a/libartbase/base/utils_test.cc
+++ b/libartbase/base/utils_test.cc
@@ -108,7 +108,7 @@
}
TEST_F(UtilsTest, GetProcessStatus) {
- EXPECT_EQ("art_libartbase_", GetProcessStatus("Name"));
+ EXPECT_EQ("utils_test", GetProcessStatus("Name"));
EXPECT_EQ("R (running)", GetProcessStatus("State"));
EXPECT_EQ("<unknown>", GetProcessStatus("tate"));
EXPECT_EQ("<unknown>", GetProcessStatus("e"));
diff --git a/libartpalette/Android.bp b/libartpalette/Android.bp
index 775b7af..b4b2e0b 100644
--- a/libartpalette/Android.bp
+++ b/libartpalette/Android.bp
@@ -101,4 +101,5 @@
host_supported: true,
srcs: ["apex/palette_test.cc"],
shared_libs: ["libartpalette"],
+ test_per_src: true,
}
diff --git a/libdexfile/Android.bp b/libdexfile/Android.bp
index 359a144..fcfbef3 100644
--- a/libdexfile/Android.bp
+++ b/libdexfile/Android.bp
@@ -350,6 +350,7 @@
art_cc_test {
name: "art_libdexfile_external_tests",
host_supported: true,
+ test_per_src: true, // For consistency with other ART gtests.
test_suites: ["general-tests"],
srcs: [
"external/dex_file_ext_c_test.c",
@@ -386,8 +387,9 @@
],
}
-// The same source file is used in two tests here.
-// Its test target is test-art-{host,target}-gtest-art_libdexfile_support_tests.
+// The same source file is used in two tests here, so unlike other ART gtests it
+// doesn't use test_per_src. Its test target is
+// test-art-{host,target}-gtest-art_libdexfile_support_tests.
art_cc_test {
name: "art_libdexfile_support_tests",
defaults: [
@@ -454,8 +456,9 @@
],
}
-// The same source file is used in two tests here.
-// Its test target is test-art-{host,target}-gtest-art_libdexfile_support_static_tests.
+// The same source file is used in two tests here, so unlike other ART gtests it
+// doesn't use test_per_src. Its test target is
+// test-art-{host,target}-gtest-art_libdexfile_support_static_tests.
art_cc_test {
name: "art_libdexfile_support_static_tests",
host_supported: true,
diff --git a/libnativebridge/tests/Android.bp b/libnativebridge/tests/Android.bp
index fe70a06..50bf0ab 100644
--- a/libnativebridge/tests/Android.bp
+++ b/libnativebridge/tests/Android.bp
@@ -80,6 +80,7 @@
"art_defaults",
"art_test_defaults",
],
+ test_per_src: true,
// TODO(mast): Split up art_gtest_defaults so that it can be used for the
// following without pulling in lots of libs.
target: {
@@ -145,6 +146,7 @@
"art_defaults",
"art_test_defaults",
],
+ test_per_src: true,
// TODO(mast): Split up art_gtest_defaults so that it can be used for the
// following without pulling in lots of libs.
target: {
diff --git a/libnativeloader/test/Android.bp b/libnativeloader/test/Android.bp
index 60c9f3c..72e8c0f 100644
--- a/libnativeloader/test/Android.bp
+++ b/libnativeloader/test/Android.bp
@@ -77,6 +77,7 @@
"art_defaults",
"art_test_defaults",
],
+ test_per_src: true,
srcs: [
"api_test.c",
],
diff --git a/runtime/common_runtime_test.cc b/runtime/common_runtime_test.cc
index 090b2bd..a846346 100644
--- a/runtime/common_runtime_test.cc
+++ b/runtime/common_runtime_test.cc
@@ -48,7 +48,6 @@
#include "gc/space/image_space.h"
#include "gc_root-inl.h"
#include "gtest/gtest.h"
-#include "gtest_extras/IsolateMain.h"
#include "handle_scope-inl.h"
#include "interpreter/unstarted_runtime.h"
#include "jni/java_vm_ext.h"
@@ -659,7 +658,7 @@
void ArtTestGlobalInit() {
}
-int main(int argc, char** argv, char** envp) {
+int main(int argc, char **argv) {
// Gtests can be very noisy. For example, an executable with multiple tests will trigger native
// bridge warnings. The following line reduces the minimum log severity to ERROR and suppresses
// everything else. In case you want to see all messages, comment out the line.
@@ -669,6 +668,7 @@
art::InitLogging(argv, art::Runtime::Abort);
art::MemMap::Init();
LOG(INFO) << "Running main() from common_runtime_test.cc...";
+ testing::InitGoogleTest(&argc, argv);
ArtTestGlobalInit();
- return IsolateMain(argc, argv, envp);
+ return RUN_ALL_TESTS();
}
diff --git a/runtime/gc/space/dlmalloc_space_random_test.cc b/runtime/gc/space/dlmalloc_space_random_test.cc
index b653bcf..92b56bd 100644
--- a/runtime/gc/space/dlmalloc_space_random_test.cc
+++ b/runtime/gc/space/dlmalloc_space_random_test.cc
@@ -21,7 +21,6 @@
namespace art {
namespace gc {
namespace space {
-namespace {
MallocSpace* CreateDlMallocSpace(const std::string& name,
size_t initial_size,
@@ -33,7 +32,6 @@
TEST_SPACE_CREATE_FN_RANDOM(DlMallocSpace, CreateDlMallocSpace)
-} // namespace
} // namespace space
} // namespace gc
} // namespace art
diff --git a/runtime/gc/space/dlmalloc_space_static_test.cc b/runtime/gc/space/dlmalloc_space_static_test.cc
index 74dd765..550d1bb 100644
--- a/runtime/gc/space/dlmalloc_space_static_test.cc
+++ b/runtime/gc/space/dlmalloc_space_static_test.cc
@@ -21,7 +21,6 @@
namespace art {
namespace gc {
namespace space {
-namespace {
MallocSpace* CreateDlMallocSpace(const std::string& name,
size_t initial_size,
@@ -33,7 +32,6 @@
TEST_SPACE_CREATE_FN_STATIC(DlMallocSpace, CreateDlMallocSpace)
-} // namespace
} // namespace space
} // namespace gc
} // namespace art
diff --git a/runtime/gc/space/rosalloc_space_random_test.cc b/runtime/gc/space/rosalloc_space_random_test.cc
index 3010b77..f0b3231 100644
--- a/runtime/gc/space/rosalloc_space_random_test.cc
+++ b/runtime/gc/space/rosalloc_space_random_test.cc
@@ -21,7 +21,6 @@
namespace art {
namespace gc {
namespace space {
-namespace {
MallocSpace* CreateRosAllocSpace(const std::string& name,
size_t initial_size,
@@ -37,7 +36,6 @@
TEST_SPACE_CREATE_FN_RANDOM(RosAllocSpace, CreateRosAllocSpace)
-} // namespace
} // namespace space
} // namespace gc
} // namespace art
diff --git a/runtime/gc/space/rosalloc_space_static_test.cc b/runtime/gc/space/rosalloc_space_static_test.cc
index 860a461..d7e7e90 100644
--- a/runtime/gc/space/rosalloc_space_static_test.cc
+++ b/runtime/gc/space/rosalloc_space_static_test.cc
@@ -21,7 +21,6 @@
namespace art {
namespace gc {
namespace space {
-namespace {
MallocSpace* CreateRosAllocSpace(const std::string& name,
size_t initial_size,
@@ -36,7 +35,6 @@
TEST_SPACE_CREATE_FN_STATIC(RosAllocSpace, CreateRosAllocSpace)
-} // namespace
} // namespace space
} // namespace gc
} // namespace art
diff --git a/runtime/proxy_test.h b/runtime/proxy_test.h
index 266c0cf..bdd902f 100644
--- a/runtime/proxy_test.h
+++ b/runtime/proxy_test.h
@@ -33,11 +33,11 @@
// Generate a proxy class with the given name and interfaces. This is a simplification from what
// libcore does to fit to our test needs. We do not check for duplicated interfaces or methods and
// we do not declare exceptions.
-inline ObjPtr<mirror::Class> GenerateProxyClass(ScopedObjectAccess& soa,
- jobject jclass_loader,
- ClassLinker* class_linker,
- const char* className,
- const std::vector<Handle<mirror::Class>>& interfaces)
+ObjPtr<mirror::Class> GenerateProxyClass(ScopedObjectAccess& soa,
+ jobject jclass_loader,
+ ClassLinker* class_linker,
+ const char* className,
+ const std::vector<Handle<mirror::Class>>& interfaces)
REQUIRES_SHARED(Locks::mutator_lock_) {
StackHandleScope<1> hs(soa.Self());
Handle<mirror::Class> javaLangObject = hs.NewHandle(GetClassRoot<mirror::Object>());
diff --git a/test/Android.bp b/test/Android.bp
index 17f9822..43f1631 100644
--- a/test/Android.bp
+++ b/test/Android.bp
@@ -46,6 +46,7 @@
art_cc_defaults {
name: "art_gtest_defaults",
+ test_per_src: true,
// These really are gtests, but the gtest library comes from libart-gtest.so
gtest: false,
defaults: [
@@ -114,10 +115,9 @@
"libdexfiled",
"libprofiled",
"libartbased",
- "liblog",
],
static_libs: [
- "libgtest_isolated",
+ "libgtest",
],
target: {
android32: {
@@ -150,7 +150,7 @@
"libart-compiler-gtest",
"libart-runtime-gtest",
"libartbase-art-gtest",
- "libgtest_isolated",
+ "libgtest",
],
shared_libs: [
"libartd",
@@ -160,7 +160,6 @@
"libartbased",
"libbase",
"libbacktrace",
- "liblog",
],
target: {
darwin: {
diff --git a/tools/run-gtests.sh b/tools/run-gtests.sh
index 084218f..5a4ab3a 100755
--- a/tools/run-gtests.sh
+++ b/tools/run-gtests.sh
@@ -56,7 +56,7 @@
env ANDROID_ART_ROOT="$android_art_root" \
ANDROID_I18N_ROOT="$android_i18n_root" \
ANDROID_TZDATA_ROOT="$android_tzdata_root" \
- $t --deadline_threshold_ms=600000 \
+ $t \
|| failing_tests+=("$t")
done