Read argv files via readarray
This commit is contained in:
parent
8ac30a239d
commit
d2d54c12a8
@ -1,4 +1,5 @@
|
||||
eggs
|
||||
legs
|
||||
pegs
|
||||
jegs
|
||||
jeggings
|
||||
banana pants
|
||||
|
@ -1,3 +1,5 @@
|
||||
SHELL := /bin/bash
|
||||
|
||||
CFLAGS ?= -Wall -g
|
||||
GDBRUN = gdb --batch --ex run --ex bt --ex q --args
|
||||
BUILD_TARGETS = $(foreach ex,$(wildcard ex*.c),$(subst .c,,$(ex)))
|
||||
@ -22,8 +24,8 @@ gtest:
|
||||
printf '\ngYAY\n'
|
||||
|
||||
.gtest.%:
|
||||
@test_argv=$$(cat .$*.argv 2>/dev/null || echo) && \
|
||||
printf '\n==> %s\n' "$*" && $(GDBRUN) ./$*
|
||||
@if test -f .$*.argv; then readarray -t test_argv <.$*.argv; fi && \
|
||||
printf '\n==> %s\n' "$*" && $(GDBRUN) ./$* "$${test_argv[@]}"
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
@ -31,5 +33,5 @@ test:
|
||||
printf '\nYAY\n'
|
||||
|
||||
.test.%:
|
||||
@test_argv=$$(cat .$*.argv 2>/dev/null || echo) && \
|
||||
printf '\n==> %s\n' "$*" && ./$* $$test_argv
|
||||
@if test -f .$*.argv; then readarray -t test_argv <.$*.argv; fi && \
|
||||
printf '\n==> %s\n' "$*" && ./$* "$${test_argv[@]}"
|
||||
|
Loading…
Reference in New Issue
Block a user