Skip to content

Commit

Permalink
make(sharness): add plugins as part of sharness build
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
  • Loading branch information
Kubuxu committed Jul 12, 2017
1 parent d6f280e commit d2cc708
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ export IPFS_REUSEPORT=false
dir := bin
include $(dir)/Rules.mk

# tests need access to rules from plugin
dir := plugin
include $(dir)/Rules.mk

dir := test
include $(dir)/Rules.mk

Expand Down Expand Up @@ -56,8 +60,6 @@ include $(dir)/Rules.mk
dir := pin/internal/pb
include $(dir)/Rules.mk

dir := plugin
include $(dir)/Rules.mk

# -------------------- #
# universal rules #
Expand Down
1 change: 1 addition & 0 deletions mk/util.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# util functions
OS ?= $(shell sh -c 'uname -s 2>/dev/null || echo not')
ifeq ($(OS),Windows_NT)
WINDOWS :=1
?exe :=.exe # windows compat
Expand Down
1 change: 1 addition & 0 deletions test/sharness/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
lib/sharness/
test-results/
trash directory.*.sh/
plugins
15 changes: 14 additions & 1 deletion test/sharness/Rules.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
include mk/header.mk


SHARNESS_$(d) = $(d)/lib/sharness/sharness.sh

T_$(d) = $(sort $(wildcard $(d)/t[0-9][0-9][0-9][0-9]-*.sh))
Expand All @@ -12,6 +11,20 @@ DEPS_$(d) += cmd/ipfs/ipfs
DEPS_$(d) += $(d)/clean-test-results
DEPS_$(d) += $(SHARNESS_$(d))

ifeq ($(OS),Linux)
PLUGINS_DIR_$(d) := $(d)/plugins/
ORGIN_PLUGINS_$(d) := $(plugin/plugins_plugins_so)
PLUGINS_$(d) := $(addprefix $(PLUGINS_DIR_$(d)),$(notdir $(ORGIN_PLUGINS_$(d))))

$(PLUGINS_$(d)): $(ORGIN_PLUGINS_$(d))
@mkdir -p $(@D)
cp -f plugin/plugins/$(@F) $@

ifneq ($(TEST_NO_PLUGIN),1)
DEPS_$(d) += $(PLUGINS_$(d))
endif
endif

export MAKE_SKIP_PATH=1

$(T_$(d)): $$(DEPS_$(d)) # use second expansion so coverage can inject dependency
Expand Down

0 comments on commit d2cc708

Please sign in to comment.