From 5e4ce2c9410b130133bb8f9268077ca0f398693e Mon Sep 17 00:00:00 2001 From: Yi Jin Date: Mon, 13 Nov 2017 21:06:26 -0800 Subject: [PATCH] Add AndroidTest.xml to incident_helper and incidentd This change depends on fix of b/69802886: https://android-review.googlesource.com/#/c/platform/build/+/555203/ Bug: 65754586 Test: atest incident_helper_test && atest incidentd_test Change-Id: I64d793c8abe4381114e5b38fa12d085b1d808cd1 --- cmds/incident_helper/Android.bp | 1 + cmds/incident_helper/AndroidTest.xml | 27 +++++++++++++++++++++++++++ cmds/incidentd/Android.mk | 10 +--------- cmds/incidentd/AndroidTest.xml | 27 +++++++++++++++++++++++++++ cmds/incidentd/README.md | 14 ++++++++++---- 5 files changed, 66 insertions(+), 13 deletions(-) create mode 100644 cmds/incident_helper/AndroidTest.xml create mode 100644 cmds/incidentd/AndroidTest.xml diff --git a/cmds/incident_helper/Android.bp b/cmds/incident_helper/Android.bp index 2ef037143f07d..fc0bdccb268b2 100644 --- a/cmds/incident_helper/Android.bp +++ b/cmds/incident_helper/Android.bp @@ -38,6 +38,7 @@ cc_binary { cc_test { name: "incident_helper_test", + test_suites: ["device-tests"], defaults: ["incident_helper_defaults"], local_include_dirs: ["src/"], diff --git a/cmds/incident_helper/AndroidTest.xml b/cmds/incident_helper/AndroidTest.xml new file mode 100644 index 0000000000000..6d242bcf435a7 --- /dev/null +++ b/cmds/incident_helper/AndroidTest.xml @@ -0,0 +1,27 @@ + + + + + + diff --git a/cmds/incidentd/Android.mk b/cmds/incidentd/Android.mk index cb5fd02ef30b2..fb8ef6338d909 100644 --- a/cmds/incidentd/Android.mk +++ b/cmds/incidentd/Android.mk @@ -120,14 +120,6 @@ LOCAL_SHARED_LIBRARIES := \ libservices \ libutils \ -relative_path_prefix := nativetest64/incidentd_test -testdata_files := $(call find-subdir-files, testdata/*) - -GEN := $(addprefix $(TARGET_OUT_DATA)/$(relative_path_prefix)/, $(testdata_files)) -$(GEN): PRIVATE_PATH := $(LOCAL_PATH) -$(GEN): PRIVATE_CUSTOM_TOOL = cp $< $@ -$(GEN): $(TARGET_OUT_DATA)/$(relative_path_prefix)/testdata/% : $(LOCAL_PATH)/testdata/% - $(transform-generated-source) -LOCAL_GENERATED_SOURCES += $(GEN) +LOCAL_TEST_DATA := $(call find-test-data-in-subdirs, $(LOCAL_PATH), *, testdata) include $(BUILD_NATIVE_TEST) diff --git a/cmds/incidentd/AndroidTest.xml b/cmds/incidentd/AndroidTest.xml new file mode 100644 index 0000000000000..7f0e4ee305e3e --- /dev/null +++ b/cmds/incidentd/AndroidTest.xml @@ -0,0 +1,27 @@ + + + + + + diff --git a/cmds/incidentd/README.md b/cmds/incidentd/README.md index daa39248e3f8f..ad0fa08c7326e 100644 --- a/cmds/incidentd/README.md +++ b/cmds/incidentd/README.md @@ -5,13 +5,19 @@ For the first time, build the test and create an empty directly on device: ``` -root$ make -j incidentd_test && adb shell mkdir /data/nativetest64/incidentd_test +root$ make -j incidentd_test && adb shell mkdir /data/nativetest/incidentd_test ``` -Run the test on a device +Run the test on a device manually ``` root$ mmm -j frameworks/base/cmds/incidentd && \ -adb push $OUT/data/nativetest64/incidentd_test/* /data/nativetest64/incidentd_test/ && \ -adb shell /data/nativetest64/incidentd_test/incidentd_test 2>/dev/null +adb push $OUT/data/nativetest/incidentd_test/* /data/nativetest/incidentd_test/ && \ +adb shell /data/nativetest/incidentd_test/incidentd_test 2>/dev/null ``` + +Run the test via AndroidTest.xml + +``` +root$ atest incidentd_test +``` \ No newline at end of file