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