Revive alchemy tests
cover Revive alchemy tests
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%)Signature · 1 line
2.34.1
PATCH 1/6 testsuite: Move alchemy tests into testsuite/
This is the very first step to have the alchemy tests embedded into our testsuite.
---
{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%)testsuite/alchemytests/alarm-1.c renamed from lib/alchemy/testsuite/alarm-1.c +0 -0
testsuite/alchemytests/buffer-1.c renamed from lib/alchemy/testsuite/buffer-1.c +0 -0
testsuite/alchemytests/event-1.c renamed from lib/alchemy/testsuite/event-1.c +0 -0
testsuite/alchemytests/heap-1.c renamed from lib/alchemy/testsuite/heap-1.c +0 -0
testsuite/alchemytests/heap-2.c renamed from lib/alchemy/testsuite/heap-2.c +0 -0
testsuite/alchemytests/mq-1.c renamed from lib/alchemy/testsuite/mq-1.c +0 -0
testsuite/alchemytests/mq-2.c renamed from lib/alchemy/testsuite/mq-2.c +0 -0
testsuite/alchemytests/mq-3.c renamed from lib/alchemy/testsuite/mq-3.c +0 -0
testsuite/alchemytests/mutex-1.c renamed from lib/alchemy/testsuite/mutex-1.c +0 -0
testsuite/alchemytests/pipe-1.c renamed from lib/alchemy/testsuite/pipe-1.c +0 -0
testsuite/alchemytests/sem-1.c renamed from lib/alchemy/testsuite/sem-1.c +0 -0
testsuite/alchemytests/sem-2.c renamed from lib/alchemy/testsuite/sem-2.c +0 -0
testsuite/alchemytests/task-1.c renamed from lib/alchemy/testsuite/task-1.c +0 -0
testsuite/alchemytests/task-10.c renamed from lib/alchemy/testsuite/task-10.c +0 -0
testsuite/alchemytests/task-2.c renamed from lib/alchemy/testsuite/task-2.c +0 -0
testsuite/alchemytests/task-3.c renamed from lib/alchemy/testsuite/task-3.c +0 -0
testsuite/alchemytests/task-4.c renamed from lib/alchemy/testsuite/task-4.c +0 -0
testsuite/alchemytests/task-5.c renamed from lib/alchemy/testsuite/task-5.c +0 -0
testsuite/alchemytests/task-6.c renamed from lib/alchemy/testsuite/task-6.c +0 -0
testsuite/alchemytests/task-7.c renamed from lib/alchemy/testsuite/task-7.c +0 -0
testsuite/alchemytests/task-8.c renamed from lib/alchemy/testsuite/task-8.c +0 -0
testsuite/alchemytests/task-9.c renamed from lib/alchemy/testsuite/task-9.c +0 -0
Signature · 1 line
2.34.1
PATCH 2/6 testsuite: Hook up alchemytests
In reply to Richard WeinbergerBuild them using Xenomai's build system.
--- 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
configure.ac +1 -0
@@ -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 \
testsuite/Makefile.am +4 -2
@@ -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
testsuite/alchemytests/Makefile.am new file +148 -0
148 lines not on this page · raw message
Signature · 1 line
2.34.1
Re: [PATCH 2/6] testsuite: Hook up alchemytests
Quoted 10 lines · Richard Weinberger via Xenomai
Build them using Xenomai's build system.
Signed-off-by Richard Weinberger <[email protected]>--- 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.
Quoted 177 lines
configure.ac +1
-0@@ -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 \testsuite/Makefile.am +4
-2@@ -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 \ + alchemyteststestsuite/alchemytests/Makefile.am new file +138
-0@@ -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@[email protected] \ + ../../lib/copperplate/libcopperplate@[email protected] \ + @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@
testsuite/alchemytests/Makefile.am line 148
Quoted 10 lines
testsuite/alchemytests/Makefile.am new file +10
-0+ +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
Signature · 2 lines
Siemens AG, Technology Competence Center Embedded Linux
Re: [PATCH 2/6] testsuite: Hook up alchemytests
Quoted 5 lines · Jan Kiszka via Xenomai
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.
Quoted 6 lines
testsuite/alchemytests/Makefile.am line 148
Quoted 4 lines
testsuite/alchemytests/Makefile.am new file +4
-0+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?
Quoted 1 line
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.
Signature · 2 lines
Thanks, //richard
Re: [PATCH 2/6] testsuite: Hook up alchemytests
Quoted 10 lines · Richard Weinberger
Quoted 5 lines · Jan Kiszka via Xenomai
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.ccomes 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.
Quoted 9 lines
Quoted 7 lines
testsuite/alchemytests/Makefile.am line 148
Quoted 5 lines
testsuite/alchemytests/Makefile.am new file +4
-0+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.
Quoted 6 lines
Quoted 2 lines
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
Signature · 2 lines
Siemens AG, Technology Competence Center Embedded Linux
Re: [PATCH 2/6] testsuite: Hook up alchemytests
----- Ursprüngliche Mail -----
Quoted 4 lines
Quoted 2 lines
Ah,
alchemytest_driver.ccomes 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.
Quoted 2 lines
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
PATCH 3/6 testsuite: Add a simple test driver for alchemytests
In reply to Richard WeinbergerIn 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.
--- testsuite/alchemytests/Makefile.am | 11 +++ testsuite/alchemytests/alchemytest_driver.c | 84 +++++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 testsuite/alchemytests/alchemytest_driver.c
testsuite/alchemytests/Makefile.am +11 -0
@@ -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@[email protected] \ + @XENO_CORE_LDADD@ \ + @XENO_USER_LDADD@ \ + -lpthread -lrt
testsuite/alchemytests/alchemytest_driver.c new file +84 -0
84 lines not on this page · raw message
Signature · 1 line
2.34.1
Re: [PATCH 3/6] testsuite: Add a simple test driver for alchemytests
Hi Richard,
testsuite/alchemytests/alchemytest_driver.c line 26
Quoted 8 lines · Richard Weinberger via Xenomai
testsuite/alchemytests/alchemytest_driver.c new file +8
-0+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
Quoted 7 lines
testsuite/alchemytests/alchemytest_driver.c new file +7
-0+ + ret =system (tst_path); +free (tst_path); + +return ret; +} +
Re: [PATCH 3/6] testsuite: Add a simple test driver for alchemytests
Florian,
----- Ursprüngliche Mail -----
Quoted 3 lines
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
Re: [PATCH 3/6] testsuite: Add a simple test driver for alchemytests
In reply to Bezdeka, FlorianQuoted 4 lines · Florian via Xenomai
Hi Richard,
On Fri, 2022-04-08 at 10:03 +0200, Richard Weinberger via Xenomai wrote:
Quoted 13 lines
testsuite/alchemytests/alchemytest_driver.c line 26
Quoted 8 lines
testsuite/alchemytests/alchemytest_driver.c new file +8
-0+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.
Signature · 1 line
Philippe.
Re: [PATCH 3/6] testsuite: Add a simple test driver for alchemytests
Philippe,
----- Ursprüngliche Mail -----
Quoted 11 lines
Von: "Philippe Gerum" <[email protected]>
Quoted 4 lines
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.
Quoted 5 lines
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
Re: [PATCH 3/6] testsuite: Add a simple test driver for alchemytests
Quoted 14 lines · Richard Weinberger
Philippe,
----- Ursprüngliche Mail -----
Quoted 11 lines
Von: "Philippe Gerum" <[email protected]>
Quoted 4 lines
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.
Quoted 9 lines
Quoted 5 lines
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.
Signature · 1 line
Philippe.
Re: [PATCH 3/6] testsuite: Add a simple test driver for alchemytests
----- Ursprüngliche Mail -----
Quoted 5 lines
Von: "Philippe Gerum" <[email protected]>
Quoted 2 lines
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
PATCH 4/6 Remove old alchemy tests Makefile
In reply to Richard Weinberger--- lib/alchemy/testsuite/Makefile | 70 ---------------------------------- 1 file changed, 70 deletions(-) delete mode 100644 lib/alchemy/testsuite/Makefile
lib/alchemy/testsuite/Makefile deleted +0 -70
@@ -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
Signature · 1 line
2.34.1
PATCH 5/6 alchemytests: Fix gcc warning in buffer-1
In reply to Richard WeinbergerMake 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);
^~~~--- testsuite/alchemytests/buffer-1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testsuite/alchemytests/buffer-1.c +1 -1
@@ -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);
Signature · 1 line
2.34.1
PATCH 6/6 alchemytests: Fix gcc warning in task-9
In reply to Richard WeinbergerMake 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)
--- testsuite/alchemytests/task-9.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testsuite/alchemytests/task-9.c +1 -1
@@ -10,7 +10,7 @@ static RT_TASK t_test;#define ONE_SECOND 1000000000ULL -void sighandler (int sig) +static void sighandler (int sig) {/* nop */ }
Signature · 1 line
2.34.1
Quoted 6 lines · Richard Weinberger via Xenomai
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
Signature · 2 lines
Siemens AG, Technology Competence Center Embedded Linux
----- Ursprüngliche Mail -----
Quoted 13 lines
Von: "Jan Kiszka" <[email protected]>
An: "richard" <[email protected]>, "xenomai" <[email protected]>
Gesendet: Mittwoch, 13. April 2022 14:56:16
Betreff: Re: [PATCH 0/6] Revive alchemy testsQuoted 6 lines · Richard Weinberger via Xenomai
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.
Quoted 4 lines
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
Quoted 14 lines · Richard Weinberger
----- Ursprüngliche Mail -----
Quoted 13 lines
Von: "Jan Kiszka" <[email protected]>
An: "richard" <[email protected]>, "xenomai" <[email protected]>
Gesendet: Mittwoch, 13. April 2022 14:56:16
Betreff: Re: [PATCH 0/6] Revive alchemy testsQuoted 6 lines · Richard Weinberger via Xenomai
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.
Quoted 8 lines
Quoted 4 lines
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
Signature · 2 lines
Siemens AG, Technology Competence Center Embedded Linux