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$(HOSTDIR)/include | 9 -I$(HOSTDIR)/include |
10 BUILD_ROOT = ${BUILD}/tests | 10 BUILD_ROOT = ${BUILD}/tests |
11 | 11 |
12 TEST_NAMES = cgptlib_test \ | 12 TEST_NAMES = cgptlib_test \ |
13 rsa_padding_test \ | 13 rsa_padding_test \ |
14 rsa_verify_benchmark \ | 14 rsa_verify_benchmark \ |
15 sha_benchmark \ | 15 sha_benchmark \ |
16 sha_tests \ | 16 sha_tests \ |
17 vboot_common_tests \ | 17 vboot_common_tests \ |
18 vboot_common2_tests \ | 18 vboot_common2_tests \ |
19 vboot_common3_tests | 19 vboot_common3_tests |
20 TEST_BINS = $(addprefix ${BUILD_ROOT}/,$(TEST_NAMES)) | 20 TEST_BINS = $(addprefix ${BUILD_ROOT}/,$(TEST_NAMES)) |
21 | 21 |
22 TEST_LIB = ${BUILD_ROOT}/test.a | 22 TEST_LIB = ${BUILD_ROOT}/test.a |
23 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 |
24 TEST_LIB_OBJS = $(TEST_LIB_SRCS:%.c=${BUILD_ROOT}/%.o) | 24 TEST_LIB_OBJS = $(TEST_LIB_SRCS:%.c=${BUILD_ROOT}/%.o) |
25 ALL_DEPS = $(addsuffix .d,${TEST_BINS} ${TEST_LIB_OBJS}) | 25 ALL_DEPS = $(addsuffix .d,${TEST_BINS} ${TEST_LIB_OBJS}) |
26 CFLAGS += -MMD -MF $@.d | 26 CFLAGS += -MMD -MF $@.d |
27 | 27 |
28 LIBS := ${TEST_LIB} $(HOSTLIB) $(FWLIB) | 28 LIBS := ${TEST_LIB} $(HOSTLIB) $(FWLIB) |
29 | 29 |
| 30 ifneq (${RUNTESTS},) |
| 31 EXTRA_TARGET = runtests |
| 32 endif |
| 33 |
30 all: $(TEST_BINS) ${EXTRA_TARGET} | 34 all: $(TEST_BINS) ${EXTRA_TARGET} |
31 | 35 |
32 ${TEST_LIB}: ${TEST_LIB_OBJS} | 36 ${TEST_LIB}: ${TEST_LIB_OBJS} |
33 rm -f $@ | 37 rm -f $@ |
34 ar qc $@ $^ | 38 ar qc $@ $^ |
35 | 39 |
36 ${BUILD_ROOT}/%.o : %.c | 40 ${BUILD_ROOT}/%.o : %.c |
37 $(CC) $(CFLAGS) $(INCLUDES) -MMD -MF $@.d -c -o $@ $< | 41 $(CC) $(CFLAGS) $(INCLUDES) -MMD -MF $@.d -c -o $@ $< |
38 | 42 |
39 ${BUILD_ROOT}/%: %.c ${LIBS} | 43 ${BUILD_ROOT}/%: %.c ${LIBS} |
40 $(CC) $(CFLAGS) $(INCLUDES) $< ${LIBS} -o $@ -lcrypto -lrt | 44 $(CC) $(CFLAGS) $(INCLUDES) $< ${LIBS} -o $@ -lcrypto -lrt |
41 | 45 |
42 # TODO: port these tests to new API, if not already eqivalent | 46 # TODO: port these tests to new API, if not already eqivalent |
43 # functionality in other tests | 47 # functionality in other tests |
44 # | 48 # |
45 # big_firmware_tests | 49 # big_firmware_tests |
46 # firmware_image_tests | 50 # firmware_image_tests |
47 # firmware_rollback_tests | 51 # firmware_rollback_tests |
48 # firmware_splicing_tests | 52 # firmware_splicing_tests |
49 # firmware_verify_benchmark | 53 # firmware_verify_benchmark |
50 # verify_firmware_fuzz_driver | 54 # verify_firmware_fuzz_driver |
51 # | 55 # |
52 # big_kernel_tests | 56 # big_kernel_tests |
53 # kernel_image_tests | 57 # kernel_image_tests |
54 # kernel_rollback_tests | 58 # kernel_rollback_tests |
55 # kernel_splicing_tests | 59 # kernel_splicing_tests |
56 # kernel_verify_benchmark | 60 # kernel_verify_benchmark |
57 # verify_kernel_fuzz_driver | 61 # verify_kernel_fuzz_driver |
58 | 62 |
59 | |
60 ifneq (${RUNTESTS},) | |
61 EXTRA_TARGET = runtests | |
62 endif | |
63 | |
64 # Generate test keys | 63 # Generate test keys |
65 genkeys: | 64 genkeys: |
66 ./gen_test_keys.sh | 65 ./gen_test_keys.sh |
67 | 66 |
68 # Run cgpt tests | 67 # Run cgpt tests |
69 runcgpttests: | 68 runcgpttests: |
70 ${BUILD_ROOT}/cgptlib_test | 69 ${BUILD_ROOT}/cgptlib_test |
71 ./run_cgpt_tests.sh ${BUILD}/cgpt/cgpt | 70 ./run_cgpt_tests.sh ${BUILD}/cgpt/cgpt |
72 | 71 |
73 # Run crypto tests | 72 # Run crypto tests |
(...skipping 12 matching lines...) Expand all Loading... |
86 # TODO: tests to run when ported to new API | 85 # TODO: tests to run when ported to new API |
87 # ./run_image_verification_tests.sh | 86 # ./run_image_verification_tests.sh |
88 # # Splicing tests | 87 # # Splicing tests |
89 # ${BUILD_ROOT}/firmware_splicing_tests | 88 # ${BUILD_ROOT}/firmware_splicing_tests |
90 # ${BUILD_ROOT}/kernel_splicing_tests | 89 # ${BUILD_ROOT}/kernel_splicing_tests |
91 # # Rollback Tests | 90 # # Rollback Tests |
92 # ${BUILD_ROOT}/firmware_rollback_tests | 91 # ${BUILD_ROOT}/firmware_rollback_tests |
93 # ${BUILD_ROOT}/kernel_rollback_tests | 92 # ${BUILD_ROOT}/kernel_rollback_tests |
94 | 93 |
95 -include ${ALL_DEPS} | 94 -include ${ALL_DEPS} |
OLD | NEW |