Skip to content

Commit

Permalink
Makefile: Clearer warning on missing validation executable(s)
Browse files Browse the repository at this point in the history
Instead of reporting

  total ................................................. 0/0

and passing (which node-tap seems to do when given missing files as
arguments), report:

  missing test executable; run 'make runtimetest validation-executables'

and error out.  Having a separate step to build the executables is
useful for:

* Not building them as root, which reduces the change of security
  issues by using as little privilege as possible.
* Not rebuilding them on each test, since we haven't told Make about
  the full dependency tree for the test executables.

The separate build step was introduced in e11b77f (validation: Use
prove(1) as a TAP harness, 2017-11-25, #439), but I didn't do a good
job of motivating it in that commit message.

Signed-off-by: W. Trevor King <wking@tremily.us>
  • Loading branch information
wking committed Dec 26, 2017
1 parent a55d234 commit 23f547a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ clean:
rm -f oci-runtime-tool runtimetest *.1 $(VALIDATION_TESTS)

localvalidation:
@for EXECUTABLE in runtimetest $(VALIDATION_TESTS); \
do \
if test ! -x "$${EXECUTABLE}"; \
then \
echo "missing test executable $${EXECUTABLE}; run 'make runtimetest validation-executables'" >&2; \
exit 1; \
fi; \
done
RUNTIME=$(RUNTIME) $(TAP) $(VALIDATION_TESTS)

.PHONY: validation-executables
Expand Down

0 comments on commit 23f547a

Please sign in to comment.