OLD | NEW |
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 INCLUDES += -I./include \ | 5 INCLUDES += -I./include \ |
6 -I$(FWDIR)/lib/include \ | 6 -I$(FWDIR)/lib/include \ |
7 -I$(FWDIR)/lib/cgptlib/include \ | 7 -I$(FWDIR)/lib/cgptlib/include \ |
8 -I$(FWDIR)/lib/cryptolib/include \ | 8 -I$(FWDIR)/lib/cryptolib/include \ |
9 » » -I../host/include \ | 9 » » -I$(HOSTDIR)/include |
10 » » -I../misclibs/include \ | |
11 » » -I../vboot_firmware/lib/include\ | |
12 » » -I../vkernel/include | |
13 IMAGE_LIBS = $(BUILD)/vkernel/kernel_image.o \ | |
14 » » $(BUILD)/vkernel/kernel_image_fw.o | |
15 UTIL_LIBS = $(BUILD)/misclibs/file_keys.o $(BUILD)/misclibs/signature_digest.o | |
16 BUILD_ROOT = ${BUILD}/tests | 10 BUILD_ROOT = ${BUILD}/tests |
17 | 11 |
18 TEST_NAMES = big_kernel_tests \ | 12 TEST_NAMES = cgptlib_test \ |
19 » » cgptlib_test \ | |
20 » » kernel_image_tests \ | |
21 » » kernel_rollback_tests \ | |
22 » » kernel_splicing_tests \ | |
23 » » kernel_verify_benchmark \ | |
24 rsa_padding_test \ | 13 rsa_padding_test \ |
25 rsa_verify_benchmark \ | 14 rsa_verify_benchmark \ |
26 sha_benchmark \ | 15 sha_benchmark \ |
27 sha_tests \ | 16 sha_tests \ |
28 vboot_common_tests \ | 17 vboot_common_tests \ |
29 vboot_common2_tests \ | 18 vboot_common2_tests \ |
30 » » vboot_common3_tests \ | 19 » » vboot_common3_tests |
31 » » verify_kernel_fuzz_driver | |
32 TEST_BINS = $(addprefix ${BUILD_ROOT}/,$(TEST_NAMES)) | 20 TEST_BINS = $(addprefix ${BUILD_ROOT}/,$(TEST_NAMES)) |
33 | 21 |
34 TEST_LIB = ${BUILD_ROOT}/test.a | 22 TEST_LIB = ${BUILD_ROOT}/test.a |
35 TEST_LIB_SRCS = rollback_index_mock.c test_common.c timer_utils.c crc32_test.c | 23 TEST_LIB_SRCS = rollback_index_mock.c test_common.c timer_utils.c crc32_test.c |
36 TEST_LIB_OBJS = $(TEST_LIB_SRCS:%.c=${BUILD_ROOT}/%.o) | 24 TEST_LIB_OBJS = $(TEST_LIB_SRCS:%.c=${BUILD_ROOT}/%.o) |
37 ALL_DEPS = $(addsuffix .d,${TEST_BINS} ${TEST_LIB_OBJS}) | 25 ALL_DEPS = $(addsuffix .d,${TEST_BINS} ${TEST_LIB_OBJS}) |
38 CFLAGS += -MMD -MF $@.d | 26 CFLAGS += -MMD -MF $@.d |
39 | 27 |
40 LIBS := ${TEST_LIB} $(IMAGE_LIBS) $(UTIL_LIBS) $(HOSTLIB) $(FWLIB) | 28 LIBS := ${TEST_LIB} $(HOSTLIB) $(FWLIB) |
41 | 29 |
42 all: $(TEST_BINS) ${EXTRA_TARGET} | 30 all: $(TEST_BINS) ${EXTRA_TARGET} |
43 | 31 |
44 ${TEST_LIB}: ${TEST_LIB_OBJS} | 32 ${TEST_LIB}: ${TEST_LIB_OBJS} |
45 rm -f $@ | 33 rm -f $@ |
46 ar qc $@ $^ | 34 ar qc $@ $^ |
47 | 35 |
48 ${BUILD_ROOT}/%.o : %.c | 36 ${BUILD_ROOT}/%.o : %.c |
49 $(CC) $(CFLAGS) $(INCLUDES) -MMD -MF $@.d -c -o $@ $< | 37 $(CC) $(CFLAGS) $(INCLUDES) -MMD -MF $@.d -c -o $@ $< |
50 | 38 |
51 ${BUILD_ROOT}/%: %.c ${LIBS} | 39 ${BUILD_ROOT}/%: %.c ${LIBS} |
52 $(CC) $(CFLAGS) $(INCLUDES) $< ${LIBS} -o $@ -lcrypto -lrt | 40 $(CC) $(CFLAGS) $(INCLUDES) $< ${LIBS} -o $@ -lcrypto -lrt |
53 | 41 |
54 # TODO: port these tests to vboot_firmware, if not already eqivalent | 42 # TODO: port these tests to new API, if not already eqivalent |
55 # functionality | 43 # functionality in other tests |
| 44 # |
56 # big_firmware_tests | 45 # big_firmware_tests |
57 # firmware_image_tests | 46 # firmware_image_tests |
58 # firmware_rollback_tests | 47 # firmware_rollback_tests |
59 # firmware_splicing_tests | 48 # firmware_splicing_tests |
60 # firmware_verify_benchmark | 49 # firmware_verify_benchmark |
61 # verify_firmware_fuzz_driver | 50 # verify_firmware_fuzz_driver |
| 51 # |
| 52 # big_kernel_tests |
| 53 # kernel_image_tests |
| 54 # kernel_rollback_tests |
| 55 # kernel_splicing_tests |
| 56 # kernel_verify_benchmark |
| 57 # verify_kernel_fuzz_driver |
62 | 58 |
63 | 59 |
64 ifneq (${RUNTESTS},) | 60 ifneq (${RUNTESTS},) |
65 EXTRA_TARGET = runtests | 61 EXTRA_TARGET = runtests |
66 endif | 62 endif |
67 | 63 |
68 runtests: | 64 # Generate test keys |
| 65 genkeys: |
69 ./gen_test_keys.sh | 66 ./gen_test_keys.sh |
70 » # Crypto tests | 67 |
| 68 # Run cgpt tests |
| 69 runcgpttests: |
| 70 » ${BUILD_ROOT}/cgptlib_test |
| 71 » ./run_cgpt_tests.sh ${BUILD}/cgpt/cgpt |
| 72 |
| 73 # Run crypto tests |
| 74 runcryptotests: |
71 ./run_rsa_tests.sh | 75 ./run_rsa_tests.sh |
72 ${BUILD_ROOT}/sha_tests | 76 ${BUILD_ROOT}/sha_tests |
| 77 ./run_vboot_common_tests.sh |
| 78 |
| 79 # Run other misc tests |
| 80 runmisctests: |
73 ./run_vbutil_tests.sh | 81 ./run_vbutil_tests.sh |
74 ./run_vboot_common_tests.sh | |
75 ./run_image_verification_tests.sh | |
76 # Splicing tests | |
77 #${BUILD_ROOT}/firmware_splicing_tests | |
78 ${BUILD_ROOT}/kernel_splicing_tests | |
79 # Rollback Tests | |
80 #${BUILD_ROOT}/firmware_rollback_tests | |
81 ${BUILD_ROOT}/kernel_rollback_tests | |
82 # Helper Library Tests | |
83 ${BUILD_ROOT}/cgptlib_test | |
84 # Tool tests | |
85 ./run_cgpt_tests.sh ${BUILD}/cgpt/cgpt | |
86 | 82 |
87 -include ${ALL_DEPS} | 83 |
| 84 runtests: genkeys runcgpttests runcryptotests runmisctests |
| 85 |
| 86 # TODO: tests to run when ported to new API |
| 87 #» ./run_image_verification_tests.sh |
| 88 #» # Splicing tests |
| 89 #» ${BUILD_ROOT}/firmware_splicing_tests |
| 90 #» ${BUILD_ROOT}/kernel_splicing_tests |
| 91 #» # Rollback Tests |
| 92 #» ${BUILD_ROOT}/firmware_rollback_tests |
| 93 #» ${BUILD_ROOT}/kernel_rollback_tests |
| 94 |
| 95 -include ${ALL_DEPS} |
OLD | NEW |