perfbook.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leonardo Bras <leobras.c@gmail.com>
To: paulmck@kernel.org
Cc: Leonardo Bras <leobras.c@gmail.com>, perfbook@vger.kernel.org
Subject: [PATCH v1 1/2] CodeSamples: Add check target to CodeSamples/ and count/ Makefiles
Date: Sat,  4 Feb 2023 00:36:26 -0300	[thread overview]
Message-ID: <20230204033627.67980-1-leobras.c@gmail.com> (raw)

Checking happens by running every program compiled from count/ without
arguments and checking if any failed.

In order to do that, introduce a 'check' target in
CodeSamples/count/Makefile.

Also, to allow further CodeSample testing in the future, make a global
'check' target on CodeSamples/Makefile.

Suggested-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Leonardo Bras <leobras.c@gmail.com>
---
 CodeSamples/Makefile       | 3 +++
 CodeSamples/count/Makefile | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/CodeSamples/Makefile b/CodeSamples/Makefile
index 38143638..2a433a22 100644
--- a/CodeSamples/Makefile
+++ b/CodeSamples/Makefile
@@ -66,5 +66,8 @@ ifneq ($(strip $(target)),)
 	cat arch-$(target)/Makefile.arch >> Makefile.arch
 endif
 
+check:
+	make -C count/ check
+
 clean:
 	rm -f Makefile.arch api.h
diff --git a/CodeSamples/count/Makefile b/CodeSamples/count/Makefile
index f54edc8c..8d5d4296 100644
--- a/CodeSamples/count/Makefile
+++ b/CodeSamples/count/Makefile
@@ -90,5 +90,8 @@ count_stat_eventual: count_stat_eventual.c ../api.h counttorture.h
 count_tstat: count_tstat.c ../api.h counttorture.h
 	$(CC) $(GCC_ARGS) $(CFLAGS) -o count_tstat count_tstat.c -lpthread
 
+check: $(PROGS)
+	$(foreach prog, $(PROGS), ./$(prog);)
+
 clean:
 	rm -f $(PROGS)
-- 
2.39.1


             reply	other threads:[~2023-02-04  3:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-04  3:36 Leonardo Bras [this message]
2023-02-04  3:36 ` [PATCH v1 2/2] utilities/gitlab-ci.yml: Add 'make check' on test_codesamples Leonardo Bras
2023-02-04  4:51   ` Paul E. McKenney
2023-02-04  6:09     ` Leonardo Brás
2023-02-04  7:00       ` Akira Yokosawa
2023-02-06 20:42         ` Leonardo Brás

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=20230204033627.67980-1-leobras.c@gmail.com \
    --to=leobras.c@gmail.com \
    --cc=paulmck@kernel.org \
    --cc=perfbook@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 read-only IMAP folder(s) and NNTP newsgroup(s).