| # Copyright 2018 The Hafnium Authors. |
| # |
| # 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/toolchain/platform.gni") |
| |
| config("hftest_config") { |
| include_dirs = [ "inc" ] |
| } |
| |
| # Testing framework for a primary VM. |
| source_set("hftest_primary_vm") { |
| testonly = true |
| |
| public_configs = [ ":hftest_config" ] |
| |
| deps = [ |
| ":hftest_standalone", |
| "//src/arch/${plat_arch}/hftest:hf_call", |
| ] |
| } |
| |
| # Testing framework for a secondary VM. It's currently just a slave VM and |
| # can't affect the tests directly. |
| source_set("hftest_secondary_vm") { |
| testonly = true |
| |
| public_configs = [ ":hftest_config" ] |
| |
| sources = [ |
| "service.c", |
| ] |
| |
| deps = [ |
| ":mm", |
| ":power_mgmt", |
| "//src:dlog", |
| "//src:memiter", |
| "//src:panic", |
| "//src:std", |
| "//src/arch/${plat_arch}:entry", |
| "//src/arch/${plat_arch}/hftest:entry", |
| "//src/arch/${plat_arch}/hftest:hf_call", |
| "//src/arch/${plat_arch}/hftest:power_mgmt", |
| ] |
| } |
| |
| # Testing framework for a hypervisor. |
| source_set("hftest_hypervisor") { |
| testonly = true |
| public_configs = [ ":hftest_config" ] |
| deps = [ |
| ":hftest_standalone", |
| ] |
| } |
| |
| # Testing framework for tests running under Linux in the primary VM. |
| source_set("hftest_linux") { |
| testonly = true |
| public_configs = [ ":hftest_config" ] |
| |
| sources = [ |
| "linux_main.c", |
| ] |
| |
| deps = [ |
| ":common", |
| "//src:dlog", |
| "//src:memiter", |
| "//src/arch/${plat_arch}/hftest:power_mgmt", |
| ] |
| } |
| |
| source_set("hftest_standalone") { |
| visibility = [ ":*" ] |
| testonly = true |
| |
| public_configs = [ ":hftest_config" ] |
| |
| sources = [ |
| "standalone_main.c", |
| ] |
| |
| deps = [ |
| ":common", |
| ":mm", |
| ":power_mgmt", |
| "//src:dlog", |
| "//src:fdt", |
| "//src:memiter", |
| "//src/arch/${plat_arch}:entry", |
| "//src/arch/${plat_arch}/hftest:entry", |
| "//src/arch/${plat_arch}/hftest:power_mgmt", |
| ] |
| } |
| |
| # Common code for hftest, whether it is running under Linux, under Hafnium in |
| # the primary VM, or directly on the hardware. |
| source_set("common") { |
| visibility = [ ":*" ] |
| testonly = true |
| public_configs = [ ":hftest_config" ] |
| sources = [ |
| "common.c", |
| ] |
| deps = [ |
| "//src:fdt_handler", |
| "//src:memiter", |
| "//src:panic", |
| "//src:std", |
| ] |
| } |
| |
| source_set("mm") { |
| testonly = true |
| |
| public_configs = [ ":hftest_config" ] |
| |
| sources = [ |
| "mm.c", |
| ] |
| |
| deps = [ |
| "//src:layout", |
| "//src:mm", |
| "//src/arch/${plat_arch}:arch", |
| "//src/arch/${plat_arch}/hftest:mm", |
| ] |
| } |
| |
| source_set("power_mgmt") { |
| testonly = true |
| |
| public_configs = [ ":hftest_config" ] |
| |
| sources = [ |
| "power_mgmt.c", |
| ] |
| |
| deps = [ |
| ":mm", |
| "//src/arch/${plat_arch}/hftest:power_mgmt", |
| ] |
| } |