Skip to content

Commit

Permalink
Attempt to incorporate unit test input file checking to make check
Browse files Browse the repository at this point in the history
This is a work in progress.
  • Loading branch information
ahakanbaba committed Oct 7, 2018
1 parent 02188ce commit 0c50a74
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions makefiles/testing.mak
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- makefile -*-
.PHONY: check units fuzz noise tmain tinst clean-units clean-tmain clean-gcov run-gcov codecheck cppcheck dicts cspell
.PHONY: check units fuzz noise tmain tinst clean-units clean-tmain clean-gcov run-gcov codecheck cppcheck dicts cspell $(VERIFY_PUPPET_TEST_DIRS_TARGETS) verify-units-inputs

check: tmain units

Expand Down Expand Up @@ -88,10 +88,26 @@ slap: $(CTAGS_TEST)
--with-timeout=$(TIMEOUT)"; \
$(SHELL) $${c} $(srcdir)/Units


PUPPET_TEST_DIRS = $(shell find $(srcdir)/Units/parser-puppetManifest.r -maxdepth 1 -mindepth 1 -type d)
VERIFY_PUPPET_TEST_DIRS_TARGETS := $(PUPPET_TEST_DIRS:%=TARGET_FOR_VERIFY_%)

define VERIFY_ONE_PUPPET_TEST_DIR
TARGET_FOR_VERIFY_$(1): $(1)/input.pp
puppet apply --noop $$<
endef

$(foreach puppet_test_dir,$(PUPPET_TEST_DIRS),$(eval $(call VERIFY_ONE_PUPPET_TEST_DIR,$(puppet_test_dir))))

#
# verify-units-inputs Target
#
verify-units-inputs: $(VERIFY_PUPPET_TEST_DIRS_TARGETS)

#
# UNITS Target
#
units: $(CTAGS_TEST)
units: $(CTAGS_TEST) verify-units-inputs
$(V_RUN) \
if test -n "$${ZSH_VERSION+set}"; then set -o SH_WORD_SPLIT; fi; \
if test x$(VG) = x1; then \
Expand Down

0 comments on commit 0c50a74

Please sign in to comment.