xenomai.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Aaron Marcher <aaron@sigma-star.at>
To: xenomai@lists.linux.dev
Cc: richard@nod.at, florian.bezdeka@siemens.com,
	jan.kiszka@siemens.com, Aaron Marcher <aaron@sigma-star.at>
Subject: [PATCH 08/11] testsuite: Add a simple test driver for psostests
Date: Thu,  6 Apr 2023 12:33:38 +0200	[thread overview]
Message-ID: <20230406103341.2914-9-aaron@sigma-star.at> (raw)
In-Reply-To: <20230406103341.2914-1-aaron@sigma-star.at>

From: Richard Weinberger <richard@nod.at>

Just like for alchemytests.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 testsuite/psostests/Makefile.am       | 15 ++++-
 testsuite/psostests/psostest_driver.c | 85 +++++++++++++++++++++++++++
 2 files changed, 99 insertions(+), 1 deletion(-)
 create mode 100644 testsuite/psostests/psostest_driver.c

diff --git a/testsuite/psostests/Makefile.am b/testsuite/psostests/Makefile.am
index 9e8aef62b7..0a069837bc 100644
--- a/testsuite/psostests/Makefile.am
+++ b/testsuite/psostests/Makefile.am
@@ -2,7 +2,8 @@ testdir = @XENO_TEST_DIR@
 
 CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
 
-test_PROGRAMS = mq1	\
+test_PROGRAMS = psostest_driver \
+		mq1	\
 		mq2	\
 		mq3	\
 		pt1	\
@@ -151,3 +152,15 @@ task9_SOURCES = task-9.c
 task9_CPPFLAGS = $(psoscppflags)
 task9_LDADD = $(psosldadd) -lpthread -lrt -lm
 task9_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+psostest_driver_SOURCES = psostest_driver.c
+psostest_driver_CPPFLAGS =			\
+	$(XENO_USER_CFLAGS)			\
+	-I$(top_srcdir)/include
+psostest_driver_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostest_driver_LDADD =			\
+	../../lib/psos/libpsos@CORE@.la		\
+	../../lib/smokey/libsmokey@CORE@.la	\
+	@XENO_CORE_LDADD@		\
+	@XENO_USER_LDADD@		\
+	-lpthread -lrt
diff --git a/testsuite/psostests/psostest_driver.c b/testsuite/psostests/psostest_driver.c
new file mode 100644
index 0000000000..0f076e1bc6
--- /dev/null
+++ b/testsuite/psostests/psostest_driver.c
@@ -0,0 +1,85 @@
+#include <error.h>
+#include <libgen.h>
+#include <smokey/smokey.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+static char *mydir;
+
+#define TEST(name)								   \
+	smokey_test_plugin(name, SMOKEY_NOARGS, "Run external test");		   \
+	static int run_##name(struct smokey_test *t, int argc, char *const argv[]) \
+	{									   \
+		return __run_extprog(t, argc, argv);				   \
+	}
+
+static int __run_extprog(struct smokey_test *t, int argc, char *const argv[])
+{
+	int ret;
+	char *tst_path;
+
+	ret = asprintf(&tst_path, "%s/%s --cpu-affinity=0", mydir, t->name);
+	if (ret == -1)
+		return -ENOMEM;
+
+	ret = system(tst_path);
+	free(tst_path);
+
+	return ret;
+}
+
+TEST(mq1)
+TEST(mq2)
+TEST(mq3)
+TEST(pt1)
+TEST(rn1)
+TEST(sem1)
+TEST(sem2)
+TEST(task1)
+TEST(task2)
+TEST(task3)
+TEST(task4)
+TEST(task5)
+TEST(task6)
+TEST(task7)
+TEST(task8)
+TEST(task9)
+TEST(tm1)
+TEST(tm2)
+TEST(tm3)
+TEST(tm4)
+TEST(tm5)
+TEST(tm6)
+TEST(tm7)
+
+int main(int argc, char *const argv[])
+{
+	struct smokey_test *t;
+	int ret, fails = 0;
+
+	if (argc > 0)
+		mydir = dirname(argv[0]);
+	else
+		mydir = ".";
+
+	if (pvlist_empty(&smokey_test_list))
+		return 0;
+
+	for_each_smokey_test(t) {
+		ret = t->run(t, argc, argv);
+		if (ret) {
+			fails++;
+			if (smokey_keep_going)
+				continue;
+			if (smokey_verbose_mode)
+				error(1, -ret, "test %s failed", t->name);
+			return 1;
+		}
+		smokey_note("%s OK", t->name);
+	}
+
+	return fails != 0;
+}
-- 
2.35.3


  parent reply	other threads:[~2023-04-06 10:34 UTC|newest]

Thread overview: 112+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-13 21:58 [PATCH v2 0/9] Revive alchemy, pSOS and VxWorks tests Richard Weinberger
2022-04-13 21:58 ` [PATCH 1/9] testsuite: Move alchemy tests into testsuite/ Richard Weinberger
2022-04-13 21:58 ` [PATCH 2/9] testsuite: Hook up alchemytests Richard Weinberger
2022-04-13 21:58 ` [PATCH 3/9] testsuite: Add a simple test driver for alchemytests Richard Weinberger
2022-04-14 11:28   ` Jan Kiszka
2022-04-14 11:42     ` Richard Weinberger
2022-04-13 21:58 ` [PATCH 4/9] Remove old alchemy tests Makefile Richard Weinberger
2022-04-13 21:58 ` [PATCH 5/9] alchemytests: Fix gcc warning in buffer-1 Richard Weinberger
2022-04-13 21:58 ` [PATCH 6/9] alchemytests: Fix gcc warning in task-9 Richard Weinberger
2022-04-13 21:58 ` [PATCH 7/9] testsuite: Move pSOS tests into testsuite/ Richard Weinberger
2022-04-13 21:58 ` [PATCH 8/9] testsuite: Add a simple test driver for psostests Richard Weinberger
2022-04-13 21:58 ` [PATCH 9/9] testsuite: Integrate vwworks tests into testsuite/ Richard Weinberger
2022-04-14 11:18 ` [PATCH v2 0/9] Revive alchemy, pSOS and VxWorks tests Jan Kiszka
2022-04-14 11:29   ` Richard Weinberger
2022-04-14 12:58   ` Richard Weinberger
2022-04-14 14:15     ` Bezdeka, Florian
2022-04-14 14:19       ` Richard Weinberger
2022-04-14 15:13   ` Richard Weinberger
2022-04-14 15:34     ` Jan Kiszka
2022-04-14 15:41       ` Richard Weinberger
2022-04-14 15:43         ` Jan Kiszka
2023-04-06 10:33 ` [PATCH v3 0/11] " Aaron Marcher
2023-04-06 10:33   ` [PATCH 01/11] testsuite: Move alchemy tests into testsuite/ Aaron Marcher
2023-04-06 10:33   ` [PATCH 02/11] testsuite: Hook up alchemytests Aaron Marcher
2023-04-06 10:33   ` [PATCH 03/11] testsuite: Add a simple test driver for alchemytests Aaron Marcher
2023-04-06 10:33   ` [PATCH 04/11] Remove old alchemy tests Makefile Aaron Marcher
2023-04-06 10:33   ` [PATCH 05/11] alchemytests: Fix gcc warning in buffer-1 Aaron Marcher
2023-04-06 10:33   ` [PATCH 06/11] alchemytests: Fix gcc warning in task-9 Aaron Marcher
2023-04-06 10:33   ` [PATCH 07/11] testsuite: Move pSOS tests into testsuite/ Aaron Marcher
2023-04-06 10:33   ` Aaron Marcher [this message]
2023-04-06 10:33   ` [PATCH 09/11] testsuite: Integrate vwworks " Aaron Marcher
2023-04-06 10:33   ` [PATCH 10/11] alchemytests: check pipe-1 asprintf ret value Aaron Marcher
2023-04-06 10:33   ` [PATCH 11/11] vxworkstests: fix Makefile.am reference Aaron Marcher
2023-04-16  7:33     ` Jan Kiszka
2023-04-16  7:32   ` [PATCH v3 0/11] Revive alchemy, pSOS and VxWorks tests Jan Kiszka
2023-04-16  7:41     ` Jan Kiszka
2023-04-16  9:03       ` Richard Weinberger
2023-05-17  7:30     ` Aaron Marcher
2023-05-17  9:35       ` Jan Kiszka
2023-05-20 14:57         ` Florian Bezdeka
2023-07-20 14:51   ` [PATCH v4 00/10] " Aaron Marcher
2023-07-20 14:51     ` [PATCH 01/10] testsuite: Fully integrate alchemytests into smokey Aaron Marcher
2023-07-20 16:50       ` Jan Kiszka
2023-07-20 14:51     ` [PATCH 02/10] testsuite: Fully integrate psostests " Aaron Marcher
2023-07-20 14:51     ` [PATCH 03/10] testsuite: Fully integrate vwworkstests " Aaron Marcher
2023-07-20 14:51     ` [PATCH 04/10] testsuite: Remove old alchemytests Makefile Aaron Marcher
2023-07-20 14:51     ` [PATCH 05/10] alchemytests: Fix gcc warning in buffer-1 Aaron Marcher
2023-07-20 14:51     ` [PATCH 06/10] alchemytests: Fix gcc warning in task-9 Aaron Marcher
2023-07-20 14:51     ` [PATCH 07/10] alchemytests: Check pipe-1 asprintf ret value Aaron Marcher
2023-07-20 14:51     ` [PATCH 08/10] alchemytests: Fix task-2 Aaron Marcher
2023-07-20 14:51     ` [PATCH 09/10] alchemytests: Fix task-5 logic Aaron Marcher
2023-07-20 14:51     ` [PATCH 10/10] testsuite: disable broken tests Aaron Marcher
2023-07-20 14:54     ` [PATCH v4 00/10] Revive alchemy, pSOS and VxWorks tests Jan Kiszka
2023-07-20 15:01       ` Aaron Marcher
2023-07-24 13:52     ` [PATCH v5 " Aaron Marcher
2023-07-24 13:52       ` [PATCH 01/10] testsuite: Fully integrate alchemytests into smokey Aaron Marcher
2023-08-10  7:07         ` Florian Bezdeka
2023-08-11 17:32           ` Jan Kiszka
2023-08-16 12:43             ` Aaron Marcher
2023-09-14  7:41               ` Jan Kiszka
2023-09-20 13:52                 ` [PATCH 0/5] Improvements for smokey skintests Aaron Marcher
2023-09-20 13:52                   ` [PATCH 1/5] lib: Add smokey_run_extprog as helper for testsuite Aaron Marcher
2023-09-22 15:49                     ` Jan Kiszka
2023-09-22 21:03                       ` Richard Weinberger
2023-09-25 13:03                       ` [PATCH] lib: Drop cpu-affinity=0 from skin-tests helper Aaron Marcher
2023-09-25 15:04                         ` Philippe Gerum
2023-09-25 15:12                         ` [PATCH 0/1 V2] " Aaron Marcher
2023-09-25 15:12                           ` [PATCH 1/1] " Aaron Marcher
2023-09-25 15:42                             ` Jan Kiszka
2023-09-28 17:04                               ` Jan Kiszka
2023-09-28 17:30                                 ` Jan Kiszka
2023-09-29 12:12                               ` Aaron Marcher
2023-09-29 12:34                                 ` Jan Kiszka
2023-09-20 13:52                   ` [PATCH 2/5] testsuite: Merge alchemytests in single smokey case Aaron Marcher
2023-09-20 13:52                   ` [PATCH 3/5] testsuite: Merge psostests in a " Aaron Marcher
2023-09-20 13:52                   ` [PATCH 4/5] testsuite: Merge vxworkstests " Aaron Marcher
2023-09-20 13:52                   ` [PATCH 5/5] testsuite: Drop skin test "drivers" Aaron Marcher
2023-09-22 15:52                   ` [PATCH 0/5] Improvements for smokey skintests Jan Kiszka
2023-09-20 14:00                 ` [PATCH 01/10] testsuite: Fully integrate alchemytests into smokey Aaron Marcher
2023-08-16 12:41           ` Aaron Marcher
2023-08-16 14:19             ` Jan Kiszka
2023-07-24 13:52       ` [PATCH 02/10] testsuite: Fully integrate psostests " Aaron Marcher
2023-07-24 13:52       ` [PATCH 03/10] testsuite: Fully integrate vwworkstests " Aaron Marcher
2023-07-24 13:52       ` [PATCH 04/10] testsuite: Remove old alchemytests Makefile Aaron Marcher
2023-07-24 13:52       ` [PATCH 05/10] alchemytests: Fix gcc warning in buffer-1 Aaron Marcher
2023-07-24 13:52       ` [PATCH 06/10] alchemytests: Fix gcc warning in task-9 Aaron Marcher
2023-07-24 13:52       ` [PATCH 07/10] alchemytests: Check pipe-1 asprintf ret value Aaron Marcher
2023-07-24 13:52       ` [PATCH 08/10] alchemytests: Fix task-2 Aaron Marcher
2023-07-24 14:39         ` Richard Weinberger
2023-07-25  8:29           ` [PATCH v6 00/10] Revive alchemy, pSOS and VxWorks tests Aaron Marcher
2023-07-25  8:29             ` [PATCH 01/10] testsuite: Fully integrate alchemytests into smokey Aaron Marcher
2023-08-09  7:28               ` Jan Kiszka
2023-08-09 11:32               ` [PATCH v7 " Jan Kiszka
2023-07-25  8:29             ` [PATCH 02/10] testsuite: Fully integrate psostests " Aaron Marcher
2023-08-09 11:32               ` [PATCH v7 " Jan Kiszka
2023-07-25  8:29             ` [PATCH 03/10] testsuite: Fully integrate vwworkstests " Aaron Marcher
2023-08-09 11:32               ` [PATCH v7 " Jan Kiszka
2023-08-09 15:02                 ` Jan Kiszka
2023-07-25  8:29             ` [PATCH 04/10] testsuite: Remove old alchemytests Makefile Aaron Marcher
2023-07-25  8:29             ` [PATCH 05/10] alchemytests: Fix gcc warning in buffer-1 Aaron Marcher
2023-07-25  8:29             ` [PATCH 06/10] alchemytests: Fix gcc warning in task-9 Aaron Marcher
2023-07-25  8:29             ` [PATCH 07/10] alchemytests: Check pipe-1 asprintf ret value Aaron Marcher
2023-07-25  8:29             ` [PATCH 08/10] alchemytests: Fix task-2 Aaron Marcher
2023-07-25  8:29             ` [PATCH 09/10] alchemytests: Fix task-5 logic Aaron Marcher
2023-07-25  8:29             ` [PATCH 10/10] testsuite: disable broken tests Aaron Marcher
2023-08-03 15:35             ` [PATCH v6 00/10] Revive alchemy, pSOS and VxWorks tests Florian Bezdeka
2023-08-09  7:36             ` Jan Kiszka
2023-08-09 11:33               ` Jan Kiszka
2023-08-16 12:37                 ` Aaron Marcher
2023-08-09 11:32             ` [PATCH v7 11/10] testsuite/smokey: Hook up new tests Jan Kiszka
2023-07-24 13:52       ` [PATCH 09/10] alchemytests: Fix task-5 logic Aaron Marcher
2023-07-24 13:52       ` [PATCH 10/10] testsuite: disable broken tests Aaron Marcher

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=20230406103341.2914-9-aaron@sigma-star.at \
    --to=aaron@sigma-star.at \
    --cc=florian.bezdeka@siemens.com \
    --cc=jan.kiszka@siemens.com \
    --cc=richard@nod.at \
    --cc=xenomai@lists.linux.dev \
    /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).