blob: 0ac7cdeaa5c7b1c701b9b0f8d40705daaeaa10f6 [file] [log] [blame]
# Copyright 2018 Google LLC
#
# 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
#
# https://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.
import("//build/image/image.gni")
import("//build/toolchain/platform.gni")
group("vm_tests") {
testonly = true
deps = [
":primary_only_test",
":primary_with_secondaries_test",
]
}
# Primary VMs host the test framework.
source_set("hftest_vm") {
testonly = true
sources = [
"hftest.c",
"hftest.h",
]
deps = [
"//src:common",
"//src:dlog",
"//src:fdt",
"//src:memiter",
"//src/arch/${plat_arch}:entry",
"//src/arch/${plat_arch}/vm:hf_call",
"//src/arch/${plat_arch}/vm:shutdown",
"//src/arch/${plat_arch}/vm:vm_entry",
]
}
# Secondary VMs can be used as part of a test in the primary.
source_set("secondary_vm") {
testonly = true
deps = [
"//src:common",
"//src:dlog",
"//src/arch/${plat_arch}:entry",
"//src/arch/${plat_arch}/vm:hf_call",
"//src/arch/${plat_arch}/vm:shutdown",
"//src/arch/${plat_arch}/vm:vm_entry",
]
}
# Tests with no secondary VMs.
vm_kernel("primary_only_test_vm") {
testonly = true
sources = [
"primary_only.c",
]
deps = [
":hftest_vm",
]
}
initrd("primary_only_test") {
testonly = true
primary_vm = ":primary_only_test_vm"
}
# Tests specific to GICv3.
vm_kernel("gicv3_test_vm") {
testonly = true
sources = [
"exceptions.S",
"gicv3.c",
"interrupts.c",
]
deps = [
":hftest_vm",
]
}
initrd("gicv3_test") {
testonly = true
primary_vm = ":gicv3_test_vm"
}
# Tests with secondary VMs.
vm_kernel("primary_with_secondaries_test_vm") {
testonly = true
sources = [
"primary_with_secondaries.c",
]
deps = [
":hftest_vm",
]
}
initrd("primary_with_secondaries_test") {
testonly = true
primary_vm = ":primary_with_secondaries_test_vm"
secondary_vms = [
[
"1048576",
"1",
"relay_a",
"//test/vm/secondaries:relay_a",
],
[
"1048576",
"1",
"relay_b",
"//test/vm/secondaries:relay_b",
],
[
"1048576",
"1",
"echo",
"//test/vm/secondaries:echo",
],
]
}