linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: <linuxppc-dev@ozlabs.org>
Cc: Michael Neuling <mikey@neuling.org>
Subject: [PATCH 4/4] selftests/powerpc: Skip TM tests if we don't have TM
Date: Tue, 24 Nov 2015 13:05:41 +1100	[thread overview]
Message-ID: <1448330741-4804-4-git-send-email-mpe@ellerman.id.au> (raw)
In-Reply-To: <1448330741-4804-1-git-send-email-mpe@ellerman.id.au>

Make the newly added TM tests skip if we don't have TM available, either
because we're running on old hardware, or the kernel doesn't have TM
support enabled.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 tools/testing/selftests/powerpc/tm/Makefile             | 8 +++++---
 tools/testing/selftests/powerpc/tm/tm-signal-msr-resv.c | 3 +++
 tools/testing/selftests/powerpc/tm/tm-signal-stack.c    | 3 +++
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/powerpc/tm/Makefile b/tools/testing/selftests/powerpc/tm/Makefile
index 3e6e7aaa5312..578572a3700a 100644
--- a/tools/testing/selftests/powerpc/tm/Makefile
+++ b/tools/testing/selftests/powerpc/tm/Makefile
@@ -2,10 +2,12 @@ TEST_PROGS := tm-resched-dscr tm-syscall tm-signal-msr-resv tm-signal-stack
 
 all: $(TEST_PROGS)
 
-$(TEST_PROGS): ../harness.c
+$(TEST_PROGS): ../harness.c ../utils.c
 
-tm-syscall: tm-syscall-asm.S ../utils.c
-tm-syscall: CFLAGS += -mhtm -I../../../../../usr/include
+CFLAGS += -I../../../../../usr/include
+
+tm-syscall: tm-syscall-asm.S
+tm-syscall: CFLAGS += -mhtm
 
 include ../../lib.mk
 
diff --git a/tools/testing/selftests/powerpc/tm/tm-signal-msr-resv.c b/tools/testing/selftests/powerpc/tm/tm-signal-msr-resv.c
index bdad34803c06..a6589582b780 100644
--- a/tools/testing/selftests/powerpc/tm/tm-signal-msr-resv.c
+++ b/tools/testing/selftests/powerpc/tm/tm-signal-msr-resv.c
@@ -18,6 +18,7 @@
 #include <signal.h>
 #include <unistd.h>
 
+#include "tm.h"
 #include "utils.h"
 
 int segv_expected = 0;
@@ -49,6 +50,8 @@ int tm_signal_msr_resv()
 {
 	struct sigaction act;
 
+	SKIP_IF(!have_htm());
+
 	act.sa_sigaction = signal_usr1;
 	sigemptyset(&act.sa_mask);
 	act.sa_flags = SA_SIGINFO;
diff --git a/tools/testing/selftests/powerpc/tm/tm-signal-stack.c b/tools/testing/selftests/powerpc/tm/tm-signal-stack.c
index 62f2a5f108c6..82c29cb222dc 100644
--- a/tools/testing/selftests/powerpc/tm/tm-signal-stack.c
+++ b/tools/testing/selftests/powerpc/tm/tm-signal-stack.c
@@ -21,6 +21,7 @@
 #include <stdio.h>
 #include <signal.h>
 
+#include "tm.h"
 #include "utils.h"
 
 void signal_segv(int signum)
@@ -33,6 +34,8 @@ int tm_signal_stack()
 {
 	int pid;
 
+	SKIP_IF(!have_htm());
+
 	pid = fork();
 	if (pid < 0)
 		exit(1);
-- 
2.5.0

  parent reply	other threads:[~2015-11-24  2:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-24  2:05 [PATCH 1/4] selftests/powerpc: Move get_auxv_entry() into utils.c Michael Ellerman
2015-11-24  2:05 ` [PATCH 2/4] selftests/powerpc: Add have_hwcap2() helper Michael Ellerman
2015-12-15 11:27   ` [2/4] " Michael Ellerman
2015-11-24  2:05 ` [PATCH 3/4] selftests/powerpc: Move TM helpers into tm.h Michael Ellerman
2015-12-15 11:27   ` [3/4] " Michael Ellerman
2015-11-24  2:05 ` Michael Ellerman [this message]
2015-12-15 11:27 ` [1/4] selftests/powerpc: Move get_auxv_entry() into utils.c Michael Ellerman

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=1448330741-4804-4-git-send-email-mpe@ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mikey@neuling.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).