Skip to contentSkip to conversation

check-tcg fixes for --enable-plugins

PATCH New Alex Bennée 1 participant 3 messages Jun 15, 2020

lore
Share & tools
lore
#0 lore raw

cover check-tcg fixes for --enable-plugins

Hi,

Two minor fixes to deal with test failures with --enable-plugins builds. I'll include them in tomorrows PR. Please review.

Alex Bennée (2):
tests/tcg: build plugin list from contents of src directory tests/tcg: ensure -cpu max also used for plugin run

 tests/tcg/Makefile.target         | 11 ++++++-----
 tests/tcg/aarch64/Makefile.target |  5 +++--
 tests/tcg/arm/Makefile.target     |  2 +-
 tests/tcg/i386/Makefile.target    |  1 +
 4 files changed, 11 insertions(+), 8 deletions(-)
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/2 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.

---
 tests/tcg/Makefile.target         | 11 ++++++-----
 tests/tcg/aarch64/Makefile.target |  2 +-
 tests/tcg/arm/Makefile.target     |  2 +-
 3 files changed, 8 insertions(+), 7 deletions(-)
tests/tcg/Makefile.target +6 -5
index b3cff3cad1a..2ae86776cdc 100644
@@ -126,9 +126,10 @@ RUN_TESTS=$(patsubst %,run-%, $(TESTS))
 
 # If plugins exist also include those in the tests
 ifeq ($(CONFIG_PLUGIN),y)
-PLUGIN_DIR=../../plugin
-VPATH+=$(PLUGIN_DIR)
-PLUGINS=$(notdir $(wildcard $(PLUGIN_DIR)/*.so))
+PLUGIN_SRC=$(SRC_PATH)/tests/plugin
+PLUGIN_LIB=../../plugin
+VPATH+=$(PLUGIN_LIB)
+PLUGINS=$(patsubst %.c, lib%.so, $(notdir $(wildcard $(PLUGIN_SRC)/*.c)))
 
 # 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
@@ -152,7 +153,7 @@ run-%: %
 
 run-plugin-%:
 	$(call run-test, $@, $(QEMU) $(QEMU_OPTS) \
-		-plugin $(PLUGIN_DIR)/$(call extract-plugin,$@) \
+		-plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) \
 		-d plugin -D $*.pout \
 		 $(call strip-plugin,$<), \
 	"$* on $(TARGET_NAME)")
@@ -168,7 +169,7 @@ run-plugin-%:
 	$(call run-test, $@, \
 	  $(QEMU) -monitor none -display none \
 		  -chardev file$(COMMA)[email protected]$(COMMA)id=output \
-	   	  -plugin $(PLUGIN_DIR)/$(call extract-plugin,$@) \
+	   	  -plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) \
 	    	  -d plugin -D $*.pout \
 	   	  $(QEMU_OPTS) $(call strip-plugin,$<), \
 	  "$* on $(TARGET_NAME)")
tests/tcg/aarch64/Makefile.target +1 -1
index 312f36cde5f..6d60a2f2eed 100644
@@ -31,7 +31,7 @@ run-semihosting: semihosting
 
 run-plugin-semihosting-with-%:
 	$(call run-test, $@, $(QEMU) $(QEMU_OPTS) \
-		-plugin $(PLUGIN_DIR)/$(call extract-plugin,$@) \
+		-plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) \
 		 $(call strip-plugin,$<) 2> $<.err, \
 		"$< on $(TARGET_NAME) with $*")
 
tests/tcg/arm/Makefile.target +1 -1
index 3da09a38be7..ec951565626 100644
@@ -45,7 +45,7 @@ run-semihosting-arm: semihosting-arm
 
 run-plugin-semihosting-with-%:
 	$(call run-test, $@, $(QEMU) $(QEMU_OPTS) \
-		-plugin $(PLUGIN_DIR)/$(call extract-plugin,$@) \
+		-plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) \
 		 $(call strip-plugin,$<) 2> $<.err, \
 		"$< on $(TARGET_NAME) with $*")
 
Signature · 1 line
2.20.1
#2 lore raw

PATCH 2/2 tests/tcg: ensure -cpu max also used for plugin run

In reply to Alex Bennée

The check-tcg plugins build was failing because some special case tests that needed -cpu max failed because the plugin variant hadn't carried across the QEMU_OPTS tweak.

Guests which globally set QEMU_OPTS=-cpu FOO where unaffected.

---
 tests/tcg/aarch64/Makefile.target | 3 ++-
 tests/tcg/i386/Makefile.target    | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
tests/tcg/aarch64/Makefile.target +2 -1
index 6d60a2f2eed..b617f2ac7e0 100644
@@ -20,8 +20,9 @@ run-fcvt: fcvt
 # Pauth Tests
 ifneq ($(DOCKER_IMAGE)$(CROSS_CC_HAS_ARMV8_3),)
 AARCH64_TESTS += pauth-1 pauth-2 pauth-4
-run-pauth-%: QEMU_OPTS += -cpu max
 pauth-%: CFLAGS += -march=armv8.3-a
+run-pauth-%: QEMU_OPTS += -cpu max
+run-plugin-pauth-%: QEMU_OPTS += -cpu max
 endif
 
 # Semihosting smoke test for linux-user
tests/tcg/i386/Makefile.target +1 -0
index 53efec06683..1a6463a7dc1 100644
@@ -12,6 +12,7 @@ X86_64_TESTS:=$(filter test-i386-ssse3, $(ALL_X86_TESTS))
 
 test-i386-pcmpistri: CFLAGS += -msse4.2
 run-test-i386-pcmpistri: QEMU_OPTS += -cpu max
+run-plugin-test-i386-pcmpistri-%: QEMU_OPTS += -cpu max
 
 #
 # hello-i386 is a barebones app
Signature · 1 line
2.20.1