linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gu Jinxiang <gujx@cn.fujitsu.com>
To: <linux-btrfs@vger.kernel.org>
Cc: <dsterba@suse.cz>
Subject: [RFC PATCH 1/3] btrfs-progs: Add EXEC parameter in Makefile
Date: Tue, 31 Oct 2017 16:43:34 +0800	[thread overview]
Message-ID: <1509439416-51824-2-git-send-email-gujx@cn.fujitsu.com> (raw)
In-Reply-To: <1509439416-51824-1-git-send-email-gujx@cn.fujitsu.com>

When EXEC parameter is set, do not build this tool.
run the test tool with a given path.(/usr/bin, /usr/local/bin)

Signed-off-by: Gu Jinxiang <gujx@cn.fujitsu.com>
---
 Makefile        | 32 +++++++++++++++++++++++++++++++-
 tests/README.md | 10 ++++++++++
 2 files changed, 41 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 30a0ee22..8ca5e63f 100644
--- a/Makefile
+++ b/Makefile
@@ -26,6 +26,7 @@
 #   EXTRA_LDFLAGS  additional linker flags
 #
 # Testing-specific options (see also tests/README.md):
+#   EXEC=path      run test(s) use exec file in given path
 #   TEST=GLOB      run test(s) from directories matching GLOB
 #   TEST_LOG=tty   print name of a command run via the execution helpers
 #   TEST_LOG=dump  dump testing log file when a test fails
@@ -295,11 +296,38 @@ $(BUILDDIRS):
 	@echo "Making all in $(patsubst build-%,%,$@)"
 	$(Q)$(MAKE) $(MAKEOPTS) -C $(patsubst build-%,%,$@)
 
+ifneq ("$(EXEC)","")
+test-convert:
+	@echo "    [TEST]   convert-tests.sh"
+	$(Q)bash tests/convert-tests.sh
+
+# btrfs-corrupt-block is a internal tool of btrfs-progs.
+test-fsck: btrfs-corrupt-block
+	@echo "    [TEST]   fsck-tests.sh"
+	$(Q)bash tests/fsck-tests.sh
+
+# btrfs-corrupt-block is a internal tool of btrfs-progs.
+# fssum is a internal tool for tests.
+test-misc: btrfs-corrupt-block fssum
+	@echo "    [TEST]   misc-tests.sh"
+	$(Q)bash tests/misc-tests.sh
+
+test-mkfs:
+	@echo "    [TEST]   mkfs-tests.sh"
+	$(Q)bash tests/mkfs-tests.sh
+
+test-fuzz:
+	@echo "    [TEST]   fuzz-tests.sh"
+	$(Q)bash tests/fuzz-tests.sh
+
+test-cli:
+	@echo "    [TEST]   cli-tests.sh"
+	$(Q)bash tests/cli-tests.sh
+else
 test-convert: btrfs btrfs-convert
 	@echo "    [TEST]   convert-tests.sh"
 	$(Q)bash tests/convert-tests.sh
 
-test-check: test-fsck
 test-fsck: btrfs btrfs-image btrfs-corrupt-block mkfs.btrfs btrfstune
 	@echo "    [TEST]   fsck-tests.sh"
 	$(Q)bash tests/fsck-tests.sh
@@ -320,7 +348,9 @@ test-fuzz: btrfs
 test-cli: btrfs
 	@echo "    [TEST]   cli-tests.sh"
 	$(Q)bash tests/cli-tests.sh
+endif
 
+test-check: test-fsck
 test-clean:
 	@echo "Cleaning tests"
 	$(Q)bash tests/clean-tests.sh
diff --git a/tests/README.md b/tests/README.md
index 04d2ce2a..35383346 100644
--- a/tests/README.md
+++ b/tests/README.md
@@ -28,6 +28,16 @@ $ ./misc-tests.sh
 The verbose output of the tests is logged into a file named after the test
 category, eg. `fsck-tests-results.txt`.
 
+## Specify binary
+
+Use binary in the given path to run test.
+
+```shell
+$ make EXEC=/usr/bin/ test
+```
+
+will run tests use binary in /usr/bin.
+
 ## Selective testing
 
 The tests are prefixed by a number for ordering and uniqueness. To run a
-- 
2.13.6




  reply	other threads:[~2017-10-31  8:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-31  8:43 [RFC PATCH 0/3] btrfs-progs: Add support for running the tools from Gu Jinxiang
2017-10-31  8:43 ` Gu Jinxiang [this message]
2017-10-31  8:43 ` [RFC PATCH 2/3] btrfs-progs: Set EXEC to TOP when it not be defined Gu Jinxiang
2017-10-31  8:43 ` [RFC PATCH 3/3] btrfs-progs: Add support for running tools with given path(EXEC) Gu Jinxiang
2017-10-31 10:36 ` [RFC PATCH 0/3] btrfs-progs: Add support for running the tools from Qu Wenruo
2017-11-01  1:42   ` Gu, Jinxiang
2017-11-15 13:32     ` David Sterba

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=1509439416-51824-2-git-send-email-gujx@cn.fujitsu.com \
    --to=gujx@cn.fujitsu.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.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).