| # 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") |
| |
| # Primary VMs host the test framework. |
| source_set("hftest_vm") { |
| sources = [ |
| "hftest.c", |
| "hftest.h", |
| ] |
| |
| deps = [ |
| "//src:common", |
| "//src:dlog", |
| "//src:fdt", |
| "//src:memiter", |
| "//src/arch/${arch}:entry", |
| "//src/arch/${arch}/vm:hf_call", |
| "//src/arch/${arch}/vm:shutdown", |
| "//src/arch/${arch}/vm:vm_entry", |
| ] |
| } |
| |
| # Secondary VMs can be used as part of a test in the primary. |
| source_set("secondary_vm") { |
| deps = [ |
| "//src:common", |
| "//src:dlog", |
| "//src/arch/${arch}:entry", |
| "//src/arch/${arch}/vm:hf_call", |
| "//src/arch/${arch}/vm:shutdown", |
| "//src/arch/${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 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", |
| ], |
| ] |
| } |