public inbox for [email protected]
 help / color / mirror / Atom feed
From: Dylan Yudaken <[email protected]>
To: <[email protected]>
Cc: <[email protected]>, <[email protected]>, <[email protected]>,
	Dylan Yudaken <[email protected]>
Subject: [PATCH liburing v2 6/7] test: add make targets for each test
Date: Fri, 22 Apr 2022 09:01:31 -0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

Add a make target runtests-parallel which can run tests in parallel.
This is very useful to quickly run all the tests locally with
  $ make -j runtests-parallel

Signed-off-by: Dylan Yudaken <[email protected]>
---
 Makefile               |  2 ++
 test/Makefile          | 10 +++++++++-
 test/runtests-quiet.sh | 11 +++++++++++
 3 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100755 test/runtests-quiet.sh

diff --git a/Makefile b/Makefile
index 28c0fd8..d54551e 100644
--- a/Makefile
+++ b/Makefile
@@ -21,6 +21,8 @@ runtests: all
 	@$(MAKE) -C test runtests
 runtests-loop:
 	@$(MAKE) -C test runtests-loop
+runtests-parallel:
+	@$(MAKE) -C test runtests-parallel
 
 config-host.mak: configure
 	@if [ ! -e "$@" ]; then					\
diff --git a/test/Makefile b/test/Makefile
index cb7e15e..fe35ff9 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -185,6 +185,7 @@ all_targets += sq-full-cpp.t
 
 test_targets := $(patsubst %.c,%,$(test_srcs))
 test_targets := $(patsubst %.cc,%,$(test_targets))
+run_test_targets := $(patsubst %,%.run_test,$(test_targets))
 test_targets := $(patsubst %,%.t,$(test_targets))
 all_targets += $(test_targets)
 
@@ -229,4 +230,11 @@ runtests: all
 runtests-loop: all
 	@./runtests-loop.sh $(test_targets)
 
-.PHONY: all install clean runtests runtests-loop
+%.run_test: %.t
+	@./runtests-quiet.sh $<
+
+runtests-parallel: $(run_test_targets)
+	@echo "All tests passed"
+
+.PHONY: all install clean runtests runtests-loop runtests-parallel
+.PHONY += $(run_test_targets)
diff --git a/test/runtests-quiet.sh b/test/runtests-quiet.sh
new file mode 100755
index 0000000..438a00a
--- /dev/null
+++ b/test/runtests-quiet.sh
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+
+TESTS=("$@")
+RESULT_FILE=$(mktemp)
+./runtests.sh "${TESTS[@]}" 2>&1 > $RESULT_FILE
+RET="$?"
+if [ "${RET}" -ne 0 ]; then
+    cat $RESULT_FILE
+fi
+rm $RESULT_FILE
+exit $RET
-- 
2.30.2


  parent reply	other threads:[~2022-04-22 16:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-22 16:01 [PATCH liburing v2 0/7] run tests in parallel Dylan Yudaken
2022-04-22 16:01 ` [PATCH liburing v2 1/7] test: handle mmap return failures in pollfree test Dylan Yudaken
2022-04-22 16:01 ` [PATCH liburing v2 2/7] test: use unique path for socket Dylan Yudaken
2022-04-22 16:01 ` [PATCH liburing v2 3/7] test: use unique ports Dylan Yudaken
2022-04-22 16:01 ` [PATCH liburing v2 4/7] test: use unique filenames Dylan Yudaken
2022-04-22 16:01 ` [PATCH liburing v2 5/7] test: mkdir -p output folder Dylan Yudaken
2022-04-22 16:01 ` Dylan Yudaken [this message]
2022-04-22 16:01 ` [PATCH liburing v2 7/7] test: use remove_buffers instead of nop to generate error codes Dylan Yudaken
2022-04-22 17:30 ` [PATCH liburing v2 0/7] run tests in parallel Jens Axboe

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 \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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