blob: b4273bd2f8433ea9e4f2f5e54956c7c4533b746c [file] [log] [blame]
Brian Muramatsu5df641c2011-12-28 15:46:57 -08001# Copyright (C) 2011 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15LOCAL_PATH := $(call my-dir)
16
17# CTS build rules that are needed to generate the corresponding XML
18# for a test package. CTS needs these XML files to know what tests
19# to run as well as detect which ones were not executed.
20#
21# 1. Replace the regular build command with the CTS variant:
22#
23# BUILD_EXECUTABLE -> BUILD_CTS_EXECUTABLE
24# BUILD_PACKAGE -> BUILD_CTS_PACKAGE
25# BUILD_HOST_JAVA_LIBRARY -> BUILD_HOST_JAVA_LIBRARY
26#
27# 2. Define LOCAL_CTS_TEST_PACKAGE if you are using
28# BUILD_EXECUTABLE or BUILD_HOST_JAVA_LIBRARY.
29#
30BUILD_CTS_EXECUTABLE := $(LOCAL_PATH)/tools/build/test_executable.mk
31BUILD_CTS_PACKAGE := $(LOCAL_PATH)/tools/build/test_package.mk
32BUILD_CTS_HOST_JAVA_LIBRARY := $(LOCAL_PATH)/tools/build/test_host_java_library.mk
33
34# Test XMLs, native executables, and packages will be placed in this
35# directory before creating the final CTS distribution.
36CTS_TESTCASES_OUT := $(HOST_OUT)/cts-testcases
37
38# Scanners of source files for tests which are then inputed into
39# the XML generator to produce test XMLs.
40CTS_NATIVE_TEST_SCANNER := $(HOST_OUT_EXECUTABLES)/cts-native-scanner
41CTS_JAVA_TEST_SCANNER := $(HOST_OUT_EXECUTABLES)/cts-java-scanner
42CTS_JAVA_TEST_SCANNER_DOCLET := $(HOST_OUT_JAVA_LIBRARIES)/cts-java-scanner-doclet.jar
43
44# Generator of test XMLs from scanner output.
45CTS_XML_GENERATOR := $(HOST_OUT_EXECUTABLES)/cts-xml-generator
46
47# File indicating which tests should be blacklisted due to problems.
48CTS_EXPECTATIONS := cts/tests/expectations/knownfailures.txt
49
50# Functions to get the paths of the build outputs.
51
52define cts-get-lib-paths
53 $(foreach lib,$(1),$(HOST_OUT_JAVA_LIBRARIES)/$(lib).jar)
54endef
55
56define cts-get-native-paths
57 $(foreach exe,$(1),$(call intermediates-dir-for,EXECUTABLES,$(exe))/$(exe))
58endef
59
60define cts-get-package-paths
61 $(foreach pkg,$(1),$(CTS_TESTCASES_OUT)/$(pkg).apk)
62endef
63
64define cts-get-test-xmls
65 $(foreach name,$(1),$(CTS_TESTCASES_OUT)/$(name).xml)
66endef