summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/str.h5
-rw-r--r--include/test.mk12
2 files changed, 15 insertions, 2 deletions
diff --git a/include/str.h b/include/str.h
index 91f05dc6..c4d12113 100644
--- a/include/str.h
+++ b/include/str.h
@@ -256,4 +256,9 @@ EFI_STATUS parse_csv_data(char *data, char *end, size_t n_columns,
list_t *list);
void free_csv_list(list_t *list);
+#ifdef SHIM_UNIT_TEST
+void NONNULL(1, 3, 4)
+parse_csv_line(char * line, size_t max, size_t *n_columns, const char *columns[]);
+#endif
+
#endif /* SHIM_STR_H */
diff --git a/include/test.mk b/include/test.mk
index f70fdaa9..8cdcc332 100644
--- a/include/test.mk
+++ b/include/test.mk
@@ -28,6 +28,12 @@ CFLAGS = -O2 -ggdb -std=gnu11 \
-DSHIM_UNIT_TEST \
"-DDEFAULT_DEBUG_PRINT_STATE=$(DEBUG_PRINTS)"
+$(wildcard test-*.c) :: %.c : test-random.h
+
+test-random.h:
+ dd if=/dev/urandom bs=512 count=17 of=random.bin
+ xxd -i random.bin test-random.h
+
tests := $(patsubst %.c,%,$(wildcard test-*.c))
$(tests) :: test-% : test.c test-%.c $(test-%_FILES)
@@ -36,10 +42,12 @@ $(tests) :: test-% : test.c test-%.c $(test-%_FILES)
test : $(tests)
-all : test
-
clean :
+ @rm -vf test-random.h random.bin
+
+all : clean test
.PHONY: $(tests) all test clean
+.SECONDARY: random.bin
# vim:ft=make