forked from aosp-mirror/platform_development
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_defs.xsd
More file actions
141 lines (113 loc) · 5.59 KB
/
Copy pathtest_defs.xsd
File metadata and controls
141 lines (113 loc) · 5.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 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.
-->
<!-- Contains the schema definition for Android test definitions xml -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://schemas.android.com/testrunner/test_defs/1.0"
xmlns="http://schemas.android.com/testrunner/test_defs/1.0"
elementFormDefault="qualified">
<xs:element name="test-definitions">
<xs:complexType>
<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="test" type="javaTestType" />
<xs:element name="test-native" type="nativeTestType" />
<xs:element name="test-host" type="hostTestType" />
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Generic, abstract test definition. Contains attributes common to all
test types. -->
<xs:complexType name="testType">
<!-- Self-descriptive name used to uniquely identify the test. -->
<xs:attribute name="name" type="xs:string" use="required" />
<!-- File system path, relative to Android build root, to this
package's Android.mk file.-->
<xs:attribute name="build_path" type="xs:string" use="required" />
<!-- Include test in continuous test system. -->
<xs:attribute name="continuous" type="xs:boolean" use="optional"
default="false" />
<!-- Include test as part of named suite. -->
<xs:attribute name="suite" type="xs:string" use="optional" />
<!-- Short description (typically less than 60 characters) about this
test. -->
<xs:attribute name="description" type="xs:string" use="optional" />
<!-- Specifies that a full 'make', as opposed to 'mmm' command, is
needed to build this test. The build command used will be
'make extra_build_args' -->
<xs:attribute name="full_make" type="xs:boolean"
use="optional" />
<!-- Extra arguments to append to build command when building this
test. -->
<xs:attribute name="extra_build_args" type="xs:string"
use="optional" />
</xs:complexType>
<!-- Java on device instrumentation test.
The test attributes map to the following commands:
(if class is defined)
adb shell am instrument -w <package>/<runner>
(else)
adb shell am instrument -w -e class <class> <package>/<runner>
-->
<xs:complexType name="javaTestType">
<xs:complexContent>
<xs:extension base="testType">
<!-- Android application package that contains the tests. -->
<xs:attribute name="package" type="xs:string" use="required" />
<!-- Fully qualified Java test class to run. -->
<xs:attribute name="class" type="xs:string" use="optional" />
<!-- Fully qualified InstrumentationTestRunner to execute. -->
<xs:attribute name="runner" type="xs:string" use="optional"
default="android.test.InstrumentationTestRunner" />
<!-- Build name of Android package this test targets. These
targets are defined in the coverage_targets.xml file. Used as
basis for code coverage metrics. If omitted, code coverage will
not be supported for this test. -->
<xs:attribute name="coverage_target" type="xs:string"
use="optional" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- Native (C/C++) on device tests.
The native test attributes map to the following commands:
make <build_path>/Android.mk <extra_build_args>
adb sync
for test_prog in <tests built>; do
adb shell "/system/bin/${test_prog} >/dev/null 2>&1;echo \$?"
adb shell "rm /system/bin/${test_prog}"
done
-->
<xs:complexType name="nativeTestType">
<xs:complexContent>
<xs:extension base="testType" />
<!-- no additional attributes -->
</xs:complexContent>
</xs:complexType>
<!-- Host java tests.
Uses hosttestlib to execute tests on host. Maps to following command:
java -cp <libs>:jar_name com.android.hosttest.DeviceTestRunner \
<class> -s <device serial> -p <app build path>
-->
<xs:complexType name="hostTestType">
<xs:complexContent>
<xs:extension base="testType">
<!-- The test class to run. Must extend DeviceTestSuite, and
implement a public static suite() method that returns a Test to
run. -->
<xs:attribute name="class" type="xs:string" use="required" />
<!-- built jar name of host library that includes the tests. -->
<xs:attribute name="jar_name" type="xs:string" use="required" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>