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