blob: 57ea45115e63a7f40c14674d72195f67eb46bd56 [file] [log] [blame]
Andrew Walbranbc342d42019-02-05 16:56:02 +00001# Copyright 2019 The Hafnium Authors.
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# https://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
15import("//build/image/image.gni")
16
17executable("test_binary") {
18 testonly = true
19 sources = [
20 "linux.c",
21 ]
22 deps = [
23 "//test/hftest:hftest_linux",
24 ]
25 output_name = "test_binary"
26}
27
28linux_initrd("linux_test_initrd") {
29 testonly = true
David Brazdil3f509e02019-07-01 12:42:25 +010030
31 # Always use the aarch64_linux_clang toolchain to build test_binary
32 test_binary_target = ":test_binary(//build/toolchain:aarch64_linux_clang)"
Andrew Walbranbc342d42019-02-05 16:56:02 +000033 sources = [
David Brazdil3f509e02019-07-01 12:42:25 +010034 get_label_info(test_binary_target, "root_out_dir") + "/test_binary",
35 get_label_info("//driver:linux", "target_out_dir") + "/hafnium.ko",
Andrew Walbranbc342d42019-02-05 16:56:02 +000036 ]
37 deps = [
Andrew Walbranbc342d42019-02-05 16:56:02 +000038 "//driver:linux",
David Brazdil3f509e02019-07-01 12:42:25 +010039 test_binary_target,
Andrew Walbranbc342d42019-02-05 16:56:02 +000040 ]
41}
42
43initrd("linux_test") {
44 testonly = true
45
46 primary_vm_prebuilt = "//prebuilts/linux-aarch64/linux/vmlinuz"
47 primary_initrd = ":linux_test_initrd"
48}
49
50group("linux") {
51 testonly = true
52
53 deps = [
54 ":linux_test",
55 ]
56}