blob: 2ef36b37b5c5c8bdf3e7496a21bcda8be29c69c2 [file] [log] [blame] [edit]
// Copyright (C) 2018 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.
package {
default_applicable_licenses: ["Android-Apache-2.0"],
default_team: "trendy_team_art_mainline",
}
java_library {
name: "cts-vmtests-dot",
libs: ["junit"],
srcs: ["src/dot/**/*.java"],
installable: false,
include_srcs: true,
host_supported: true,
errorprone: {
javacflags: [
"-Xep:IdentityBinaryExpression:WARN",
"-Xep:BadShiftAmount:WARN",
"-Xep:UnusedMethod:WARN",
"-Xep:UnusedVariable:WARN",
],
},
}
java_binary_host {
name: "vmtests-buildutil",
static_libs: [
"cts-vmtests-dot",
"junit",
],
srcs: [
"build/src/util/build/BuildCTSHostSources.java",
"build/src/util/build/BuildCTSMainsSources.java",
"build/src/util/build/BuildUtilBase.java",
"build/src/util/build/FileUtil.java",
"build/src/util/build/JUnitTestCollector.java",
],
wrapper: "etc/vmtests-buildutil.sh",
}
java_genrule_host {
name: "vmtests_generated_host_test_sources",
tools: [
"vmtests-buildutil",
"soong_zip",
],
cmd: "$(location vmtests-buildutil) util.build.BuildCTSHostSources $(genDir) " +
" && $(location soong_zip) -jar -o $(out) -C $(genDir) -D $(genDir)/dot",
out: ["vmtests.host.generated.srcjar"],
}
java_library_host {
name: "host-cts-vmtests",
libs: [
"junit",
"tradefed",
],
srcs: [":vmtests_generated_host_test_sources"],
installable: false,
}
java_genrule_host {
name: "vmtests-dfh-dex-generated",
tools: [
"cfassembler",
"soong_zip",
],
tool_files: ["etc/vmtests-cfassembler.sh"],
srcs: ["src/dot/**/*.dfh"],
cmd: "$(location etc/vmtests-cfassembler.sh) $(location cfassembler) $(location soong_zip) $(genDir) $(out) $(in)",
out: ["vmtests_dfh_dex_generated.jar"],
}
java_genrule {
name: "vmtests_generated_mains_test_sources",
tools: [
"vmtests-buildutil",
"soong_zip",
],
cmd: "mkdir $(genDir)/src" +
" && $(location vmtests-buildutil) util.build.BuildCTSMainsSources $(genDir)/src " +
" && $(location soong_zip) -jar -o $(out) -C $(genDir)/src -D $(genDir)/src",
out: ["vmtests.mains.generated.srcjar"],
}
java_library {
name: "vmtests-mains",
installable: true,
libs: ["cts-vmtests-dot"],
srcs: [":vmtests_generated_mains_test_sources"],
}
// TODO: Add vmtests-mains' dex jar to vmtests-generated-resources when
// it can be addressed.
java_library_host {
name: "vmtests-generated-resources",
static_libs: [
"host-cts-vmtests",
"vmtests-dfh-dex-generated",
],
installable: false,
}
java_library_host {
name: "cts-tf-dalvik-buildutil",
srcs: [
"build/src/**/*.java",
"src/**/*.java",
],
libs: [
"junit",
"jsr305",
"d8",
"android-smali",
],
errorprone: {
javacflags: [
"-Xep:IdentityBinaryExpression:WARN",
"-Xep:BadShiftAmount:WARN",
],
},
}
java_genrule_host {
name: "vm-tests-tf-lib",
tools: [
"soong_zip",
"d8",
],
srcs: [
"src/**/*",
":cts-tf-dalvik-buildutil",
":vmtests-generated-resources",
":cts-vmtests-dot",
":junit",
":d8",
":android-smali",
],
device_common_srcs: [
":vmtests-mains",
],
cmd: "echo Generating BuildDalvikSuite tests" +
" && mkdir -p $(genDir)/classes" +
" && unzip -bq $(location :cts-tf-dalvik-buildutil) -d $(genDir)/classes" +
" && mkdir -p $(genDir)/tests" +
" && java" +
" -cp $(location :cts-tf-dalvik-buildutil):$(location :junit):$(location :d8):$(location :android-smali):$(location :cts-vmtests-dot)" +
" util.build.BuildDalvikSuite" +
" cts/tools/vm-tests-tf/src" +
" $(genDir)/tests" +
" $(genDir)/classes" +
" && echo Generating dexcore tests" +
" && $(location soong_zip) -jar -o $(genDir)/tests/dot/junit/dexcore.jar-class.jar" +
" -C $(genDir)/classes" +
" -f $(genDir)/classes/dot/junit/DxUtil.class" +
" -f $(genDir)/classes/dot/junit/DxAbstractMain.class" +
" -f $(genDir)/classes/dot/junit/AssertionFailedException.class" +
" && mkdir -p $(genDir)/dexcore" +
" && $(location d8) -JXms16M -JXmx2048M" +
" --output $(genDir)/dexcore" +
" $(genDir)/tests/dot/junit/dexcore.jar-class.jar" +
" && $(location soong_zip) -jar -o $(genDir)/tests/dot/junit/dexcore.jar" +
" -C $(genDir)/dexcore" +
" -D $(genDir)/dexcore" +
" && echo Combining tests" +
" && mkdir -p $(genDir)/out" +
" && unzip -bq $(location :vmtests-generated-resources) -d $(genDir)/generated-resources" +
" && cp $(location :vmtests-mains) $(genDir)/mains.jar" +
" && $(location soong_zip) -o $(out)" +
" -C $(genDir)/generated-resources" +
" -D $(genDir)/generated-resources" +
" -C $(genDir)" +
" -D $(genDir)/tests" +
" -j -P tests -f $(genDir)/mains.jar",
out: ["vm-tests-tf-lib.jar"],
}
java_test_host {
name: "vm-tests-tf",
static_libs: [
"compatibility-host-vm-targetprep",
"vm-tests-tf-lib",
],
test_config: "AndroidTest.xml",
test_suites: [
"cts",
"general-tests",
],
}