Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test.mk: don't use a temporary random.bin #718

Merged
merged 1 commit into from
Feb 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions include/test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,12 @@ libefi-test.a :
clean

test-random.h:
dd if=/dev/urandom bs=512 count=17 of=random.bin
xxd -i random.bin test-random.h
dd if=/dev/urandom bs=512 count=17 status=none | ( \
echo "unsigned char random_bin[] = {" ; \
xxd -i - ; \
echo "};" ; \
echo "unsigned int random_bin_len = 8704;" ; \
) > test-random.h

$(wildcard test-*.c) :: %.c : test-random.h
$(patsubst %.c,%,$(wildcard test-*.c)) :: | test-random.h
Expand Down Expand Up @@ -119,14 +123,13 @@ test-coverage : CFLAGS_GCOV+=--coverage
test-coverage : $(tests)

test-clean :
@rm -vf test-random.h random.bin libefi-test.a
@rm -vf test-random.h libefi-test.a
@rm -vf *.gcda *.gcno *.gcov vgcore.*

clean : test-clean

all : test-clean test

.PHONY: $(tests) all test clean
.SECONDARY: random.bin

# vim:ft=make