Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d04c00a4 authored by Yi Jin's avatar Yi Jin Committed by Android (Google) Code Review
Browse files

Merge "Add AndroidTest.xml to incident_helper and incidentd"

parents 243c392c 5e4ce2c9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ cc_binary {

cc_test {
    name: "incident_helper_test",
    test_suites: ["device-tests"],
    defaults: ["incident_helper_defaults"],
    local_include_dirs: ["src/"],

+27 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 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.
-->
<configuration description="Config for incident_helper_test">
    <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
        <option name="cleanup" value="true" />
        <option name="push" value="incident_helper_test->/data/nativetest/incident_helper_test" />
        <option name="push" value="testdata->/data/nativetest/testdata" />
    </target_preparer>
    <option name="test-suite-tag" value="apct" />
    <test class="com.android.tradefed.testtype.GTest" >
        <option name="native-test-device-path" value="/data/nativetest" />
        <option name="module-name" value="incident_helper_test" />
    </test>
</configuration>
+1 −9
Original line number Diff line number Diff line
@@ -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)
+27 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 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.
-->
<configuration description="Config for incidentd_test">
    <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
        <option name="cleanup" value="true" />
        <option name="push" value="incidentd_test->/data/nativetest/incidentd_test" />
        <option name="push" value="testdata->/data/nativetest/testdata" />
    </target_preparer>
    <option name="test-suite-tag" value="apct" />
    <test class="com.android.tradefed.testtype.GTest" >
        <option name="native-test-device-path" value="/data/nativetest" />
        <option name="module-name" value="incidentd_test" />
    </test>
</configuration>
+10 −4
Original line number Diff line number Diff line
@@ -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