Skip to content

Commit c4f548a

Browse files
zhalvorsenjhand2
authored andcommitted
Move libcaliptra example functionality into a test.c file.
This can make it easier to use the same test functionality in a different build system. Moves all test logic to test.c and only exposes a run_tests function that takes a parameter with the settings that will be used for the tests. The actually functionality of the test isn't changed at all. Reading in the FW images was moved to main.c and an initialization function was added to interface.c. It gets initialized at the beginning of run_tests. Some function parameters were changed to const because they weren't being changed within the function. Also contains some #include cleanup.
1 parent e2a861e commit c4f548a

File tree

10 files changed

+844
-792
lines changed

10 files changed

+844
-792
lines changed

libcaliptra/examples/generic/main.c

Lines changed: 41 additions & 709 deletions
Large diffs are not rendered by default.

libcaliptra/examples/generic/main.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Q=@
33
CC=$(CROSS_COMPILE)gcc
44
AR=$(CROSS_COMPILE)ar
55

6-
SOURCE += ../generic/main.c ../../src/caliptra_api.c
6+
SOURCE += ../generic/main.c ../generic/test.c ../../src/caliptra_api.c
77

88
LIBCALIPTRA_ROOT = ../..
99
LIBCALIPTRA_INC = $(LIBCALIPTRA_ROOT)/inc
@@ -14,7 +14,7 @@ OBJS := $(patsubst %.c,%.o, $(filter %.c,$(SOURCE)))
1414
RTL_SOC_IFC_INCLUDE_PATH = ../../../hw/1.0/rtl/src/soc_ifc/rtl
1515

1616
# INCLUDES
17-
INCLUDES += -I$(RTL_SOC_IFC_INCLUDE_PATH) -I$(LIBCALIPTRA_INC)
17+
INCLUDES += -I$(RTL_SOC_IFC_INCLUDE_PATH) -I$(LIBCALIPTRA_INC) -I./
1818

1919
.PHONY = run clean
2020

0 commit comments

Comments
 (0)