All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] Revive alchemy tests
@ 2022-04-08  8:03 Richard Weinberger
  2022-04-08  8:03 ` [PATCH 1/6] testsuite: Move alchemy tests into testsuite/ Richard Weinberger
                   ` (6 more replies)
  0 siblings, 7 replies; 20+ messages in thread
From: Richard Weinberger @ 2022-04-08  8:03 UTC (permalink / raw)
  To: xenomai; +Cc: Richard Weinberger

This patch series is a first attempt to integrate the currently abandoned
alchemy tests into Xenomai's test suite.
Since each test assumes running as own process a test driver is needed
which executes each tests separately.
The driver makes use of the smokey framework.


Richard Weinberger (6):
  testsuite: Move alchemy tests into testsuite/
  testsuite: Hook up alchemytests
  testsuite: Add a simple test driver for alchemytests
  Remove old alchemy tests Makefile
  alchemytests: Fix gcc warning in buffer-1
  alchemytests: Fix gcc warning in task-9

 configure.ac                                  |   1 +
 lib/alchemy/testsuite/Makefile                |  70 --------
 testsuite/Makefile.am                         |   6 +-
 testsuite/alchemytests/Makefile.am            | 159 ++++++++++++++++++
 .../alchemytests}/alarm-1.c                   |   0
 testsuite/alchemytests/alchemytest_driver.c   |  84 +++++++++
 .../alchemytests}/buffer-1.c                  |   2 +-
 .../alchemytests}/event-1.c                   |   0
 .../alchemytests}/heap-1.c                    |   0
 .../alchemytests}/heap-2.c                    |   0
 .../alchemytests}/mq-1.c                      |   0
 .../alchemytests}/mq-2.c                      |   0
 .../alchemytests}/mq-3.c                      |   0
 .../alchemytests}/mutex-1.c                   |   0
 .../alchemytests}/pipe-1.c                    |   0
 .../alchemytests}/sem-1.c                     |   0
 .../alchemytests}/sem-2.c                     |   0
 .../alchemytests}/task-1.c                    |   0
 .../alchemytests}/task-10.c                   |   0
 .../alchemytests}/task-2.c                    |   0
 .../alchemytests}/task-3.c                    |   0
 .../alchemytests}/task-4.c                    |   0
 .../alchemytests}/task-5.c                    |   0
 .../alchemytests}/task-6.c                    |   0
 .../alchemytests}/task-7.c                    |   0
 .../alchemytests}/task-8.c                    |   0
 .../alchemytests}/task-9.c                    |   2 +-
 27 files changed, 250 insertions(+), 74 deletions(-)
 delete mode 100644 lib/alchemy/testsuite/Makefile
 create mode 100644 testsuite/alchemytests/Makefile.am
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/alarm-1.c (100%)
 create mode 100644 testsuite/alchemytests/alchemytest_driver.c
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/buffer-1.c (99%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/event-1.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/heap-1.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/heap-2.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/mq-1.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/mq-2.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/mq-3.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/mutex-1.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/pipe-1.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/sem-1.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/sem-2.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/task-1.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/task-10.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/task-2.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/task-3.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/task-4.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/task-5.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/task-6.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/task-7.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/task-8.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/task-9.c (97%)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 1/6] testsuite: Move alchemy tests into testsuite/
  2022-04-08  8:03 [PATCH 0/6] Revive alchemy tests Richard Weinberger
@ 2022-04-08  8:03 ` Richard Weinberger
  2022-04-08  8:03 ` [PATCH 2/6] testsuite: Hook up alchemytests Richard Weinberger
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 20+ messages in thread
From: Richard Weinberger @ 2022-04-08  8:03 UTC (permalink / raw)
  To: xenomai; +Cc: Richard Weinberger

This is the very first step to have the alchemy tests embedded
into our testsuite.

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 {lib/alchemy/testsuite => testsuite/alchemytests}/alarm-1.c  | 0
 {lib/alchemy/testsuite => testsuite/alchemytests}/buffer-1.c | 0
 {lib/alchemy/testsuite => testsuite/alchemytests}/event-1.c  | 0
 {lib/alchemy/testsuite => testsuite/alchemytests}/heap-1.c   | 0
 {lib/alchemy/testsuite => testsuite/alchemytests}/heap-2.c   | 0
 {lib/alchemy/testsuite => testsuite/alchemytests}/mq-1.c     | 0
 {lib/alchemy/testsuite => testsuite/alchemytests}/mq-2.c     | 0
 {lib/alchemy/testsuite => testsuite/alchemytests}/mq-3.c     | 0
 {lib/alchemy/testsuite => testsuite/alchemytests}/mutex-1.c  | 0
 {lib/alchemy/testsuite => testsuite/alchemytests}/pipe-1.c   | 0
 {lib/alchemy/testsuite => testsuite/alchemytests}/sem-1.c    | 0
 {lib/alchemy/testsuite => testsuite/alchemytests}/sem-2.c    | 0
 {lib/alchemy/testsuite => testsuite/alchemytests}/task-1.c   | 0
 {lib/alchemy/testsuite => testsuite/alchemytests}/task-10.c  | 0
 {lib/alchemy/testsuite => testsuite/alchemytests}/task-2.c   | 0
 {lib/alchemy/testsuite => testsuite/alchemytests}/task-3.c   | 0
 {lib/alchemy/testsuite => testsuite/alchemytests}/task-4.c   | 0
 {lib/alchemy/testsuite => testsuite/alchemytests}/task-5.c   | 0
 {lib/alchemy/testsuite => testsuite/alchemytests}/task-6.c   | 0
 {lib/alchemy/testsuite => testsuite/alchemytests}/task-7.c   | 0
 {lib/alchemy/testsuite => testsuite/alchemytests}/task-8.c   | 0
 {lib/alchemy/testsuite => testsuite/alchemytests}/task-9.c   | 0
 22 files changed, 0 insertions(+), 0 deletions(-)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/alarm-1.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/buffer-1.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/event-1.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/heap-1.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/heap-2.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/mq-1.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/mq-2.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/mq-3.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/mutex-1.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/pipe-1.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/sem-1.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/sem-2.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/task-1.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/task-10.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/task-2.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/task-3.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/task-4.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/task-5.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/task-6.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/task-7.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/task-8.c (100%)
 rename {lib/alchemy/testsuite => testsuite/alchemytests}/task-9.c (100%)

diff --git a/lib/alchemy/testsuite/alarm-1.c b/testsuite/alchemytests/alarm-1.c
similarity index 100%
rename from lib/alchemy/testsuite/alarm-1.c
rename to testsuite/alchemytests/alarm-1.c
diff --git a/lib/alchemy/testsuite/buffer-1.c b/testsuite/alchemytests/buffer-1.c
similarity index 100%
rename from lib/alchemy/testsuite/buffer-1.c
rename to testsuite/alchemytests/buffer-1.c
diff --git a/lib/alchemy/testsuite/event-1.c b/testsuite/alchemytests/event-1.c
similarity index 100%
rename from lib/alchemy/testsuite/event-1.c
rename to testsuite/alchemytests/event-1.c
diff --git a/lib/alchemy/testsuite/heap-1.c b/testsuite/alchemytests/heap-1.c
similarity index 100%
rename from lib/alchemy/testsuite/heap-1.c
rename to testsuite/alchemytests/heap-1.c
diff --git a/lib/alchemy/testsuite/heap-2.c b/testsuite/alchemytests/heap-2.c
similarity index 100%
rename from lib/alchemy/testsuite/heap-2.c
rename to testsuite/alchemytests/heap-2.c
diff --git a/lib/alchemy/testsuite/mq-1.c b/testsuite/alchemytests/mq-1.c
similarity index 100%
rename from lib/alchemy/testsuite/mq-1.c
rename to testsuite/alchemytests/mq-1.c
diff --git a/lib/alchemy/testsuite/mq-2.c b/testsuite/alchemytests/mq-2.c
similarity index 100%
rename from lib/alchemy/testsuite/mq-2.c
rename to testsuite/alchemytests/mq-2.c
diff --git a/lib/alchemy/testsuite/mq-3.c b/testsuite/alchemytests/mq-3.c
similarity index 100%
rename from lib/alchemy/testsuite/mq-3.c
rename to testsuite/alchemytests/mq-3.c
diff --git a/lib/alchemy/testsuite/mutex-1.c b/testsuite/alchemytests/mutex-1.c
similarity index 100%
rename from lib/alchemy/testsuite/mutex-1.c
rename to testsuite/alchemytests/mutex-1.c
diff --git a/lib/alchemy/testsuite/pipe-1.c b/testsuite/alchemytests/pipe-1.c
similarity index 100%
rename from lib/alchemy/testsuite/pipe-1.c
rename to testsuite/alchemytests/pipe-1.c
diff --git a/lib/alchemy/testsuite/sem-1.c b/testsuite/alchemytests/sem-1.c
similarity index 100%
rename from lib/alchemy/testsuite/sem-1.c
rename to testsuite/alchemytests/sem-1.c
diff --git a/lib/alchemy/testsuite/sem-2.c b/testsuite/alchemytests/sem-2.c
similarity index 100%
rename from lib/alchemy/testsuite/sem-2.c
rename to testsuite/alchemytests/sem-2.c
diff --git a/lib/alchemy/testsuite/task-1.c b/testsuite/alchemytests/task-1.c
similarity index 100%
rename from lib/alchemy/testsuite/task-1.c
rename to testsuite/alchemytests/task-1.c
diff --git a/lib/alchemy/testsuite/task-10.c b/testsuite/alchemytests/task-10.c
similarity index 100%
rename from lib/alchemy/testsuite/task-10.c
rename to testsuite/alchemytests/task-10.c
diff --git a/lib/alchemy/testsuite/task-2.c b/testsuite/alchemytests/task-2.c
similarity index 100%
rename from lib/alchemy/testsuite/task-2.c
rename to testsuite/alchemytests/task-2.c
diff --git a/lib/alchemy/testsuite/task-3.c b/testsuite/alchemytests/task-3.c
similarity index 100%
rename from lib/alchemy/testsuite/task-3.c
rename to testsuite/alchemytests/task-3.c
diff --git a/lib/alchemy/testsuite/task-4.c b/testsuite/alchemytests/task-4.c
similarity index 100%
rename from lib/alchemy/testsuite/task-4.c
rename to testsuite/alchemytests/task-4.c
diff --git a/lib/alchemy/testsuite/task-5.c b/testsuite/alchemytests/task-5.c
similarity index 100%
rename from lib/alchemy/testsuite/task-5.c
rename to testsuite/alchemytests/task-5.c
diff --git a/lib/alchemy/testsuite/task-6.c b/testsuite/alchemytests/task-6.c
similarity index 100%
rename from lib/alchemy/testsuite/task-6.c
rename to testsuite/alchemytests/task-6.c
diff --git a/lib/alchemy/testsuite/task-7.c b/testsuite/alchemytests/task-7.c
similarity index 100%
rename from lib/alchemy/testsuite/task-7.c
rename to testsuite/alchemytests/task-7.c
diff --git a/lib/alchemy/testsuite/task-8.c b/testsuite/alchemytests/task-8.c
similarity index 100%
rename from lib/alchemy/testsuite/task-8.c
rename to testsuite/alchemytests/task-8.c
diff --git a/lib/alchemy/testsuite/task-9.c b/testsuite/alchemytests/task-9.c
similarity index 100%
rename from lib/alchemy/testsuite/task-9.c
rename to testsuite/alchemytests/task-9.c
-- 
2.34.1



^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 2/6] testsuite: Hook up alchemytests
  2022-04-08  8:03 [PATCH 0/6] Revive alchemy tests Richard Weinberger
  2022-04-08  8:03 ` [PATCH 1/6] testsuite: Move alchemy tests into testsuite/ Richard Weinberger
@ 2022-04-08  8:03 ` Richard Weinberger
  2022-04-14 11:12   ` Jan Kiszka
  2022-04-08  8:03 ` [PATCH 3/6] testsuite: Add a simple test driver for alchemytests Richard Weinberger
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 20+ messages in thread
From: Richard Weinberger @ 2022-04-08  8:03 UTC (permalink / raw)
  To: xenomai; +Cc: Richard Weinberger

Build them using Xenomai's build system.

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 configure.ac                       |   1 +
 testsuite/Makefile.am              |   6 +-
 testsuite/alchemytests/Makefile.am | 148 +++++++++++++++++++++++++++++
 3 files changed, 153 insertions(+), 2 deletions(-)
 create mode 100644 testsuite/alchemytests/Makefile.am

diff --git a/configure.ac b/configure.ac
index 019453793..8fd86e5a1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1046,6 +1046,7 @@ AC_CONFIG_FILES([ \
 	testsuite/smokey/can/Makefile
 	testsuite/clocktest/Makefile \
 	testsuite/xeno-test/Makefile \
+	testsuite/alchemytests/Makefile \
 	utils/Makefile \
 	utils/hdb/Makefile \
 	utils/can/Makefile \
diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
index 4932f6d33..e027485fb 100644
--- a/testsuite/Makefile.am
+++ b/testsuite/Makefile.am
@@ -7,7 +7,8 @@ SUBDIRS += 		\
 	gpiotest	\
 	spitest		\
 	switchtest	\
-	xeno-test
+	xeno-test	\
+	alchemytests
 endif
 
 DIST_SUBDIRS =		\
@@ -18,4 +19,5 @@ DIST_SUBDIRS =		\
 	smokey		\
 	spitest		\
 	switchtest	\
-	xeno-test
+	xeno-test	\
+	alchemytests
diff --git a/testsuite/alchemytests/Makefile.am b/testsuite/alchemytests/Makefile.am
new file mode 100644
index 000000000..35df0d49c
--- /dev/null
+++ b/testsuite/alchemytests/Makefile.am
@@ -0,0 +1,148 @@
+testdir = @XENO_TEST_DIR@
+
+CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
+
+test_PROGRAMS = alchemytest_driver \
+		alarm1		   \
+		buffer1		   \
+		event1		   \
+		heap1		   \
+		heap2		   \
+		mq1		   \
+		mq2		   \
+		mq3		   \
+		mutex1		   \
+		pipe1		   \
+		sem1		   \
+		sem2		   \
+		task1		   \
+		task2		   \
+		task3		   \
+		task4		   \
+		task5		   \
+		task6		   \
+		task7		   \
+		task8		   \
+		task9		   \
+		task10
+
+alchemycppflags = 				\
+	$(XENO_USER_CFLAGS)		\
+	-I$(top_srcdir)/include
+
+alchemyldadd = 					\
+	../../lib/alchemy/libalchemy@CORE@.la		\
+	../../lib/copperplate/libcopperplate@CORE@.la	\
+	@XENO_CORE_LDADD@ 			\
+	@XENO_USER_LDADD@			\
+	-lpthread -lrt -lm
+
+alarm1_SOURCES = alarm-1.c
+alarm1_CPPFLAGS = $(alchemycppflags)
+alarm1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alarm1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+event1_SOURCES = event-1.c
+event1_CPPFLAGS = $(alchemycppflags)
+event1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+event1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+heap1_SOURCES = heap-1.c
+heap1_CPPFLAGS = $(alchemycppflags)
+heap1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+heap1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+heap2_SOURCES = heap-2.c
+heap2_CPPFLAGS = $(alchemycppflags)
+heap2_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+heap2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+buffer1_SOURCES = buffer-1.c
+buffer1_CPPFLAGS = $(alchemycppflags)
+buffer1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+buffer1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+mutex1_SOURCES = mutex-1.c
+mutex1_CPPFLAGS = $(alchemycppflags)
+mutex1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+mutex1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+pipe1_SOURCES = pipe-1.c
+pipe1_CPPFLAGS = $(alchemycppflags)
+pipe1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+pipe1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+mq1_SOURCES = mq-1.c
+mq1_CPPFLAGS = $(alchemycppflags)
+mq1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+mq1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+mq2_SOURCES = mq-2.c
+mq2_CPPFLAGS = $(alchemycppflags)
+mq2_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+mq2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+mq3_SOURCES = mq-3.c
+mq3_CPPFLAGS = $(alchemycppflags)
+mq3_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+mq3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+sem1_SOURCES = sem-1.c
+sem1_CPPFLAGS = $(alchemycppflags)
+sem1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+sem1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+sem2_SOURCES = sem-2.c
+sem2_CPPFLAGS = $(alchemycppflags)
+sem2_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+sem2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task1_SOURCES = task-1.c
+task1_CPPFLAGS = $(alchemycppflags)
+task1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+task1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task2_SOURCES = task-2.c
+task2_CPPFLAGS = $(alchemycppflags)
+task2_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+task2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task3_SOURCES = task-3.c
+task3_CPPFLAGS = $(alchemycppflags)
+task3_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+task3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task4_SOURCES = task-4.c
+task4_CPPFLAGS = $(alchemycppflags)
+task4_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+task4_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task5_SOURCES = task-5.c
+task5_CPPFLAGS = $(alchemycppflags)
+task5_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+task5_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task6_SOURCES = task-6.c
+task6_CPPFLAGS = $(alchemycppflags)
+task6_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+task6_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task7_SOURCES = task-7.c
+task7_CPPFLAGS = $(alchemycppflags)
+task7_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+task7_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task8_SOURCES = task-8.c
+task8_CPPFLAGS = $(alchemycppflags)
+task8_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+task8_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task9_SOURCES = task-9.c
+task9_CPPFLAGS = $(alchemycppflags)
+task9_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+task9_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task10_SOURCES = task-10.c
+task10_CPPFLAGS = $(alchemycppflags)
+task10_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+task10_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 3/6] testsuite: Add a simple test driver for alchemytests
  2022-04-08  8:03 [PATCH 0/6] Revive alchemy tests Richard Weinberger
  2022-04-08  8:03 ` [PATCH 1/6] testsuite: Move alchemy tests into testsuite/ Richard Weinberger
  2022-04-08  8:03 ` [PATCH 2/6] testsuite: Hook up alchemytests Richard Weinberger
@ 2022-04-08  8:03 ` Richard Weinberger
  2022-04-08  9:11   ` Bezdeka, Florian
  2022-04-08  8:03 ` [PATCH 4/6] Remove old alchemy tests Makefile Richard Weinberger
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 20+ messages in thread
From: Richard Weinberger @ 2022-04-08  8:03 UTC (permalink / raw)
  To: xenomai; +Cc: Richard Weinberger

In their current shape, every alchemy test has to be a single
program and does not use the smokey test framework.

alchemytest_driver uses smokey and runs each test as new process.

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 testsuite/alchemytests/Makefile.am          | 11 +++
 testsuite/alchemytests/alchemytest_driver.c | 84 +++++++++++++++++++++
 2 files changed, 95 insertions(+)
 create mode 100644 testsuite/alchemytests/alchemytest_driver.c

diff --git a/testsuite/alchemytests/Makefile.am b/testsuite/alchemytests/Makefile.am
index 35df0d49c..9159a0b77 100644
--- a/testsuite/alchemytests/Makefile.am
+++ b/testsuite/alchemytests/Makefile.am
@@ -146,3 +146,14 @@ task10_SOURCES = task-10.c
 task10_CPPFLAGS = $(alchemycppflags)
 task10_LDADD = $(alchemyldadd) -lpthread -lrt -lm
 task10_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+alchemytest_driver_SOURCES = alchemytest_driver.c
+alchemytest_driver_CPPFLAGS =			\
+	$(XENO_USER_CFLAGS)			\
+	-I$(top_srcdir)/include
+alchemytest_driver_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytest_driver_LDADD =			\
+	../../lib/smokey/libsmokey@CORE@.la	\
+	@XENO_CORE_LDADD@		\
+	@XENO_USER_LDADD@		\
+	-lpthread -lrt
diff --git a/testsuite/alchemytests/alchemytest_driver.c b/testsuite/alchemytests/alchemytest_driver.c
new file mode 100644
index 000000000..45323507d
--- /dev/null
+++ b/testsuite/alchemytests/alchemytest_driver.c
@@ -0,0 +1,84 @@
+#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(alarm1)
+TEST(buffer1)
+TEST(event1)
+TEST(heap1)
+TEST(heap2)
+TEST(mq1)
+TEST(mq2)
+TEST(mq3)
+TEST(mutex1)
+TEST(pipe1)
+TEST(sem1)
+TEST(sem2)
+TEST(task1)
+TEST(task2)
+TEST(task3)
+TEST(task4)
+TEST(task5)
+TEST(task6)
+TEST(task7)
+TEST(task8)
+TEST(task9)
+TEST(task10)
+
+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.34.1



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 4/6] Remove old alchemy tests Makefile
  2022-04-08  8:03 [PATCH 0/6] Revive alchemy tests Richard Weinberger
                   ` (2 preceding siblings ...)
  2022-04-08  8:03 ` [PATCH 3/6] testsuite: Add a simple test driver for alchemytests Richard Weinberger
@ 2022-04-08  8:03 ` Richard Weinberger
  2022-04-08  8:04 ` [PATCH 5/6] alchemytests: Fix gcc warning in buffer-1 Richard Weinberger
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 20+ messages in thread
From: Richard Weinberger @ 2022-04-08  8:03 UTC (permalink / raw)
  To: xenomai; +Cc: Richard Weinberger

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 lib/alchemy/testsuite/Makefile | 70 ----------------------------------
 1 file changed, 70 deletions(-)
 delete mode 100644 lib/alchemy/testsuite/Makefile

diff --git a/lib/alchemy/testsuite/Makefile b/lib/alchemy/testsuite/Makefile
deleted file mode 100644
index a831c999e..000000000
--- a/lib/alchemy/testsuite/Makefile
+++ /dev/null
@@ -1,70 +0,0 @@
-ifeq ($(DESTDIR),)
-XENO_CONFIG=xeno-config
-else
-XENO_CONFIG=$(DESTDIR)/bin/xeno-config
-endif
-
-prefix := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --prefix)
-solibs := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --libdir)
-core := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --core)
-
-ifeq ($(prefix),)
-$(error Please add <xenomai-install-path>/bin to your PATH variable or specify DESTDIR)
-endif
-
-cobalt-only := pipe-1
-mercury-only :=
-core-specific = $($(core)-only)
-
-TESTS :=		\
-	task-1		\
-	task-2		\
-	task-3		\
-	task-4		\
-	task-5		\
-	task-6		\
-	task-7		\
-	task-8		\
-	task-9		\
-	task-10		\
-	mq-1		\
-	mq-2		\
-	mq-3		\
-	alarm-1		\
-	sem-1		\
-	sem-2		\
-	mutex-1		\
-	event-1		\
-	heap-1		\
-	heap-2		\
-	buffer-1	\
-	$(core-specific)
-
-CFLAGS := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --skin=alchemy --cflags) -g
-LDFLAGS := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --skin=alchemy --ldflags)
-CC = $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --cc)
-
-all: $(TESTS)
-
-%: %.c
-	$(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
-
-install: all
-	install -d $(prefix)/testsuite/alchemy
-	install -t $(prefix)/testsuite/alchemy $(TESTS)
-
-clean:
-	$(RM) $(TESTS) *~
-
-# Run the test suite. We pin all tests to CPU #0, so that SMP does not
-# alter the execution sequence we expect from them.
-test: all
-	@for t in $(TESTS); do \
-		echo -n $$t...; \
-		sudo LD_LIBRARY_PATH=$(solibs) $(VALGRIND) ./$$t --cpu-affinity=0 --silent && echo ok || echo BAD; \
-	done
-
-test/%: %
-	sudo LD_LIBRARY_PATH=$(solibs) $(VALGRIND) ./$(@F) --cpu-affinity=0 --silent && echo ok || echo BAD
-
-.PHONY: clean test
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 5/6] alchemytests: Fix gcc warning in buffer-1
  2022-04-08  8:03 [PATCH 0/6] Revive alchemy tests Richard Weinberger
                   ` (3 preceding siblings ...)
  2022-04-08  8:03 ` [PATCH 4/6] Remove old alchemy tests Makefile Richard Weinberger
@ 2022-04-08  8:04 ` Richard Weinberger
  2022-04-08  8:04 ` [PATCH 6/6] alchemytests: Fix gcc warning in task-9 Richard Weinberger
  2022-04-13 12:56 ` [PATCH 0/6] Revive alchemy tests Jan Kiszka
  6 siblings, 0 replies; 20+ messages in thread
From: Richard Weinberger @ 2022-04-08  8:04 UTC (permalink / raw)
  To: xenomai; +Cc: Richard Weinberger

Make n an unsigned integer, such that gcc realizes that "%.2d" cannot
become negative and will fit into our 3 bytes buffer.

Fixes:
buffer-1.c:64:15: error: ‘%.2d’ directive writing between 2 and 10 bytes into a region of size 3 [-Werror=format-overflow=]
   sprintf(s, "%.2d", 11 * n);
               ^~~~

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 testsuite/alchemytests/buffer-1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testsuite/alchemytests/buffer-1.c b/testsuite/alchemytests/buffer-1.c
index d6d1d9ad7..807db1dcf 100644
--- a/testsuite/alchemytests/buffer-1.c
+++ b/testsuite/alchemytests/buffer-1.c
@@ -49,7 +49,7 @@ static void background_task(void *arg)
 {
 	char c = 'A', s[3];
 	ssize_t ret;
-	int n = 0;
+	unsigned int n = 0;
 
 	traceobj_enter(&trobj);
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 6/6] alchemytests: Fix gcc warning in task-9
  2022-04-08  8:03 [PATCH 0/6] Revive alchemy tests Richard Weinberger
                   ` (4 preceding siblings ...)
  2022-04-08  8:04 ` [PATCH 5/6] alchemytests: Fix gcc warning in buffer-1 Richard Weinberger
@ 2022-04-08  8:04 ` Richard Weinberger
  2022-04-13 12:56 ` [PATCH 0/6] Revive alchemy tests Jan Kiszka
  6 siblings, 0 replies; 20+ messages in thread
From: Richard Weinberger @ 2022-04-08  8:04 UTC (permalink / raw)
  To: xenomai; +Cc: Richard Weinberger

Make it static, no prototype needed anymore.

Fixes:
task-9.c:13:6: error: no previous prototype for ‘sighandler’ [-Werror=missing-prototypes]
 void sighandler(int sig)

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 testsuite/alchemytests/task-9.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testsuite/alchemytests/task-9.c b/testsuite/alchemytests/task-9.c
index e358154c5..4b62a17be 100644
--- a/testsuite/alchemytests/task-9.c
+++ b/testsuite/alchemytests/task-9.c
@@ -10,7 +10,7 @@ static RT_TASK t_test;
 
 #define ONE_SECOND  1000000000ULL
 
-void sighandler(int sig)
+static void sighandler(int sig)
 {
 	/* nop */
 }
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH 3/6] testsuite: Add a simple test driver for alchemytests
  2022-04-08  8:03 ` [PATCH 3/6] testsuite: Add a simple test driver for alchemytests Richard Weinberger
@ 2022-04-08  9:11   ` Bezdeka, Florian
  2022-04-08  9:19     ` Richard Weinberger
  2022-04-08 10:34     ` Philippe Gerum
  0 siblings, 2 replies; 20+ messages in thread
From: Bezdeka, Florian @ 2022-04-08  9:11 UTC (permalink / raw)
  To: xenomai, richard

Hi Richard,

On Fri, 2022-04-08 at 10:03 +0200, Richard Weinberger via Xenomai
wrote:
> +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;

Why is this "special" cpu-affinity necessary? What would happen if we
remove that? Asking because I want to make sure that we do not miss any
concurrency problems by adding this constraint.

Florian

> +
> +	ret = system(tst_path);
> +	free(tst_path);
> +
> +	return ret;
> +}
> +


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 3/6] testsuite: Add a simple test driver for alchemytests
  2022-04-08  9:11   ` Bezdeka, Florian
@ 2022-04-08  9:19     ` Richard Weinberger
  2022-04-08 10:34     ` Philippe Gerum
  1 sibling, 0 replies; 20+ messages in thread
From: Richard Weinberger @ 2022-04-08  9:19 UTC (permalink / raw)
  To: Florian Bezdeka; +Cc: xenomai

Florian,

----- Ursprüngliche Mail -----
> Why is this "special" cpu-affinity necessary? What would happen if we
> remove that? Asking because I want to make sure that we do not miss any
> concurrency problems by adding this constraint.

I don't know. I copied it as-is from the old Makefile.
Without that flag most tests fail (at least on my x86 VM).

So far I did only integration of the tests but no deciphering. :-)

Thanks,
//richard


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 3/6] testsuite: Add a simple test driver for alchemytests
  2022-04-08  9:11   ` Bezdeka, Florian
  2022-04-08  9:19     ` Richard Weinberger
@ 2022-04-08 10:34     ` Philippe Gerum
  2022-04-08 10:49       ` Richard Weinberger
  1 sibling, 1 reply; 20+ messages in thread
From: Philippe Gerum @ 2022-04-08 10:34 UTC (permalink / raw)
  To: Bezdeka, Florian; +Cc: richard, xenomai


"Bezdeka, Florian via Xenomai" <xenomai@xenomai.org> writes:

> Hi Richard,
>
> On Fri, 2022-04-08 at 10:03 +0200, Richard Weinberger via Xenomai
> wrote:
>> +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;
>
> Why is this "special" cpu-affinity necessary? What would happen if we
> remove that? Asking because I want to make sure that we do not miss any
> concurrency problems by adding this constraint.
>

The reason to pin the threads on the same CPU is to guarantee an ideal
execution sequence for some tests provided the scheduling policy and/or
the synchronization mechanisms do behave as intended. Concurrency on
multiple CPU would break the assumptions about that ideal sequence.

For instance, you could not resort to any inter-thread synchronization
to prevent unwanted SMP concurrency when checking that a scheduling
policy is properly undergone, that would make the test irrelevant by
papering over local preemption issues if any.  So we pin all the threads
on the same CPU to exclude SMP, and only that.

-- 
Philippe.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 3/6] testsuite: Add a simple test driver for alchemytests
  2022-04-08 10:34     ` Philippe Gerum
@ 2022-04-08 10:49       ` Richard Weinberger
  2022-04-08 12:01         ` Philippe Gerum
  0 siblings, 1 reply; 20+ messages in thread
From: Richard Weinberger @ 2022-04-08 10:49 UTC (permalink / raw)
  To: Philippe Gerum; +Cc: Florian Bezdeka, xenomai

Philippe,

----- Ursprüngliche Mail -----
> Von: "Philippe Gerum" <rpm@xenomai.org>
>> Why is this "special" cpu-affinity necessary? What would happen if we
>> remove that? Asking because I want to make sure that we do not miss any
>> concurrency problems by adding this constraint.
>>
> 
> The reason to pin the threads on the same CPU is to guarantee an ideal
> execution sequence for some tests provided the scheduling policy and/or
> the synchronization mechanisms do behave as intended. Concurrency on
> multiple CPU would break the assumptions about that ideal sequence.
> 
> For instance, you could not resort to any inter-thread synchronization
> to prevent unwanted SMP concurrency when checking that a scheduling
> policy is properly undergone, that would make the test irrelevant by
> papering over local preemption issues if any.  So we pin all the threads
> on the same CPU to exclude SMP, and only that.

So the tests have assumptions about the scheduling order of threads?
I always thought even with a single CPU such assumptions can break.

Thanks,
//richard


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 3/6] testsuite: Add a simple test driver for alchemytests
  2022-04-08 10:49       ` Richard Weinberger
@ 2022-04-08 12:01         ` Philippe Gerum
  2022-04-08 12:11           ` Richard Weinberger
  0 siblings, 1 reply; 20+ messages in thread
From: Philippe Gerum @ 2022-04-08 12:01 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: Florian Bezdeka, xenomai


Richard Weinberger <richard@nod.at> writes:

> Philippe,
>
> ----- Ursprüngliche Mail -----
>> Von: "Philippe Gerum" <rpm@xenomai.org>
>>> Why is this "special" cpu-affinity necessary? What would happen if we
>>> remove that? Asking because I want to make sure that we do not miss any
>>> concurrency problems by adding this constraint.
>>>
>> 
>> The reason to pin the threads on the same CPU is to guarantee an ideal
>> execution sequence for some tests provided the scheduling policy and/or
>> the synchronization mechanisms do behave as intended. Concurrency on
>> multiple CPU would break the assumptions about that ideal sequence.
>> 
>> For instance, you could not resort to any inter-thread synchronization
>> to prevent unwanted SMP concurrency when checking that a scheduling
>> policy is properly undergone, that would make the test irrelevant by
>> papering over local preemption issues if any.  So we pin all the threads
>> on the same CPU to exclude SMP, and only that.
>
> So the tests have assumptions about the scheduling order of threads?
> I always thought even with a single CPU such assumptions can break.
>

Not if the scheduling core Xenomai provides does its job properly.

-- 
Philippe.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 3/6] testsuite: Add a simple test driver for alchemytests
  2022-04-08 12:01         ` Philippe Gerum
@ 2022-04-08 12:11           ` Richard Weinberger
  0 siblings, 0 replies; 20+ messages in thread
From: Richard Weinberger @ 2022-04-08 12:11 UTC (permalink / raw)
  To: Philippe Gerum; +Cc: Florian Bezdeka, xenomai

----- Ursprüngliche Mail -----
> Von: "Philippe Gerum" <rpm@xenomai.org>
>> So the tests have assumptions about the scheduling order of threads?
>> I always thought even with a single CPU such assumptions can break.
> 
> Not if the scheduling core Xenomai provides does its job properly.

I see.

Thanks,
//richard


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 0/6] Revive alchemy tests
  2022-04-08  8:03 [PATCH 0/6] Revive alchemy tests Richard Weinberger
                   ` (5 preceding siblings ...)
  2022-04-08  8:04 ` [PATCH 6/6] alchemytests: Fix gcc warning in task-9 Richard Weinberger
@ 2022-04-13 12:56 ` Jan Kiszka
  2022-04-13 14:14   ` Richard Weinberger
  6 siblings, 1 reply; 20+ messages in thread
From: Jan Kiszka @ 2022-04-13 12:56 UTC (permalink / raw)
  To: Richard Weinberger, xenomai

On 08.04.22 10:03, Richard Weinberger via Xenomai wrote:
> This patch series is a first attempt to integrate the currently abandoned
> alchemy tests into Xenomai's test suite.
> Since each test assumes running as own process a test driver is needed
> which executes each tests separately.
> The driver makes use of the smokey framework.
> 

A valuable step forward. Just wondering, before actually taking it, if
that can be a pattern for the rest as well (psos, vxworks) or if there
is anything that should be considered in addition to allow them
following later on.

Jan

-- 
Siemens AG, Technology
Competence Center Embedded Linux


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 0/6] Revive alchemy tests
  2022-04-13 12:56 ` [PATCH 0/6] Revive alchemy tests Jan Kiszka
@ 2022-04-13 14:14   ` Richard Weinberger
  2022-04-13 18:58     ` Jan Kiszka
  0 siblings, 1 reply; 20+ messages in thread
From: Richard Weinberger @ 2022-04-13 14:14 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: xenomai

----- Ursprüngliche Mail -----
> Von: "Jan Kiszka" <jan.kiszka@siemens.com>
> An: "richard" <richard@nod.at>, "xenomai" <xenomai@xenomai.org>
> Gesendet: Mittwoch, 13. April 2022 14:56:16
> Betreff: Re: [PATCH 0/6] Revive alchemy tests

> On 08.04.22 10:03, Richard Weinberger via Xenomai wrote:
>> This patch series is a first attempt to integrate the currently abandoned
>> alchemy tests into Xenomai's test suite.
>> Since each test assumes running as own process a test driver is needed
>> which executes each tests separately.
>> The driver makes use of the smokey framework.
>> 
> 
> A valuable step forward. Just wondering, before actually taking it, if
> that can be a pattern for the rest as well (psos, vxworks) or if there
> is anything that should be considered in addition to allow them
> following later on.

I think the same approach will work for psos and vxworks too.
If you're fine with the proposed approach I'd prepare a v2 of this series
with psos and vxworks included.

Thanks,
//richard


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 0/6] Revive alchemy tests
  2022-04-13 14:14   ` Richard Weinberger
@ 2022-04-13 18:58     ` Jan Kiszka
  0 siblings, 0 replies; 20+ messages in thread
From: Jan Kiszka @ 2022-04-13 18:58 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: xenomai

On 13.04.22 16:14, Richard Weinberger wrote:
> ----- Ursprüngliche Mail -----
>> Von: "Jan Kiszka" <jan.kiszka@siemens.com>
>> An: "richard" <richard@nod.at>, "xenomai" <xenomai@xenomai.org>
>> Gesendet: Mittwoch, 13. April 2022 14:56:16
>> Betreff: Re: [PATCH 0/6] Revive alchemy tests
> 
>> On 08.04.22 10:03, Richard Weinberger via Xenomai wrote:
>>> This patch series is a first attempt to integrate the currently abandoned
>>> alchemy tests into Xenomai's test suite.
>>> Since each test assumes running as own process a test driver is needed
>>> which executes each tests separately.
>>> The driver makes use of the smokey framework.
>>>
>>
>> A valuable step forward. Just wondering, before actually taking it, if
>> that can be a pattern for the rest as well (psos, vxworks) or if there
>> is anything that should be considered in addition to allow them
>> following later on.
> 
> I think the same approach will work for psos and vxworks too.
> If you're fine with the proposed approach I'd prepare a v2 of this series
> with psos and vxworks included.

Thanks! Will have a look and let you know if I have remarks on details
as well.

Jan

-- 
Siemens AG, Technology
Competence Center Embedded Linux


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 2/6] testsuite: Hook up alchemytests
  2022-04-08  8:03 ` [PATCH 2/6] testsuite: Hook up alchemytests Richard Weinberger
@ 2022-04-14 11:12   ` Jan Kiszka
  2022-04-14 11:17     ` Richard Weinberger
  0 siblings, 1 reply; 20+ messages in thread
From: Jan Kiszka @ 2022-04-14 11:12 UTC (permalink / raw)
  To: Richard Weinberger, xenomai

On 08.04.22 10:03, Richard Weinberger via Xenomai wrote:
> Build them using Xenomai's build system.
> 
> Signed-off-by: Richard Weinberger <richard@nod.at>
> ---
>  configure.ac                       |   1 +
>  testsuite/Makefile.am              |   6 +-
>  testsuite/alchemytests/Makefile.am | 148 +++++++++++++++++++++++++++++
>  3 files changed, 153 insertions(+), 2 deletions(-)
>  create mode 100644 testsuite/alchemytests/Makefile.am
> 

With only up to here applied:

make[2]: Entering directory 'xenomai/build/testsuite/alchemytests'
make[2]: *** No rule to make target 'alchemytest_driver.c', needed by
'alchemytest_driver.o'.  Stop.

> diff --git a/configure.ac b/configure.ac
> index 019453793..8fd86e5a1 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1046,6 +1046,7 @@ AC_CONFIG_FILES([ \
>  	testsuite/smokey/can/Makefile
>  	testsuite/clocktest/Makefile \
>  	testsuite/xeno-test/Makefile \
> +	testsuite/alchemytests/Makefile \
>  	utils/Makefile \
>  	utils/hdb/Makefile \
>  	utils/can/Makefile \
> diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
> index 4932f6d33..e027485fb 100644
> --- a/testsuite/Makefile.am
> +++ b/testsuite/Makefile.am
> @@ -7,7 +7,8 @@ SUBDIRS += 		\
>  	gpiotest	\
>  	spitest		\
>  	switchtest	\
> -	xeno-test
> +	xeno-test	\
> +	alchemytests
>  endif
>  
>  DIST_SUBDIRS =		\
> @@ -18,4 +19,5 @@ DIST_SUBDIRS =		\
>  	smokey		\
>  	spitest		\
>  	switchtest	\
> -	xeno-test
> +	xeno-test	\
> +	alchemytests
> diff --git a/testsuite/alchemytests/Makefile.am b/testsuite/alchemytests/Makefile.am
> new file mode 100644
> index 000000000..35df0d49c
> --- /dev/null
> +++ b/testsuite/alchemytests/Makefile.am
> @@ -0,0 +1,148 @@
> +testdir = @XENO_TEST_DIR@
> +
> +CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
> +
> +test_PROGRAMS = alchemytest_driver \
> +		alarm1		   \
> +		buffer1		   \
> +		event1		   \
> +		heap1		   \
> +		heap2		   \
> +		mq1		   \
> +		mq2		   \
> +		mq3		   \
> +		mutex1		   \
> +		pipe1		   \
> +		sem1		   \
> +		sem2		   \
> +		task1		   \
> +		task2		   \
> +		task3		   \
> +		task4		   \
> +		task5		   \
> +		task6		   \
> +		task7		   \
> +		task8		   \
> +		task9		   \
> +		task10
> +
> +alchemycppflags = 				\
> +	$(XENO_USER_CFLAGS)		\
> +	-I$(top_srcdir)/include
> +
> +alchemyldadd = 					\
> +	../../lib/alchemy/libalchemy@CORE@.la		\
> +	../../lib/copperplate/libcopperplate@CORE@.la	\
> +	@XENO_CORE_LDADD@ 			\
> +	@XENO_USER_LDADD@			\
> +	-lpthread -lrt -lm
> +
> +alarm1_SOURCES = alarm-1.c
> +alarm1_CPPFLAGS = $(alchemycppflags)
> +alarm1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alarm1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +
> +event1_SOURCES = event-1.c
> +event1_CPPFLAGS = $(alchemycppflags)
> +event1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +event1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +
> +heap1_SOURCES = heap-1.c
> +heap1_CPPFLAGS = $(alchemycppflags)
> +heap1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +heap1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +
> +heap2_SOURCES = heap-2.c
> +heap2_CPPFLAGS = $(alchemycppflags)
> +heap2_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +heap2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +
> +buffer1_SOURCES = buffer-1.c
> +buffer1_CPPFLAGS = $(alchemycppflags)
> +buffer1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +buffer1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +
> +mutex1_SOURCES = mutex-1.c
> +mutex1_CPPFLAGS = $(alchemycppflags)
> +mutex1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +mutex1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +
> +pipe1_SOURCES = pipe-1.c
> +pipe1_CPPFLAGS = $(alchemycppflags)
> +pipe1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +pipe1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +
> +mq1_SOURCES = mq-1.c
> +mq1_CPPFLAGS = $(alchemycppflags)
> +mq1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +mq1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +
> +mq2_SOURCES = mq-2.c
> +mq2_CPPFLAGS = $(alchemycppflags)
> +mq2_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +mq2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +
> +mq3_SOURCES = mq-3.c
> +mq3_CPPFLAGS = $(alchemycppflags)
> +mq3_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +mq3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +
> +sem1_SOURCES = sem-1.c
> +sem1_CPPFLAGS = $(alchemycppflags)
> +sem1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +sem1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +
> +sem2_SOURCES = sem-2.c
> +sem2_CPPFLAGS = $(alchemycppflags)
> +sem2_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +sem2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +
> +task1_SOURCES = task-1.c
> +task1_CPPFLAGS = $(alchemycppflags)
> +task1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +task1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +
> +task2_SOURCES = task-2.c
> +task2_CPPFLAGS = $(alchemycppflags)
> +task2_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +task2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +
> +task3_SOURCES = task-3.c
> +task3_CPPFLAGS = $(alchemycppflags)
> +task3_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +task3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +
> +task4_SOURCES = task-4.c
> +task4_CPPFLAGS = $(alchemycppflags)
> +task4_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +task4_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +
> +task5_SOURCES = task-5.c
> +task5_CPPFLAGS = $(alchemycppflags)
> +task5_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +task5_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +
> +task6_SOURCES = task-6.c
> +task6_CPPFLAGS = $(alchemycppflags)
> +task6_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +task6_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +
> +task7_SOURCES = task-7.c
> +task7_CPPFLAGS = $(alchemycppflags)
> +task7_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +task7_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +
> +task8_SOURCES = task-8.c
> +task8_CPPFLAGS = $(alchemycppflags)
> +task8_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +task8_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +
> +task9_SOURCES = task-9.c
> +task9_CPPFLAGS = $(alchemycppflags)
> +task9_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +task9_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +
> +task10_SOURCES = task-10.c
> +task10_CPPFLAGS = $(alchemycppflags)
> +task10_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +task10_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@

Lots of repetitions. Can we use at least some macro for them, or can't
we assign CPPFLAGS, LDADD and LDFLAGS globally (in this file)?

Jan

-- 
Siemens AG, Technology
Competence Center Embedded Linux


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 2/6] testsuite: Hook up alchemytests
  2022-04-14 11:12   ` Jan Kiszka
@ 2022-04-14 11:17     ` Richard Weinberger
  2022-04-14 11:27       ` Jan Kiszka
  0 siblings, 1 reply; 20+ messages in thread
From: Richard Weinberger @ 2022-04-14 11:17 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Richard Weinberger, Xenomai

On Thu, Apr 14, 2022 at 1:12 PM Jan Kiszka via Xenomai
<xenomai@xenomai.org> wrote:
> With only up to here applied:
>
> make[2]: Entering directory 'xenomai/build/testsuite/alchemytests'
> make[2]: *** No rule to make target 'alchemytest_driver.c', needed by
> 'alchemytest_driver.o'.  Stop.

Ah, alchemytest_driver.c comes in a follow up patch.
Will be fixed in a later series.

> > +task10_SOURCES = task-10.c
> > +task10_CPPFLAGS = $(alchemycppflags)
> > +task10_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> > +task10_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
>
> Lots of repetitions. Can we use at least some macro for them, or can't

My automake-fu is weak. Does automake support something like that?

> we assign CPPFLAGS, LDADD and LDFLAGS globally (in this file)?

I can give this a try. So far I didn't use global variables because building
the tests and the test driver is slightly different and may change.

-- 
Thanks,
//richard


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 2/6] testsuite: Hook up alchemytests
  2022-04-14 11:17     ` Richard Weinberger
@ 2022-04-14 11:27       ` Jan Kiszka
  2022-04-14 11:32         ` Richard Weinberger
  0 siblings, 1 reply; 20+ messages in thread
From: Jan Kiszka @ 2022-04-14 11:27 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: Richard Weinberger, Xenomai

On 14.04.22 13:17, Richard Weinberger wrote:
> On Thu, Apr 14, 2022 at 1:12 PM Jan Kiszka via Xenomai
> <xenomai@xenomai.org> wrote:
>> With only up to here applied:
>>
>> make[2]: Entering directory 'xenomai/build/testsuite/alchemytests'
>> make[2]: *** No rule to make target 'alchemytest_driver.c', needed by
>> 'alchemytest_driver.o'.  Stop.
> 
> Ah, alchemytest_driver.c comes in a follow up patch.
> Will be fixed in a later series.

Upps, this was on v1 - but it seems v2 was not different in this regard.

> 
>>> +task10_SOURCES = task-10.c
>>> +task10_CPPFLAGS = $(alchemycppflags)
>>> +task10_LDADD = $(alchemyldadd) -lpthread -lrt -lm
>>> +task10_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
>>
>> Lots of repetitions. Can we use at least some macro for them, or can't
> 
> My automake-fu is weak. Does automake support something like that?

I would have to dig this up myself, but I would be surprised if there is
nothing like that.

> 
>> we assign CPPFLAGS, LDADD and LDFLAGS globally (in this file)?
> 
> I can give this a try. So far I didn't use global variables because building
> the tests and the test driver is slightly different and may change.
> 

Ah, that is the reason.

Jan

-- 
Siemens AG, Technology
Competence Center Embedded Linux


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 2/6] testsuite: Hook up alchemytests
  2022-04-14 11:27       ` Jan Kiszka
@ 2022-04-14 11:32         ` Richard Weinberger
  0 siblings, 0 replies; 20+ messages in thread
From: Richard Weinberger @ 2022-04-14 11:32 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Richard Weinberger, xenomai

----- Ursprüngliche Mail -----
>> Ah, alchemytest_driver.c comes in a follow up patch.
>> Will be fixed in a later series.
> 
> Upps, this was on v1 - but it seems v2 was not different in this regard.

I meant v3, which I'll prepare soon.
v2 is just v1 plus sSOS/VxWorks.
 
> I would have to dig this up myself, but I would be surprised if there is
> nothing like that.

I'll ask Google.
I was about to suggest migrating to mesonbuild, but Xenomai is non-trivial
to build, such a migration will take time.
 
Thanks,
//richard


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2022-04-14 11:32 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-08  8:03 [PATCH 0/6] Revive alchemy tests Richard Weinberger
2022-04-08  8:03 ` [PATCH 1/6] testsuite: Move alchemy tests into testsuite/ Richard Weinberger
2022-04-08  8:03 ` [PATCH 2/6] testsuite: Hook up alchemytests Richard Weinberger
2022-04-14 11:12   ` Jan Kiszka
2022-04-14 11:17     ` Richard Weinberger
2022-04-14 11:27       ` Jan Kiszka
2022-04-14 11:32         ` Richard Weinberger
2022-04-08  8:03 ` [PATCH 3/6] testsuite: Add a simple test driver for alchemytests Richard Weinberger
2022-04-08  9:11   ` Bezdeka, Florian
2022-04-08  9:19     ` Richard Weinberger
2022-04-08 10:34     ` Philippe Gerum
2022-04-08 10:49       ` Richard Weinberger
2022-04-08 12:01         ` Philippe Gerum
2022-04-08 12:11           ` Richard Weinberger
2022-04-08  8:03 ` [PATCH 4/6] Remove old alchemy tests Makefile Richard Weinberger
2022-04-08  8:04 ` [PATCH 5/6] alchemytests: Fix gcc warning in buffer-1 Richard Weinberger
2022-04-08  8:04 ` [PATCH 6/6] alchemytests: Fix gcc warning in task-9 Richard Weinberger
2022-04-13 12:56 ` [PATCH 0/6] Revive alchemy tests Jan Kiszka
2022-04-13 14:14   ` Richard Weinberger
2022-04-13 18:58     ` Jan Kiszka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.