diff options
author | Brian Carlstrom <bdc@google.com> | 2011-03-01 23:59:06 -0800 |
---|---|---|
committer | Brian Carlstrom <bdc@google.com> | 2011-03-02 10:40:50 -0800 |
commit | 302e330bfcd86f54e43c0d4d73c3fadfc334240a (patch) | |
tree | df6b22af63ccb0fb55b004cf7a814631e0e47893 /JavaLibrary.mk | |
parent | 107c6ad54690baf284b1a1615300acdec0625cde (diff) | |
download | libcore-302e330bfcd86f54e43c0d4d73c3fadfc334240a.zip libcore-302e330bfcd86f54e43c0d4d73c3fadfc334240a.tar.gz libcore-302e330bfcd86f54e43c0d4d73c3fadfc334240a.tar.bz2 |
Removing cts dependency on AllTests for running core-tests
Summary:
- rewrote CollectAllTests to not depend on now deleted AllTests
- flattened core-tests into one static jar (enh)
- used static lib in cts build process
Details:
build
allow static libraries to contain resources
used by core-tests module
core/java_library.mk
collapse CTS_CORE_CASE_LIST to android.core.tests.libcore
change generate-core-test-description to take a jar of tests to run instead of an AllTests class name
move common options from callers of generate-core-test-description to its definition
updated classpath for running generate-core-test-description for libcore tests
core/tasks/cts.mk
cts
Restore temporarily disabled cts build
tests/core/Android.mk
Updated BUILD_CTSCORE_PACKAGE
- don't overwrite LOCAL_STATIC_JAVA_LIBRARIES, just append to it so we can use a static library to build android.core.tests.libcore
- clarify some comments
- change some @ to $(hide) to clarify operations in showcommands
- update rules now that input is a static library
tests/core/ctscore.mk
New android.core.tests.libcore built from static core-tests library
Note dummy file is necessary for build to process static library into an APK.
I first tried to change build to allow a package with only a static library
but it would require changing how static libraries are packed in to APK,
which right now is done at the time Java sources are compiled.
tests/core/libcore/Android.mk
tests/core/libcore/AndroidManifest.xml
tests/core/libcore/src/Dummy.java
Removing old core-tests packages
tests/core/dom/Android.mk
tests/core/dom/AndroidManifest.xml
tests/core/luni-io/Android.mk
tests/core/luni-io/AndroidManifest.xml
tests/core/luni-lang/Android.mk
tests/core/luni-lang/AndroidManifest.xml
tests/core/luni-net/Android.mk
tests/core/luni-net/AndroidManifest.xml
tests/core/luni-util/Android.mk
tests/core/luni-util/AndroidManifest.xml
tests/core/xml/Android.mk
tests/core/xml/AndroidManifest.xml
Rewrite of logic in CollectAllTests for finding tests to run.
Previously it acted as a JUnit TestRunner for a specific TestSuite,
with the runner modified to do no-op runs just to collect the names of tests.
Now it takes a jar file argument and walks the entries looking for TestCase
classes and then walking the methods to find the tests.
tools/utils/CollectAllTests.java
libcore
fix all-test-java-files-under to work like all-main-java-files-under (to support multiple directories)
flatten separate core-tests-* into core-tests
make core-tests a static Java library, avoiding dex overhead (which will only now be done when building CTS packages)
remove old RI core-tests.jar build which seems obsolete given our use of vogar
removd core-tests-supportlib since core-tests can now be used in its place
JavaLibrary.mk
frameworks/base
Change tracking move from core-tests-supportlib to core-tests
core/tests/coretests/Android.mk
Change-Id: Id5d965dd96d257544ce27a1e0fcde65901e9c573
Diffstat (limited to 'JavaLibrary.mk')
-rw-r--r-- | JavaLibrary.mk | 124 |
1 files changed, 5 insertions, 119 deletions
diff --git a/JavaLibrary.mk b/JavaLibrary.mk index b12690a..83ad202 100644 --- a/JavaLibrary.mk +++ b/JavaLibrary.mk @@ -42,7 +42,7 @@ $(foreach dir,$(1),$(patsubst ./%,%,$(shell cd $(LOCAL_PATH) && find $(dir)/src/ endef define all-test-java-files-under -$(patsubst ./%,%,$(shell cd $(LOCAL_PATH) && find $(1)/src/test/java -name "*.java" 2> /dev/null)) +$(foreach dir,$(1),$(patsubst ./%,%,$(shell cd $(LOCAL_PATH) && find $(dir)/src/test/java -name "*.java" 2> /dev/null))) endef define all-core-resource-dirs @@ -110,8 +110,7 @@ LOCAL_MODULE_TAGS := tests LOCAL_MODULE := core-junitrunner include $(BUILD_JAVA_LIBRARY) -# Definitions to make the sqlite JDBC driver. - +# Make the sqlite JDBC driver. include $(CLEAR_VARS) LOCAL_SRC_FILES := $(call all-main-java-files-under,sqlite-jdbc) LOCAL_NO_STANDARD_LIBRARIES := true @@ -121,109 +120,18 @@ LOCAL_MODULE_TAGS := optional LOCAL_MODULE := sqlite-jdbc include $(BUILD_JAVA_LIBRARY) - -# Definitions to make the core-tests libraries. -# -# We make a library per module, because otherwise the .jar files get too -# large, to the point that dx(1) can't cope (and the build is -# ridiculously slow). -# -# TODO: vogar will make this nonsense obsolete. - -include $(CLEAR_VARS) -LOCAL_SRC_FILES := $(call all-test-java-files-under,dalvik) -LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) -LOCAL_NO_STANDARD_LIBRARIES := true -LOCAL_JAVA_LIBRARIES := core core-junit core-junitrunner core-tests-support -LOCAL_DX_FLAGS := --core-library -LOCAL_JAVACFLAGS := $(local_javac_flags) -LOCAL_MODULE_TAGS := tests -LOCAL_MODULE := core-tests-dalvik -include $(BUILD_JAVA_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_SRC_FILES := $(call all-test-java-files-under,dom) -LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) -LOCAL_NO_STANDARD_LIBRARIES := true -LOCAL_JAVA_LIBRARIES := core core-junit core-junitrunner core-tests-support -LOCAL_DX_FLAGS := --core-library -LOCAL_JAVACFLAGS := $(local_javac_flags) -LOCAL_MODULE_TAGS := tests -LOCAL_MODULE := core-tests-dom -include $(BUILD_JAVA_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_SRC_FILES := $(call all-test-java-files-under,json) -LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) -LOCAL_NO_STANDARD_LIBRARIES := true -LOCAL_JAVA_LIBRARIES := core core-junit core-junitrunner core-tests-support -LOCAL_DX_FLAGS := --core-library -LOCAL_JAVACFLAGS := $(local_javac_flags) -LOCAL_MODULE_TAGS := tests -LOCAL_MODULE := core-tests-json -include $(BUILD_JAVA_LIBRARY) - +# Make the core-tests library. include $(CLEAR_VARS) -LOCAL_SRC_FILES := $(call all-test-java-files-under,luni) +LOCAL_SRC_FILES := $(call all-test-java-files-under,dalvik dom json luni support xml) LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) LOCAL_NO_STANDARD_LIBRARIES := true -# This module contains the top-level "tests.AllTests" that ties everything -# together, so it has compile-time dependencies on all the other test -# libraries. -# TODO: we should have a bogus module that just contains tests.AllTests for speed. -LOCAL_JAVA_LIBRARIES := \ - bouncycastle \ - core \ - core-junit \ - core-junitrunner \ - core-tests-support \ - core-tests-dalvik \ - core-tests-dom \ - core-tests-json \ - core-tests-xml \ - sqlite-jdbc +LOCAL_JAVA_LIBRARIES := bouncycastle core core-junit core-junitrunner sqlite-jdbc LOCAL_DX_FLAGS := --core-library LOCAL_JAVACFLAGS := $(local_javac_flags) LOCAL_MODULE_TAGS := tests LOCAL_MODULE := core-tests - LOCAL_NO_EMMA_INSTRUMENT := true LOCAL_NO_EMMA_COMPILE := true - -include $(BUILD_JAVA_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_SRC_FILES := $(call all-test-java-files-under,support) -LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) -LOCAL_NO_STANDARD_LIBRARIES := true -LOCAL_JAVA_LIBRARIES := bouncycastle core core-junit core-junitrunner -LOCAL_DX_FLAGS := --core-library -LOCAL_JAVACFLAGS := $(local_javac_flags) -LOCAL_MODULE_TAGS := tests -LOCAL_MODULE := core-tests-support -include $(BUILD_JAVA_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_SRC_FILES := $(call all-test-java-files-under,xml) -LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) -LOCAL_NO_STANDARD_LIBRARIES := true -LOCAL_JAVA_LIBRARIES := core core-junit core-junitrunner core-tests-support -LOCAL_DX_FLAGS := --core-library -LOCAL_JAVACFLAGS := $(local_javac_flags) -LOCAL_MODULE_TAGS := tests -LOCAL_MODULE := core-tests-xml -include $(BUILD_JAVA_LIBRARY) - -# also build support as a static library for use by frameworks/base HTTPS tests -include $(CLEAR_VARS) -LOCAL_SRC_FILES := $(call all-test-java-files-under,support) -LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) -LOCAL_NO_STANDARD_LIBRARIES := true -LOCAL_JAVA_LIBRARIES := bouncycastle core core-junit core-junitrunner -LOCAL_DX_FLAGS := --core-library -LOCAL_JAVACFLAGS := $(local_javac_flags) -LOCAL_MODULE_TAGS := tests -LOCAL_MODULE := core-tests-supportlib include $(BUILD_STATIC_JAVA_LIBRARY) # This one's tricky. One of our tests needs to have a @@ -240,28 +148,6 @@ $(TMP_RESOURCE_DIR)$(TMP_RESOURCE_FILE): $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_EXTRA_JAR_ARGS := $(extra_jar_args) -C $(TMP_RESOURCE_DIR) $(TMP_RESOURCE_FILE) $(LOCAL_INTERMEDIATE_TARGETS): $(TMP_RESOURCE_DIR)$(TMP_RESOURCE_FILE) -# Definitions for building a version of the core-tests.jar -# that is suitable for execution on the RI. This JAR would -# be better located in $HOST_OUT_JAVA_LIBRARIES, but it is -# not possible to refer to that from a shell script (the -# variable is not exported from envsetup.sh). There is also -# some trickery involved: we need to include some classes -# that reside in core.jar, but since we cannot incldue the -# whole core.jar in the RI classpath, we copy those classses -# over to our new file. -HOST_CORE_JAR := $(HOST_COMMON_OUT_ROOT)/core-tests.jar - -$(HOST_CORE_JAR): PRIVATE_LOCAL_BUILT_MODULE := $(LOCAL_BUILT_MODULE) -$(HOST_CORE_JAR): PRIVATE_CORE_INTERMEDIATES := $(core-intermediates) -$(HOST_CORE_JAR): $(LOCAL_BUILT_MODULE) - @rm -rf $(dir $<)/hostctsclasses - $(call unzip-jar-files,$(dir $<)classes.jar,$(dir $<)hostctsclasses) - @unzip -qx -o $(PRIVATE_CORE_INTERMEDIATES)/classes.jar dalvik/annotation/* -d $(dir $<)hostctsclasses - @cp $< $@ - @jar uf $@ -C $(dir $<)hostctsclasses . - -$(LOCAL_INSTALLED_MODULE): $(HOST_CORE_JAR) - # # Build for the host. |