Skip to content

Commit

Permalink
tests/tcg: list test targets in Makefile.prereqs
Browse files Browse the repository at this point in the history
Omit the rules altogether for targets that do not have a compiler.
Makefile.qemu now is only invoked if the tests are actually built/run.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20220401141326.1244422-14-pbonzini@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220419091020.3008144-17-alex.bennee@linaro.org>
  • Loading branch information
bonzini authored and stsquad committed Apr 20, 2022
1 parent f2d5935 commit 5377a10
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 23 deletions.
14 changes: 7 additions & 7 deletions tests/Makefile.include
Expand Up @@ -36,19 +36,16 @@ export SRC_PATH

SPEED = quick

# Build up our target list from the filtered list of ninja targets
TARGETS=$(patsubst libqemu-%.fa, %, $(filter libqemu-%.fa, $(ninja-targets)))

-include tests/tcg/Makefile.prereqs
config-host.mak: $(SRC_PATH)/tests/tcg/configure.sh
tests/tcg/Makefile.prereqs: config-host.mak

# Per guest TCG tests
BUILD_TCG_TARGET_RULES=$(patsubst %,build-tcg-tests-%, $(TARGETS))
CLEAN_TCG_TARGET_RULES=$(patsubst %,clean-tcg-tests-%, $(TARGETS))
RUN_TCG_TARGET_RULES=$(patsubst %,run-tcg-tests-%, $(TARGETS))
BUILD_TCG_TARGET_RULES=$(patsubst %,build-tcg-tests-%, $(TCG_TESTS_TARGETS))
CLEAN_TCG_TARGET_RULES=$(patsubst %,clean-tcg-tests-%, $(TCG_TESTS_TARGETS))
RUN_TCG_TARGET_RULES=$(patsubst %,run-tcg-tests-%, $(TCG_TESTS_TARGETS))

$(foreach TARGET,$(TARGETS), \
$(foreach TARGET,$(TCG_TESTS_TARGETS), \
$(eval $(BUILD_DIR)/tests/tcg/config-$(TARGET).mak: config-host.mak))

$(BUILD_TCG_TARGET_RULES): build-tcg-tests-%: $(if $(CONFIG_PLUGIN),test-plugins)
Expand Down Expand Up @@ -84,6 +81,9 @@ clean-tcg: $(CLEAN_TCG_TARGET_RULES)

.PHONY: check-venv check-avocado check-acceptance check-acceptance-deprecated-warning

# Build up our target list from the filtered list of ninja targets
TARGETS=$(patsubst libqemu-%.fa, %, $(filter libqemu-%.fa, $(ninja-targets)))

TESTS_VENV_DIR=$(BUILD_DIR)/tests/venv
TESTS_VENV_REQ=$(SRC_PATH)/tests/requirements.txt
TESTS_RESULTS_DIR=$(BUILD_DIR)/tests/results
Expand Down
11 changes: 0 additions & 11 deletions tests/tcg/Makefile.qemu
Expand Up @@ -95,7 +95,6 @@ all:

.PHONY: guest-tests

ifneq ($(GUEST_BUILD),)
guest-tests: $(GUEST_BUILD)

run-guest-tests: guest-tests
Expand All @@ -105,16 +104,6 @@ run-guest-tests: guest-tests
SRC_PATH="$(SRC_PATH)" SPEED=$(SPEED) run), \
"RUN", "tests for $(TARGET_NAME)")

else
guest-tests:
$(call quiet-command, true, "BUILD", \
"$(TARGET) guest-tests SKIPPED")

run-guest-tests:
$(call quiet-command, true, "RUN", \
"tests for $(TARGET) SKIPPED")
endif

# It doesn't matter if these don't exits
.PHONY: clean-guest-tests
clean-guest-tests:
Expand Down
17 changes: 12 additions & 5 deletions tests/tcg/configure.sh
Expand Up @@ -81,7 +81,9 @@ fi
: ${cross_ld_tricore="tricore-ld"}

makefile=tests/tcg/Makefile.prereqs
: > $makefile
echo "# Automatically generated by configure - do not modify" > $makefile

tcg_tests_targets=
for target in $target_list; do
arch=${target%%-*}

Expand Down Expand Up @@ -228,18 +230,15 @@ for target in $target_list; do
echo "target=$target" >> $config_target_mak
case $target in
*-softmmu)
test -f $source_path/tests/tcg/$arch/Makefile.softmmu-target || continue
qemu="qemu-system-$arch"
;;
*-linux-user|*-bsd-user)
qemu="qemu-$arch"
;;
esac

echo "run-tcg-tests-$target: $qemu\$(EXESUF)" >> $makefile

eval "target_compiler_cflags=\${cross_cc_cflags_$arch}"
echo "QEMU=$PWD/$qemu" >> $config_target_mak
echo "CROSS_CC_GUEST_CFLAGS=$target_compiler_cflags" >> $config_target_mak

got_cross_cc=no

Expand Down Expand Up @@ -362,8 +361,16 @@ for target in $target_list; do
echo "CROSS_CC_HAS_I386_NOPIE=y" >> $config_target_mak
;;
esac
got_cross_cc=yes
break
fi
done
fi
if test $got_cross_cc = yes; then
echo "QEMU=$PWD/$qemu" >> $config_target_mak
echo "CROSS_CC_GUEST_CFLAGS=$target_compiler_cflags" >> $config_target_mak
echo "run-tcg-tests-$target: $qemu\$(EXESUF)" >> $makefile
tcg_tests_targets="$tcg_tests_targets $target"
fi
done
echo "TCG_TESTS_TARGETS=$tcg_tests_targets" >> $makefile

0 comments on commit 5377a10

Please sign in to comment.