qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@redhat.com>
To: qemu-devel@nongnu.org
Cc: eblake@redhat.com, peter.maydell@linaro.org,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [Qemu-devel] [PATCH v2] build-sys: generate tests/.gitignore
Date: Fri, 23 Sep 2016 01:11:16 +0400	[thread overview]
Message-ID: <20160922211116.32417-1-marcandre.lureau@redhat.com> (raw)

It's too easy to forget about updating the .gitignore, so this is an
attempt at generating it instead.

This approach assumes that the files to clean are the one to put in
the .gitignore.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
v2:
 - fix make check-clean
 - improve adding $(QEMU_IOTESTS_HELPERS-y) in cleanfiles (it needs a patsubst because tests/ is present 2 times)
 - use quiet-command
 - fix cleanfiles +=

 tests/Makefile.include | 26 +++++++++++++---
 tests/.gitignore       | 82 --------------------------------------------------
 2 files changed, 22 insertions(+), 86 deletions(-)
 delete mode 100644 tests/.gitignore

diff --git a/tests/Makefile.include b/tests/Makefile.include
index 6052a38..cf81fd7 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -782,8 +782,21 @@ $(patsubst %, check-%, $(check-qapi-schema-y)): check-%.json: $(SRC_PATH)/%.json
 	@perl -p -e 's|\Q$(SRC_PATH)\E/||g' $*.test.err | diff -q $(SRC_PATH)/$*.err -
 	@diff -q $(SRC_PATH)/$*.exit $*.test.exit
 
-# Consolidated targets
+tests-cleanfiles = *.o
+tests-cleanfiles += .gitignore
+tests-cleanfiles += qht-bench$(EXESUF)
+tests-cleanfiles += qapi-schema/*.test.*
+tests-cleanfiles += test-qapi-event.[ch]
+tests-cleanfiles += test-qapi-types.[ch]
+tests-cleanfiles += test-qapi-visit.[ch]
+tests-cleanfiles += test-qmp-introspect.[ch]
+tests-cleanfiles += test-qmp-commands.h
+tests-cleanfiles += test-qmp-marshal.c
+tests-cleanfiles += $(subst tests/,,$(check-unit-y))
+tests-cleanfiles += $(subst tests/,,$(check-qtest-y))
+tests-cleanfiles += $(patsubst tests/%,%,$(QEMU_IOTESTS_HELPERS-y))
 
+# Consolidated targets
 .PHONY: check-qapi-schema check-qtest check-unit check check-clean
 check-qapi-schema: $(patsubst %,check-%, $(check-qapi-schema-y))
 check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
@@ -792,14 +805,19 @@ check-block: $(patsubst %,check-%, $(check-block-y))
 check: check-qapi-schema check-unit check-qtest
 check-clean:
 	$(MAKE) -C tests/tcg clean
-	rm -rf $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
-	rm -rf $(sort $(foreach target,$(SYSEMU_TARGET_LIST), $(check-qtest-$(target)-y)) $(check-qtest-generic-y))
-
+	(cd tests && rm -rf $(tests-cleanfiles))
 clean: check-clean
 
 # Build the help program automatically
 
 all: $(QEMU_IOTESTS_HELPERS-y)
 
+ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
+$(SRC_PATH)/tests/.gitignore:
+	$(call quiet-command, echo "$(tests-cleanfiles)" | xargs -n1 | sort > $@, \
+	  " GEN $(@F)")
+Makefile: $(SRC_PATH)/tests/.gitignore
+endif
+
 -include $(wildcard tests/*.d)
 -include $(wildcard tests/libqos/*.d)
diff --git a/tests/.gitignore b/tests/.gitignore
deleted file mode 100644
index b4a9cfc..0000000
--- a/tests/.gitignore
+++ /dev/null
@@ -1,82 +0,0 @@
-check-qdict
-check-qfloat
-check-qint
-check-qjson
-check-qlist
-check-qnull
-check-qstring
-check-qom-interface
-check-qom-proplist
-qht-bench
-rcutorture
-test-aio
-test-base64
-test-bitops
-test-blockjob-txn
-test-clone-visitor
-test-coroutine
-test-crypto-afsplit
-test-crypto-block
-test-crypto-cipher
-test-crypto-hash
-test-crypto-ivgen
-test-crypto-pbkdf
-test-crypto-secret
-test-crypto-tlscredsx509
-test-crypto-tlscredsx509-work/
-test-crypto-tlscredsx509-certs/
-test-crypto-tlssession
-test-crypto-tlssession-work/
-test-crypto-tlssession-client/
-test-crypto-tlssession-server/
-test-crypto-xts
-test-cutils
-test-hbitmap
-test-int128
-test-iov
-test-io-channel-buffer
-test-io-channel-command
-test-io-channel-command.fifo
-test-io-channel-file
-test-io-channel-file.txt
-test-io-channel-socket
-test-io-channel-tls
-test-io-task
-test-logging
-test-mul64
-test-opts-visitor
-test-qapi-event.[ch]
-test-qapi-types.[ch]
-test-qapi-visit.[ch]
-test-qdev-global-props
-test-qemu-opts
-test-qdist
-test-qga
-test-qht
-test-qht-par
-test-qmp-commands
-test-qmp-commands.h
-test-qmp-event
-test-qmp-input-strict
-test-qmp-input-visitor
-test-qmp-introspect.[ch]
-test-qmp-marshal.c
-test-qmp-output-visitor
-test-rcu-list
-test-replication
-test-rfifolock
-test-string-input-visitor
-test-string-output-visitor
-test-thread-pool
-test-throttle
-test-timed-average
-test-visitor-serialization
-test-vmstate
-test-write-threshold
-test-x86-cpuid
-test-xbzrle
-test-netfilter
-test-filter-mirror
-test-filter-redirector
-*-test
-qapi-schema/*.test.*
-- 
2.10.0

             reply	other threads:[~2016-09-22 21:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-22 21:11 Marc-André Lureau [this message]
2016-10-27 18:36 ` [Qemu-devel] [PATCH v2] build-sys: generate tests/.gitignore Eric Blake
  -- strict thread matches above, loose matches on Subject: below --
2017-09-11 15:11 Marc-André Lureau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160922211116.32417-1-marcandre.lureau@redhat.com \
    --to=marcandre.lureau@redhat.com \
    --cc=eblake@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).