tests/tcg: build plugin list from contents of src directory

If you jump back and forth between branches while developing plugins
you end up debugging failures caused by plugins left in the build
directory. Fix this by basing plugins on the source tree instead.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20200615141922.18829-2-alex.bennee@linaro.org>
This commit is contained in:
Alex Bennée 2020-06-15 15:19:21 +01:00
parent 7e1236148c
commit fefa027154
3 changed files with 8 additions and 7 deletions

View File

@ -126,9 +126,10 @@ RUN_TESTS=$(patsubst %,run-%, $(TESTS))
# If plugins exist also include those in the tests # If plugins exist also include those in the tests
ifeq ($(CONFIG_PLUGIN),y) ifeq ($(CONFIG_PLUGIN),y)
PLUGIN_DIR=../../plugin PLUGIN_SRC=$(SRC_PATH)/tests/plugin
VPATH+=$(PLUGIN_DIR) PLUGIN_LIB=../../plugin
PLUGINS=$(notdir $(wildcard $(PLUGIN_DIR)/*.so)) VPATH+=$(PLUGIN_LIB)
PLUGINS=$(patsubst %.c, lib%.so, $(notdir $(wildcard $(PLUGIN_SRC)/*.c)))
# We need to ensure expand the run-plugin-TEST-with-PLUGIN # We need to ensure expand the run-plugin-TEST-with-PLUGIN
# pre-requistes manually here as we can't use stems to handle it. We # pre-requistes manually here as we can't use stems to handle it. We
@ -152,7 +153,7 @@ run-%: %
run-plugin-%: run-plugin-%:
$(call run-test, $@, $(QEMU) $(QEMU_OPTS) \ $(call run-test, $@, $(QEMU) $(QEMU_OPTS) \
-plugin $(PLUGIN_DIR)/$(call extract-plugin,$@) \ -plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) \
-d plugin -D $*.pout \ -d plugin -D $*.pout \
$(call strip-plugin,$<), \ $(call strip-plugin,$<), \
"$* on $(TARGET_NAME)") "$* on $(TARGET_NAME)")
@ -168,7 +169,7 @@ run-plugin-%:
$(call run-test, $@, \ $(call run-test, $@, \
$(QEMU) -monitor none -display none \ $(QEMU) -monitor none -display none \
-chardev file$(COMMA)path=$@.out$(COMMA)id=output \ -chardev file$(COMMA)path=$@.out$(COMMA)id=output \
-plugin $(PLUGIN_DIR)/$(call extract-plugin,$@) \ -plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) \
-d plugin -D $*.pout \ -d plugin -D $*.pout \
$(QEMU_OPTS) $(call strip-plugin,$<), \ $(QEMU_OPTS) $(call strip-plugin,$<), \
"$* on $(TARGET_NAME)") "$* on $(TARGET_NAME)")

View File

@ -31,7 +31,7 @@ run-semihosting: semihosting
run-plugin-semihosting-with-%: run-plugin-semihosting-with-%:
$(call run-test, $@, $(QEMU) $(QEMU_OPTS) \ $(call run-test, $@, $(QEMU) $(QEMU_OPTS) \
-plugin $(PLUGIN_DIR)/$(call extract-plugin,$@) \ -plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) \
$(call strip-plugin,$<) 2> $<.err, \ $(call strip-plugin,$<) 2> $<.err, \
"$< on $(TARGET_NAME) with $*") "$< on $(TARGET_NAME) with $*")

View File

@ -45,7 +45,7 @@ run-semihosting-arm: semihosting-arm
run-plugin-semihosting-with-%: run-plugin-semihosting-with-%:
$(call run-test, $@, $(QEMU) $(QEMU_OPTS) \ $(call run-test, $@, $(QEMU) $(QEMU_OPTS) \
-plugin $(PLUGIN_DIR)/$(call extract-plugin,$@) \ -plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) \
$(call strip-plugin,$<) 2> $<.err, \ $(call strip-plugin,$<) 2> $<.err, \
"$< on $(TARGET_NAME) with $*") "$< on $(TARGET_NAME) with $*")