public inbox for [email protected]
 help / color / mirror / Atom feed
From: Ammar Faizi <[email protected]>
To: Jens Axboe <[email protected]>
Cc: Ammar Faizi <[email protected]>,
	io-uring Mailing List <[email protected]>,
	GNU/Weeb Mailing List <[email protected]>
Subject: [PATCH liburing v2 3/3] test/Makefile: Append `.t` to the test binary
Date: Mon,  4 Apr 2022 01:22:00 +0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

When adding a new test, we often forget to add the new test binary to
`.gitignore`. Append `.t` to the test binary filename, this way we can
use a wildcard matching "test/*.t" in `.gitignore` to ignore all
test binary files.

Goals:
  - Make the .gitignore simpler.
  - Avoid the burden of adding a new test to .gitignore.

Signed-off-by: Ammar Faizi <[email protected]>
---
 .gitignore    | 131 +-------------------------------------------------
 test/Makefile |   8 +--
 2 files changed, 6 insertions(+), 133 deletions(-)

diff --git a/.gitignore b/.gitignore
index 58fff7f..60fddd7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,136 +16,7 @@
 /examples/link-cp
 /examples/ucontext-cp
 
-/test/232c93d07b74
-/test/35fa71a030ca
-/test/500f9fbadef8
-/test/7ad0e4b2f83c
-/test/8a9973408177
-/test/917257daa0fe
-/test/a0908ae19763
-/test/a4c0b3decb33
-/test/accept
-/test/accept-link
-/test/accept-reuse
-/test/accept-test
-/test/across-fork
-/test/b19062a56726
-/test/b5837bd5311d
-/test/ce593a6c480a
-/test/close-opath
-/test/config.local
-/test/connect
-/test/cq-full
-/test/cq-overflow
-/test/cq-overflow-peek
-/test/cq-peek-batch
-/test/cq-ready
-/test/cq-size
-/test/d4ae271dfaae
-/test/d77a67ed5f27
-/test/defer
-/test/double-poll-crash
-/test/drop-submit
-/test/eeed8b54e0df
-/test/empty-eownerdead
-/test/eventfd
-/test/eventfd-disable
-/test/eventfd-reg
-/test/eventfd-ring
-/test/exit-no-cleanup
-/test/fadvise
-/test/fallocate
-/test/fc2a85cb02ef
-/test/file-register
-/test/file-update
-/test/file-verify
-/test/files-exit-hang-poll
-/test/files-exit-hang-timeout
-/test/fixed-buf-iter
-/test/fixed-link
-/test/fixed-reuse
-/test/fpos
-/test/fsync
-/test/hardlink
-/test/io-cancel
-/test/io_uring_enter
-/test/io_uring_register
-/test/io_uring_setup
-/test/iopoll
-/test/lfs-openat
-/test/lfs-openat-write
-/test/link
-/test/link-timeout
-/test/link_drain
-/test/madvise
-/test/mkdir
-/test/msg-ring
-/test/nop
-/test/nop-all-sizes
-/test/open-close
-/test/open-direct-link
-/test/openat2
-/test/personality
-/test/pipe-eof
-/test/pipe-reuse
-/test/poll
-/test/poll-cancel
-/test/poll-cancel-ton
-/test/poll-link
-/test/poll-many
-/test/poll-ring
-/test/poll-v-poll
-/test/pollfree
-/test/probe
-/test/read-write
-/test/recv-msgall
-/test/recv-msgall-stream
-/test/register-restrictions
-/test/rename
-/test/ring-leak
-/test/ring-leak2
-/test/self
-/test/send_recv
-/test/send_recvmsg
-/test/sendmsg_fs_cve
-/test/shared-wq
-/test/short-read
-/test/shutdown
-/test/sigfd-deadlock
-/test/socket-rw
-/test/socket-rw-eagain
-/test/socket-rw-offset
-/test/splice
-/test/sq-full
-/test/sq-full-cpp
-/test/sq-poll-dup
-/test/sq-poll-kthread
-/test/sq-poll-share
-/test/sqpoll-disable-exit
-/test/sqpoll-exit-hang
-/test/sqpoll-sleep
-/test/sq-space_left
-/test/statx
-/test/stdout
-/test/submit-reuse
-/test/symlink
-/test/teardowns
-/test/thread-exit
-/test/timeout
-/test/timeout-new
-/test/timeout-overflow
-/test/tty-write-dpoll
-/test/unlink
-/test/wakeup-hang
-/test/multicqes_drain
-/test/poll-mshot-update
-/test/rsrc_tags
-/test/rw_merge_test
-/test/sqpoll-cancel-hang
-/test/testfile
-/test/submit-link-fail
-/test/exec-target
-/test/skip-cqe
+/test/*.t
 /test/*.dmesg
 /test/output/
 
diff --git a/test/Makefile b/test/Makefile
index eb1e7d5..d97341c 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -183,7 +183,9 @@ endif
 all_targets += sq-full-cpp
 
 
-test_targets := $(patsubst %.c,%,$(patsubst %.cc,%,$(test_srcs)))
+test_targets := $(patsubst %.c,%,$(test_srcs))
+test_targets := $(patsubst %.cc,%,$(test_targets))
+test_targets := $(patsubst %,%.t,$(test_targets))
 all_targets += $(test_targets)
 
 #
@@ -204,10 +206,10 @@ all: $(test_targets)
 helpers.o: helpers.c
 	$(QUIET_CC)$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
 
-%: %.c $(helpers) helpers.h ../src/liburing.a
+%.t: %.c $(helpers) helpers.h ../src/liburing.a
 	$(QUIET_CC)$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $< $(helpers) $(LDFLAGS)
 
-%: %.cc $(helpers) helpers.h ../src/liburing.a
+%.t: %.cc $(helpers) helpers.h ../src/liburing.a
 	$(QUIET_CXX)$(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $< $(helpers) $(LDFLAGS)
 
 
-- 
Ammar Faizi


  parent reply	other threads:[~2022-04-03 18:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-03 18:21 [PATCH liburing v2 0/3] Simplify build for tests and gitignore cleanup Ammar Faizi
2022-04-03 18:21 ` [PATCH liburing v2 1/3] test: Rename `[0-9a-f]-test.c` to `[0-9a-f].c` Ammar Faizi
2022-04-03 18:21 ` [PATCH liburing v2 2/3] test/Makefile: Append `-lpthread` to `LDFLAGS` for all tests Ammar Faizi
2022-04-03 18:22 ` Ammar Faizi [this message]
2022-04-03 23:15 ` [PATCH liburing v2 0/3] Simplify build for tests and gitignore cleanup Jens Axboe
2022-04-03 23:20   ` Jens Axboe
2022-04-03 23:17 ` 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] \
    /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