Skip to contentSkip to conversation

build: disarm the TCG unit test trap

PATCH Superseded Daniel P. Berrange 2 participants 2 messages Nov 20, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build: disarm the TCG unit test trap

Developers sometimes mistakenly run 'make test' instead of 'make check'. 'make test' triggers the ancient, unmaintained tcg unit tests in tests/tcg/Makefile which have long since ceased compiling.

Even if someone fixes the TCG tests, it makes little sense to put them in a 'make test' target, rather they should be 'make check-tcg', possibly wired up as a dependency of 'make check'.

In the meantime, this patch disarms the 'make test' trap by turning it into a synonym for 'make check'.

---
 tests/Makefile.include | 1 +
 tests/tcg/Makefile     | 3 ---
 2 files changed, 1 insertion(+), 3 deletions(-)
tests/Makefile.include +1 -0
index 434a2ce868..55fd99f451 100644
@@ -919,6 +919,7 @@ check-unit: $(patsubst %,check-%, $(check-unit-y))
 check-speed: $(patsubst %,check-%, $(check-speed-y))
 check-block: $(patsubst %,check-%, $(check-block-y))
 check: check-qapi-schema check-unit check-qtest
+test: check
 check-clean:
 	$(MAKE) -C tests/tcg clean
 	rm -rf $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
tests/tcg/Makefile +0 -3
index 89e3342f3d..4b5d196326 100644
@@ -36,9 +36,6 @@ ifneq ($(call find-in-path, $(CC_I386)),)
 TESTS += $(I386_TESTS)
 endif
 
-all: $(patsubst %,run-%,$(TESTS))
-test: all
-
 # rules to run tests
 
 .PHONY: $(patsubst %,run-%,$(TESTS))
Signature · 1 line
2.14.3
#1 lore raw
Quoted 44 lines · Daniel P. Berrange

Developers sometimes mistakenly run 'make test' instead of 'make check'. 'make test' triggers the ancient, unmaintained tcg unit tests in tests/tcg/Makefile which have long since ceased compiling.

Even if someone fixes the TCG tests, it makes little sense to put them in a 'make test' target, rather they should be 'make check-tcg', possibly wired up as a dependency of 'make check'.

In the meantime, this patch disarms the 'make test' trap by turning it into a synonym for 'make check'.

---
 tests/Makefile.include | 1 +
 tests/tcg/Makefile     | 3 ---
 2 files changed, 1 insertion(+), 3 deletions(-)
tests/Makefile.include +1 -0
index 434a2ce868..55fd99f451 100644
@@ -919,6 +919,7 @@ check-unit: $(patsubst %,check-%, $(check-unit-y))
 check-speed: $(patsubst %,check-%, $(check-speed-y))
 check-block: $(patsubst %,check-%, $(check-block-y))
 check: check-qapi-schema check-unit check-qtest
+test: check
 check-clean:
        $(MAKE) -C tests/tcg clean
        rm -rf $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
tests/tcg/Makefile +0 -4
index 89e3342f3d..4b5d196326 100644
@@ -36,9 +36,6 @@ ifneq ($(call find-in-path, $(CC_I386)),)
 TESTS += $(I386_TESTS)
 endif
 
-all: $(patsubst %,run-%,$(TESTS))
-test: all
-
 # rules to run tests
 
 .PHONY: $(patsubst %,run-%,$(TESTS))
--
Quoted 1 line

2.14.3

I'm inclined to prefer having 'make test' just fail rather than silently behave like 'make check'.

thanks
-- PMM