xenomai.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/9] Revive alchemy, pSOS and VxWorks tests
@ 2022-04-13 21:58 Richard Weinberger
  2022-04-13 21:58 ` [PATCH 1/9] testsuite: Move alchemy tests into testsuite/ Richard Weinberger
                   ` (10 more replies)
  0 siblings, 11 replies; 112+ messages in thread
From: Richard Weinberger @ 2022-04-13 21:58 UTC (permalink / raw)
  To: xenomai; +Cc: Richard Weinberger

This patch series is a first attempt to integrate the currently abandoned
alchemy, pSOS and VxWorks 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.

Test results on a x86 VM (5.15.19, Xenomai master as of today):
- Alchemy:
  test2 fails:
	[8] at task-2.c:71
	[1] at task-2.c:24
	[9] at task-2.c:79
	[4] at task-2.c:43
	[10] at task-2.c:87
	[5] at task-2.c:48
	[11] at task-2.c:92
	[2] at task-2.c:29
	[6] at task-2.c:52
	   0"022.972| BUG in __traceobj_check_abort(): [FGND] wrong return status:
		      task-2.c:55 => EINVAL (want OK)

  task5 fails:
	[9] at task-5.c:79
	[1] at task-5.c:23
	[10] at task-5.c:87
	[3] at task-5.c:40
	[11] at task-5.c:95
	[4] at task-5.c:45
	[5] at task-5.c:50
	[6] at task-5.c:55
	[2] at task-5.c:28
	[7] at task-5.c:60
	   0"003.160| BUG in __traceobj_check_abort(): [FGND] wrong return status:
		      task-5.c:63 => EINVAL (want OK)

  If Xenomai was configured with --enable-lores-clock, tests mq1, mutex1, pip1 and sem1 fail due to:
	undefined symbol: __clockobj_ticks_to_timeout

- pSOS (Xenomai has to be configured with --enable-lores-clock):
  rn1 fails:
	0"001.017| BUG in __traceobj_assert_failed(): [rn1] trace assertion failed:
		rn-1.c:46 => "ret == 0"
  task2 fails:
	[8] at task-2.c:73
	[1] at task-2.c:23
	[9] at task-2.c:81
	[4] at task-2.c:44
	[10] at task-2.c:89
	[5] at task-2.c:49
	[11] at task-2.c:94
	[2] at task-2.c:28
	[3] at task-2.c:33
	[6] at task-2.c:53
	   0"004.756| BUG in __traceobj_assert_failed(): [FGND] trace assertion failed:
		      task-2.c:56 => "ret == 0"

  task6 fails:
	[9] at task-6.c:79
	[1] at task-6.c:22
	[10] at task-6.c:87
	[3] at task-6.c:39
	[11] at task-6.c:95
	[4] at task-6.c:44
	[5] at task-6.c:49
	[6] at task-6.c:54
	[2] at task-6.c:27
	[7] at task-6.c:59
	   0"002.870| BUG in __traceobj_assert_failed(): [FGND] trace assertion failed:
		      task-6.c:62 => "ret == 0 && oldprio == myprio"

  task8 runs forever (100% CPU)

- VxWorks:
  task2 fails:
	[8] at task-2.c:85
	[1] at task-2.c:32
	[9] at task-2.c:91
	[4] at task-2.c:57
	[10] at task-2.c:97
	[5] at task-2.c:62
	[11] at task-2.c:103
	[2] at task-2.c:37
	[12] at task-2.c:109
	[6] at task-2.c:66
	   0"005.790| BUG in __traceobj_assert_failed(): [foregroundTask] trace assertion failed:
		      task-2.c:69 => "ret == 0"



Changes since v1:
 - Revive pSOS and VxWorks tests too 

Richard Weinberger (9):
  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
  testsuite: Move pSOS tests into testsuite/
  testsuite: Add a simple test driver for psostests
  testsuite: Integrate vwworks tests into testsuite/

 configure.ac                                  |   3 +
 lib/alchemy/testsuite/Makefile                |  70 --------
 lib/psos/testsuite/Makefile                   |  49 ------
 lib/vxworks/testsuite/Makefile                |  43 -----
 testsuite/Makefile.am                         |  10 +-
 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 +-
 testsuite/psostests/Makefile.am               | 166 ++++++++++++++++++
 .../testsuite => testsuite/psostests}/mq-1.c  |   0
 .../testsuite => testsuite/psostests}/mq-2.c  |   0
 .../testsuite => testsuite/psostests}/mq-3.c  |   0
 testsuite/psostests/psostest_driver.c         |  85 +++++++++
 .../testsuite => testsuite/psostests}/pt-1.c  |   0
 .../testsuite => testsuite/psostests}/rn-1.c  |   0
 .../testsuite => testsuite/psostests}/sem-1.c |   0
 .../testsuite => testsuite/psostests}/sem-2.c |   0
 .../psostests}/task-1.c                       |   0
 .../psostests}/task-2.c                       |   0
 .../psostests}/task-3.c                       |   0
 .../psostests}/task-4.c                       |   0
 .../psostests}/task-5.c                       |   0
 .../psostests}/task-6.c                       |   0
 .../psostests}/task-7.c                       |   0
 .../psostests}/task-8.c                       |   0
 .../psostests}/task-9.c                       |   0
 .../testsuite => testsuite/psostests}/tm-1.c  |   0
 .../testsuite => testsuite/psostests}/tm-2.c  |   0
 .../testsuite => testsuite/psostests}/tm-3.c  |   0
 .../testsuite => testsuite/psostests}/tm-4.c  |   0
 .../testsuite => testsuite/psostests}/tm-5.c  |   0
 .../testsuite => testsuite/psostests}/tm-6.c  |   0
 .../testsuite => testsuite/psostests}/tm-7.c  |   0
 testsuite/vxworkstests/Makefile.am            | 100 +++++++++++
 .../vxworkstests}/lst-1.c                     |   0
 .../vxworkstests}/msgQ-1.c                    |   0
 .../vxworkstests}/msgQ-2.c                    |   0
 .../vxworkstests}/msgQ-3.c                    |   0
 .../vxworkstests}/rng-1.c                     |   0
 .../vxworkstests}/sem-1.c                     |   0
 .../vxworkstests}/sem-2.c                     |   0
 .../vxworkstests}/sem-3.c                     |   0
 .../vxworkstests}/sem-4.c                     |   0
 .../vxworkstests}/task-1.c                    |   0
 .../vxworkstests}/task-2.c                    |   0
 testsuite/vxworkstests/vxworkstest_driver.c   |  74 ++++++++
 .../vxworkstests}/wd-1.c                      |   0
 68 files changed, 681 insertions(+), 166 deletions(-)
 delete mode 100644 lib/alchemy/testsuite/Makefile
 delete mode 100644 lib/psos/testsuite/Makefile
 delete mode 100644 lib/vxworks/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%)
 create mode 100644 testsuite/psostests/Makefile.am
 rename {lib/psos/testsuite => testsuite/psostests}/mq-1.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/mq-2.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/mq-3.c (100%)
 create mode 100644 testsuite/psostests/psostest_driver.c
 rename {lib/psos/testsuite => testsuite/psostests}/pt-1.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/rn-1.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/sem-1.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/sem-2.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-1.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-2.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-3.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-4.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-5.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-6.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-7.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-8.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-9.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/tm-1.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/tm-2.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/tm-3.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/tm-4.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/tm-5.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/tm-6.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/tm-7.c (100%)
 create mode 100644 testsuite/vxworkstests/Makefile.am
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/lst-1.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/msgQ-1.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/msgQ-2.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/msgQ-3.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/rng-1.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/sem-1.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/sem-2.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/sem-3.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/sem-4.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/task-1.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/task-2.c (100%)
 create mode 100644 testsuite/vxworkstests/vxworkstest_driver.c
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/wd-1.c (100%)

-- 
2.34.1



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

* [PATCH 1/9] testsuite: Move alchemy tests into testsuite/
  2022-04-13 21:58 [PATCH v2 0/9] Revive alchemy, pSOS and VxWorks tests Richard Weinberger
@ 2022-04-13 21:58 ` Richard Weinberger
  2022-04-13 21:58 ` [PATCH 2/9] testsuite: Hook up alchemytests Richard Weinberger
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 112+ messages in thread
From: Richard Weinberger @ 2022-04-13 21:58 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] 112+ messages in thread

* [PATCH 2/9] testsuite: Hook up alchemytests
  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 ` Richard Weinberger
  2022-04-13 21:58 ` [PATCH 3/9] testsuite: Add a simple test driver for alchemytests Richard Weinberger
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 112+ messages in thread
From: Richard Weinberger @ 2022-04-13 21:58 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] 112+ messages in thread

* [PATCH 3/9] testsuite: Add a simple test driver for alchemytests
  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 ` Richard Weinberger
  2022-04-14 11:28   ` Jan Kiszka
  2022-04-13 21:58 ` [PATCH 4/9] Remove old alchemy tests Makefile Richard Weinberger
                   ` (7 subsequent siblings)
  10 siblings, 1 reply; 112+ messages in thread
From: Richard Weinberger @ 2022-04-13 21:58 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] 112+ messages in thread

* [PATCH 4/9] Remove old alchemy tests Makefile
  2022-04-13 21:58 [PATCH v2 0/9] Revive alchemy, pSOS and VxWorks tests Richard Weinberger
                   ` (2 preceding siblings ...)
  2022-04-13 21:58 ` [PATCH 3/9] testsuite: Add a simple test driver for alchemytests Richard Weinberger
@ 2022-04-13 21:58 ` Richard Weinberger
  2022-04-13 21:58 ` [PATCH 5/9] alchemytests: Fix gcc warning in buffer-1 Richard Weinberger
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 112+ messages in thread
From: Richard Weinberger @ 2022-04-13 21:58 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] 112+ messages in thread

* [PATCH 5/9] alchemytests: Fix gcc warning in buffer-1
  2022-04-13 21:58 [PATCH v2 0/9] Revive alchemy, pSOS and VxWorks tests Richard Weinberger
                   ` (3 preceding siblings ...)
  2022-04-13 21:58 ` [PATCH 4/9] Remove old alchemy tests Makefile Richard Weinberger
@ 2022-04-13 21:58 ` Richard Weinberger
  2022-04-13 21:58 ` [PATCH 6/9] alchemytests: Fix gcc warning in task-9 Richard Weinberger
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 112+ messages in thread
From: Richard Weinberger @ 2022-04-13 21:58 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] 112+ messages in thread

* [PATCH 6/9] alchemytests: Fix gcc warning in task-9
  2022-04-13 21:58 [PATCH v2 0/9] Revive alchemy, pSOS and VxWorks tests Richard Weinberger
                   ` (4 preceding siblings ...)
  2022-04-13 21:58 ` [PATCH 5/9] alchemytests: Fix gcc warning in buffer-1 Richard Weinberger
@ 2022-04-13 21:58 ` Richard Weinberger
  2022-04-13 21:58 ` [PATCH 7/9] testsuite: Move pSOS tests into testsuite/ Richard Weinberger
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 112+ messages in thread
From: Richard Weinberger @ 2022-04-13 21:58 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] 112+ messages in thread

* [PATCH 7/9] testsuite: Move pSOS tests into testsuite/
  2022-04-13 21:58 [PATCH v2 0/9] Revive alchemy, pSOS and VxWorks tests Richard Weinberger
                   ` (5 preceding siblings ...)
  2022-04-13 21:58 ` [PATCH 6/9] alchemytests: Fix gcc warning in task-9 Richard Weinberger
@ 2022-04-13 21:58 ` Richard Weinberger
  2022-04-13 21:58 ` [PATCH 8/9] testsuite: Add a simple test driver for psostests Richard Weinberger
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 112+ messages in thread
From: Richard Weinberger @ 2022-04-13 21:58 UTC (permalink / raw)
  To: xenomai; +Cc: Richard Weinberger

Just like for alchemy tests, integrate them into our test suite.

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 configure.ac                                  |   1 +
 lib/psos/testsuite/Makefile                   |  49 ------
 testsuite/Makefile.am                         |   6 +-
 testsuite/psostests/Makefile.am               | 153 ++++++++++++++++++
 .../testsuite => testsuite/psostests}/mq-1.c  |   0
 .../testsuite => testsuite/psostests}/mq-2.c  |   0
 .../testsuite => testsuite/psostests}/mq-3.c  |   0
 .../testsuite => testsuite/psostests}/pt-1.c  |   0
 .../testsuite => testsuite/psostests}/rn-1.c  |   0
 .../testsuite => testsuite/psostests}/sem-1.c |   0
 .../testsuite => testsuite/psostests}/sem-2.c |   0
 .../psostests}/task-1.c                       |   0
 .../psostests}/task-2.c                       |   0
 .../psostests}/task-3.c                       |   0
 .../psostests}/task-4.c                       |   0
 .../psostests}/task-5.c                       |   0
 .../psostests}/task-6.c                       |   0
 .../psostests}/task-7.c                       |   0
 .../psostests}/task-8.c                       |   0
 .../psostests}/task-9.c                       |   0
 .../testsuite => testsuite/psostests}/tm-1.c  |   0
 .../testsuite => testsuite/psostests}/tm-2.c  |   0
 .../testsuite => testsuite/psostests}/tm-3.c  |   0
 .../testsuite => testsuite/psostests}/tm-4.c  |   0
 .../testsuite => testsuite/psostests}/tm-5.c  |   0
 .../testsuite => testsuite/psostests}/tm-6.c  |   0
 .../testsuite => testsuite/psostests}/tm-7.c  |   0
 27 files changed, 158 insertions(+), 51 deletions(-)
 delete mode 100644 lib/psos/testsuite/Makefile
 create mode 100644 testsuite/psostests/Makefile.am
 rename {lib/psos/testsuite => testsuite/psostests}/mq-1.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/mq-2.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/mq-3.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/pt-1.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/rn-1.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/sem-1.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/sem-2.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-1.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-2.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-3.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-4.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-5.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-6.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-7.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-8.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-9.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/tm-1.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/tm-2.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/tm-3.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/tm-4.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/tm-5.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/tm-6.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/tm-7.c (100%)

diff --git a/configure.ac b/configure.ac
index 8fd86e5a1..0cd2b2408 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1047,6 +1047,7 @@ AC_CONFIG_FILES([ \
 	testsuite/clocktest/Makefile \
 	testsuite/xeno-test/Makefile \
 	testsuite/alchemytests/Makefile \
+	testsuite/psostests/Makefile \
 	utils/Makefile \
 	utils/hdb/Makefile \
 	utils/can/Makefile \
diff --git a/lib/psos/testsuite/Makefile b/lib/psos/testsuite/Makefile
deleted file mode 100644
index 3330a617c..000000000
--- a/lib/psos/testsuite/Makefile
+++ /dev/null
@@ -1,49 +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)
-
-ifeq ($(prefix),)
-$(error Please add <xenomai-install-path>/bin to your PATH variable or specify DESTDIR)
-endif
-
-TESTS := \
-	task-1 task-2 task-3 task-4 task-5 task-6 task-7 task-8 task-9 \
-	tm-1 tm-2 tm-3 tm-4 tm-5 tm-6 tm-7 \
-	mq-1 mq-2 mq-3 \
-	sem-1 sem-2 \
-	pt-1 \
-	rn-1
-
-CFLAGS := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --skin=psos --cflags) -g
-LDFLAGS := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --skin=psos --ldflags)
-CC = $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --cc)
-
-all: $(TESTS)
-
-%: %.c
-	$(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
-
-install: all
-	install -d $(prefix)/testsuite/psos
-	install -t $(prefix)/testsuite/psos $(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
diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
index e027485fb..cea688199 100644
--- a/testsuite/Makefile.am
+++ b/testsuite/Makefile.am
@@ -8,7 +8,8 @@ SUBDIRS += 		\
 	spitest		\
 	switchtest	\
 	xeno-test	\
-	alchemytests
+	alchemytests	\
+	psostests
 endif
 
 DIST_SUBDIRS =		\
@@ -20,4 +21,5 @@ DIST_SUBDIRS =		\
 	spitest		\
 	switchtest	\
 	xeno-test	\
-	alchemytests
+	alchemytests	\
+	psostests
diff --git a/testsuite/psostests/Makefile.am b/testsuite/psostests/Makefile.am
new file mode 100644
index 000000000..9e8aef62b
--- /dev/null
+++ b/testsuite/psostests/Makefile.am
@@ -0,0 +1,153 @@
+testdir = @XENO_TEST_DIR@
+
+CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
+
+test_PROGRAMS = mq1	\
+		mq2	\
+		mq3	\
+		pt1	\
+		rn1	\
+		sem1	\
+		sem2	\
+		tm1	\
+		tm2	\
+		tm3	\
+		tm4	\
+		tm5	\
+		tm6	\
+		tm7	\
+		task1	\
+		task2	\
+		task3	\
+		task4	\
+		task5	\
+		task6	\
+		task7	\
+		task8	\
+		task9
+
+psoscppflags = 				\
+	$(XENO_USER_CFLAGS)		\
+	-I$(top_srcdir)/include
+
+psosldadd = 					\
+	../../lib/psos/libpsos@CORE@.la		\
+	../../lib/copperplate/libcopperplate@CORE@.la	\
+	@XENO_CORE_LDADD@ 			\
+	@XENO_USER_LDADD@			\
+	-lpthread -lrt -lm
+
+mq1_SOURCES = mq-1.c
+mq1_CPPFLAGS = $(psoscppflags)
+mq1_LDADD = $(psosldadd) -lpthread -lrt -lm
+mq1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+mq2_SOURCES = mq-2.c
+mq2_CPPFLAGS = $(psoscppflags)
+mq2_LDADD = $(psosldadd) -lpthread -lrt -lm
+mq2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+mq3_SOURCES = mq-3.c
+mq3_CPPFLAGS = $(psoscppflags)
+mq3_LDADD = $(psosldadd) -lpthread -lrt -lm
+mq3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+pt1_SOURCES = pt-1.c
+pt1_CPPFLAGS = $(psoscppflags)
+pt1_LDADD = $(psosldadd) -lpthread -lrt -lm
+pt1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+rn1_SOURCES = rn-1.c
+rn1_CPPFLAGS = $(psoscppflags)
+rn1_LDADD = $(psosldadd) -lpthread -lrt -lm
+rn1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+sem1_SOURCES = sem-1.c
+sem1_CPPFLAGS = $(psoscppflags)
+sem1_LDADD = $(psosldadd) -lpthread -lrt -lm
+sem1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+sem2_SOURCES = sem-2.c
+sem2_CPPFLAGS = $(psoscppflags)
+sem2_LDADD = $(psosldadd) -lpthread -lrt -lm
+sem2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+tm1_SOURCES = tm-1.c
+tm1_CPPFLAGS = $(psoscppflags)
+tm1_LDADD = $(psosldadd) -lpthread -lrt -lm
+tm1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+tm2_SOURCES = tm-2.c
+tm2_CPPFLAGS = $(psoscppflags)
+tm2_LDADD = $(psosldadd) -lpthread -lrt -lm
+tm2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+tm3_SOURCES = tm-3.c
+tm3_CPPFLAGS = $(psoscppflags)
+tm3_LDADD = $(psosldadd) -lpthread -lrt -lm
+tm3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+tm4_SOURCES = tm-4.c
+tm4_CPPFLAGS = $(psoscppflags)
+tm4_LDADD = $(psosldadd) -lpthread -lrt -lm
+tm4_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+tm5_SOURCES = tm-5.c
+tm5_CPPFLAGS = $(psoscppflags)
+tm5_LDADD = $(psosldadd) -lpthread -lrt -lm
+tm5_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+tm6_SOURCES = tm-6.c
+tm6_CPPFLAGS = $(psoscppflags)
+tm6_LDADD = $(psosldadd) -lpthread -lrt -lm
+tm6_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+tm7_SOURCES = tm-7.c
+tm7_CPPFLAGS = $(psoscppflags)
+tm7_LDADD = $(psosldadd) -lpthread -lrt -lm
+tm7_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task1_SOURCES = task-1.c
+task1_CPPFLAGS = $(psoscppflags)
+task1_LDADD = $(psosldadd) -lpthread -lrt -lm
+task1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task2_SOURCES = task-2.c
+task2_CPPFLAGS = $(psoscppflags)
+task2_LDADD = $(psosldadd) -lpthread -lrt -lm
+task2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task3_SOURCES = task-3.c
+task3_CPPFLAGS = $(psoscppflags)
+task3_LDADD = $(psosldadd) -lpthread -lrt -lm
+task3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task4_SOURCES = task-4.c
+task4_CPPFLAGS = $(psoscppflags)
+task4_LDADD = $(psosldadd) -lpthread -lrt -lm
+task4_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task5_SOURCES = task-5.c
+task5_CPPFLAGS = $(psoscppflags)
+task5_LDADD = $(psosldadd) -lpthread -lrt -lm
+task5_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task6_SOURCES = task-6.c
+task6_CPPFLAGS = $(psoscppflags)
+task6_LDADD = $(psosldadd) -lpthread -lrt -lm
+task6_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task7_SOURCES = task-7.c
+task7_CPPFLAGS = $(psoscppflags)
+task7_LDADD = $(psosldadd) -lpthread -lrt -lm
+task7_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task8_SOURCES = task-8.c
+task8_CPPFLAGS = $(psoscppflags)
+task8_LDADD = $(psosldadd) -lpthread -lrt -lm
+task8_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task9_SOURCES = task-9.c
+task9_CPPFLAGS = $(psoscppflags)
+task9_LDADD = $(psosldadd) -lpthread -lrt -lm
+task9_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
diff --git a/lib/psos/testsuite/mq-1.c b/testsuite/psostests/mq-1.c
similarity index 100%
rename from lib/psos/testsuite/mq-1.c
rename to testsuite/psostests/mq-1.c
diff --git a/lib/psos/testsuite/mq-2.c b/testsuite/psostests/mq-2.c
similarity index 100%
rename from lib/psos/testsuite/mq-2.c
rename to testsuite/psostests/mq-2.c
diff --git a/lib/psos/testsuite/mq-3.c b/testsuite/psostests/mq-3.c
similarity index 100%
rename from lib/psos/testsuite/mq-3.c
rename to testsuite/psostests/mq-3.c
diff --git a/lib/psos/testsuite/pt-1.c b/testsuite/psostests/pt-1.c
similarity index 100%
rename from lib/psos/testsuite/pt-1.c
rename to testsuite/psostests/pt-1.c
diff --git a/lib/psos/testsuite/rn-1.c b/testsuite/psostests/rn-1.c
similarity index 100%
rename from lib/psos/testsuite/rn-1.c
rename to testsuite/psostests/rn-1.c
diff --git a/lib/psos/testsuite/sem-1.c b/testsuite/psostests/sem-1.c
similarity index 100%
rename from lib/psos/testsuite/sem-1.c
rename to testsuite/psostests/sem-1.c
diff --git a/lib/psos/testsuite/sem-2.c b/testsuite/psostests/sem-2.c
similarity index 100%
rename from lib/psos/testsuite/sem-2.c
rename to testsuite/psostests/sem-2.c
diff --git a/lib/psos/testsuite/task-1.c b/testsuite/psostests/task-1.c
similarity index 100%
rename from lib/psos/testsuite/task-1.c
rename to testsuite/psostests/task-1.c
diff --git a/lib/psos/testsuite/task-2.c b/testsuite/psostests/task-2.c
similarity index 100%
rename from lib/psos/testsuite/task-2.c
rename to testsuite/psostests/task-2.c
diff --git a/lib/psos/testsuite/task-3.c b/testsuite/psostests/task-3.c
similarity index 100%
rename from lib/psos/testsuite/task-3.c
rename to testsuite/psostests/task-3.c
diff --git a/lib/psos/testsuite/task-4.c b/testsuite/psostests/task-4.c
similarity index 100%
rename from lib/psos/testsuite/task-4.c
rename to testsuite/psostests/task-4.c
diff --git a/lib/psos/testsuite/task-5.c b/testsuite/psostests/task-5.c
similarity index 100%
rename from lib/psos/testsuite/task-5.c
rename to testsuite/psostests/task-5.c
diff --git a/lib/psos/testsuite/task-6.c b/testsuite/psostests/task-6.c
similarity index 100%
rename from lib/psos/testsuite/task-6.c
rename to testsuite/psostests/task-6.c
diff --git a/lib/psos/testsuite/task-7.c b/testsuite/psostests/task-7.c
similarity index 100%
rename from lib/psos/testsuite/task-7.c
rename to testsuite/psostests/task-7.c
diff --git a/lib/psos/testsuite/task-8.c b/testsuite/psostests/task-8.c
similarity index 100%
rename from lib/psos/testsuite/task-8.c
rename to testsuite/psostests/task-8.c
diff --git a/lib/psos/testsuite/task-9.c b/testsuite/psostests/task-9.c
similarity index 100%
rename from lib/psos/testsuite/task-9.c
rename to testsuite/psostests/task-9.c
diff --git a/lib/psos/testsuite/tm-1.c b/testsuite/psostests/tm-1.c
similarity index 100%
rename from lib/psos/testsuite/tm-1.c
rename to testsuite/psostests/tm-1.c
diff --git a/lib/psos/testsuite/tm-2.c b/testsuite/psostests/tm-2.c
similarity index 100%
rename from lib/psos/testsuite/tm-2.c
rename to testsuite/psostests/tm-2.c
diff --git a/lib/psos/testsuite/tm-3.c b/testsuite/psostests/tm-3.c
similarity index 100%
rename from lib/psos/testsuite/tm-3.c
rename to testsuite/psostests/tm-3.c
diff --git a/lib/psos/testsuite/tm-4.c b/testsuite/psostests/tm-4.c
similarity index 100%
rename from lib/psos/testsuite/tm-4.c
rename to testsuite/psostests/tm-4.c
diff --git a/lib/psos/testsuite/tm-5.c b/testsuite/psostests/tm-5.c
similarity index 100%
rename from lib/psos/testsuite/tm-5.c
rename to testsuite/psostests/tm-5.c
diff --git a/lib/psos/testsuite/tm-6.c b/testsuite/psostests/tm-6.c
similarity index 100%
rename from lib/psos/testsuite/tm-6.c
rename to testsuite/psostests/tm-6.c
diff --git a/lib/psos/testsuite/tm-7.c b/testsuite/psostests/tm-7.c
similarity index 100%
rename from lib/psos/testsuite/tm-7.c
rename to testsuite/psostests/tm-7.c
-- 
2.34.1



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

* [PATCH 8/9] testsuite: Add a simple test driver for psostests
  2022-04-13 21:58 [PATCH v2 0/9] Revive alchemy, pSOS and VxWorks tests Richard Weinberger
                   ` (6 preceding siblings ...)
  2022-04-13 21:58 ` [PATCH 7/9] testsuite: Move pSOS tests into testsuite/ Richard Weinberger
@ 2022-04-13 21:58 ` Richard Weinberger
  2022-04-13 21:58 ` [PATCH 9/9] testsuite: Integrate vwworks tests into testsuite/ Richard Weinberger
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 112+ messages in thread
From: Richard Weinberger @ 2022-04-13 21:58 UTC (permalink / raw)
  To: xenomai; +Cc: Richard Weinberger

Just like for alchemytests.

Signed-off-by: Richard Weinberger <richard@nod.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 9e8aef62b..0a069837b 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 000000000..0f076e1bc
--- /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.34.1



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

* [PATCH 9/9] testsuite: Integrate vwworks tests into testsuite/
  2022-04-13 21:58 [PATCH v2 0/9] Revive alchemy, pSOS and VxWorks tests Richard Weinberger
                   ` (7 preceding siblings ...)
  2022-04-13 21:58 ` [PATCH 8/9] testsuite: Add a simple test driver for psostests Richard Weinberger
@ 2022-04-13 21:58 ` Richard Weinberger
  2022-04-14 11:18 ` [PATCH v2 0/9] Revive alchemy, pSOS and VxWorks tests Jan Kiszka
  2023-04-06 10:33 ` [PATCH v3 0/11] " Aaron Marcher
  10 siblings, 0 replies; 112+ messages in thread
From: Richard Weinberger @ 2022-04-13 21:58 UTC (permalink / raw)
  To: xenomai; +Cc: Richard Weinberger

Same as for alchemy and pSOS.

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 configure.ac                                  |   1 +
 lib/vxworks/testsuite/Makefile                |  43 --------
 testsuite/Makefile.am                         |   6 +-
 testsuite/vxworkstests/Makefile.am            | 100 ++++++++++++++++++
 .../vxworkstests}/lst-1.c                     |   0
 .../vxworkstests}/msgQ-1.c                    |   0
 .../vxworkstests}/msgQ-2.c                    |   0
 .../vxworkstests}/msgQ-3.c                    |   0
 .../vxworkstests}/rng-1.c                     |   0
 .../vxworkstests}/sem-1.c                     |   0
 .../vxworkstests}/sem-2.c                     |   0
 .../vxworkstests}/sem-3.c                     |   0
 .../vxworkstests}/sem-4.c                     |   0
 .../vxworkstests}/task-1.c                    |   0
 .../vxworkstests}/task-2.c                    |   0
 testsuite/vxworkstests/vxworkstest_driver.c   |  74 +++++++++++++
 .../vxworkstests}/wd-1.c                      |   0
 17 files changed, 179 insertions(+), 45 deletions(-)
 delete mode 100644 lib/vxworks/testsuite/Makefile
 create mode 100644 testsuite/vxworkstests/Makefile.am
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/lst-1.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/msgQ-1.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/msgQ-2.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/msgQ-3.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/rng-1.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/sem-1.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/sem-2.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/sem-3.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/sem-4.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/task-1.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/task-2.c (100%)
 create mode 100644 testsuite/vxworkstests/vxworkstest_driver.c
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/wd-1.c (100%)

diff --git a/configure.ac b/configure.ac
index 0cd2b2408..801252d7c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1048,6 +1048,7 @@ AC_CONFIG_FILES([ \
 	testsuite/xeno-test/Makefile \
 	testsuite/alchemytests/Makefile \
 	testsuite/psostests/Makefile \
+	testsuite/vxworkstests/Makefile \
 	utils/Makefile \
 	utils/hdb/Makefile \
 	utils/can/Makefile \
diff --git a/lib/vxworks/testsuite/Makefile b/lib/vxworks/testsuite/Makefile
deleted file mode 100644
index 648c9be90..000000000
--- a/lib/vxworks/testsuite/Makefile
+++ /dev/null
@@ -1,43 +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)
-
-ifeq ($(prefix),)
-$(error Please add <xenomai-install-path>/bin to your PATH variable or specify DESTDIR)
-endif
-
-TESTS := task-1 task-2 msgQ-1 msgQ-2 msgQ-3 wd-1 sem-1 sem-2 sem-3 sem-4 lst-1 rng-1
-
-CFLAGS := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --skin=vxworks --cflags) -g
-LDFLAGS := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --skin=vxworks --ldflags)
-CC = $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --cc)
-
-all: $(TESTS)
-
-%: %.c
-	$(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
-
-install: all
-	install -d $(prefix)/testsuite/vxworks
-	install -t $(prefix)/testsuite/vxworks $(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
diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
index cea688199..843983ddd 100644
--- a/testsuite/Makefile.am
+++ b/testsuite/Makefile.am
@@ -9,7 +9,8 @@ SUBDIRS += 		\
 	switchtest	\
 	xeno-test	\
 	alchemytests	\
-	psostests
+	psostests	\
+	vxworkstests
 endif
 
 DIST_SUBDIRS =		\
@@ -22,4 +23,5 @@ DIST_SUBDIRS =		\
 	switchtest	\
 	xeno-test	\
 	alchemytests	\
-	psostests
+	psostests	\
+	vxworkstests
diff --git a/testsuite/vxworkstests/Makefile.am b/testsuite/vxworkstests/Makefile.am
new file mode 100644
index 000000000..39cdd043b
--- /dev/null
+++ b/testsuite/vxworkstests/Makefile.am
@@ -0,0 +1,100 @@
+testdir = @XENO_TEST_DIR@
+
+CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
+
+test_PROGRAMS = vxworkstest_driver \
+		lst1	\
+		msgQ1	\
+		msgQ2	\
+		msgQ3	\
+		rng1	\
+		sem1	\
+		sem2	\
+		sem3	\
+		sem4	\
+		wd1	\
+		task1	\
+		task2
+
+vxworkscppflags = 				\
+	$(XENO_USER_CFLAGS)		\
+	-I$(top_srcdir)/include
+
+vxworksldadd = 					\
+	../../lib/vxworks/libvxworks@CORE@.la		\
+	../../lib/copperplate/libcopperplate@CORE@.la	\
+	@XENO_CORE_LDADD@ 			\
+	@XENO_USER_LDADD@			\
+	-lpthread -lrt -lm
+
+lst1_SOURCES = lst-1.c
+lst_CPPFLAGS = $(vxworkscppflags)
+lst1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+lst1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task1_SOURCES = task-1.c
+task1_CPPFLAGS = $(vxworkscppflags)
+task1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+task1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task2_SOURCES = task-2.c
+task2_CPPFLAGS = $(vxworkscppflags)
+task2_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+task2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+msgQ1_SOURCES = msgQ-1.c
+msgQ1_CPPFLAGS = $(vxworkscppflags)
+msgQ1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+msgQ1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+msgQ2_SOURCES = msgQ-2.c
+msgQ2_CPPFLAGS = $(vxworkscppflags)
+msgQ2_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+msgQ2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+msgQ3_SOURCES = msgQ-3.c
+msgQ3_CPPFLAGS = $(vxworkscppflags)
+msgQ3_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+msgQ3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+rng1_SOURCES = rng-1.c
+rng1_CPPFLAGS = $(vxworkscppflags)
+rng1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+rng1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+sem1_SOURCES = sem-1.c
+sem1_CPPFLAGS = $(vxworkscppflags)
+sem1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+sem1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+sem2_SOURCES = sem-2.c
+sem2_CPPFLAGS = $(vxworkscppflags)
+sem2_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+sem2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+sem3_SOURCES = sem-3.c
+sem3_CPPFLAGS = $(vxworkscppflags)
+sem3_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+sem3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+sem4_SOURCES = sem-4.c
+sem4_CPPFLAGS = $(vxworkscppflags)
+sem4_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+sem4_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+wd1_SOURCES = wd-1.c
+wd1_CPPFLAGS = $(vxworkscppflags)
+wd1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+wd1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+vxworkstest_driver_SOURCES = vxworkstest_driver.c
+vxworkstest_driver_CPPFLAGS =			\
+	$(XENO_USER_CFLAGS)			\
+	-I$(top_srcdir)/include
+vxworkstest_driver_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstest_driver_LDADD =			\
+	../../lib/vxworks/libvxworks@CORE@.la		\
+	../../lib/smokey/libsmokey@CORE@.la	\
+	@XENO_CORE_LDADD@		\
+	@XENO_USER_LDADD@		\
+	-lpthread -lrt
diff --git a/lib/vxworks/testsuite/lst-1.c b/testsuite/vxworkstests/lst-1.c
similarity index 100%
rename from lib/vxworks/testsuite/lst-1.c
rename to testsuite/vxworkstests/lst-1.c
diff --git a/lib/vxworks/testsuite/msgQ-1.c b/testsuite/vxworkstests/msgQ-1.c
similarity index 100%
rename from lib/vxworks/testsuite/msgQ-1.c
rename to testsuite/vxworkstests/msgQ-1.c
diff --git a/lib/vxworks/testsuite/msgQ-2.c b/testsuite/vxworkstests/msgQ-2.c
similarity index 100%
rename from lib/vxworks/testsuite/msgQ-2.c
rename to testsuite/vxworkstests/msgQ-2.c
diff --git a/lib/vxworks/testsuite/msgQ-3.c b/testsuite/vxworkstests/msgQ-3.c
similarity index 100%
rename from lib/vxworks/testsuite/msgQ-3.c
rename to testsuite/vxworkstests/msgQ-3.c
diff --git a/lib/vxworks/testsuite/rng-1.c b/testsuite/vxworkstests/rng-1.c
similarity index 100%
rename from lib/vxworks/testsuite/rng-1.c
rename to testsuite/vxworkstests/rng-1.c
diff --git a/lib/vxworks/testsuite/sem-1.c b/testsuite/vxworkstests/sem-1.c
similarity index 100%
rename from lib/vxworks/testsuite/sem-1.c
rename to testsuite/vxworkstests/sem-1.c
diff --git a/lib/vxworks/testsuite/sem-2.c b/testsuite/vxworkstests/sem-2.c
similarity index 100%
rename from lib/vxworks/testsuite/sem-2.c
rename to testsuite/vxworkstests/sem-2.c
diff --git a/lib/vxworks/testsuite/sem-3.c b/testsuite/vxworkstests/sem-3.c
similarity index 100%
rename from lib/vxworks/testsuite/sem-3.c
rename to testsuite/vxworkstests/sem-3.c
diff --git a/lib/vxworks/testsuite/sem-4.c b/testsuite/vxworkstests/sem-4.c
similarity index 100%
rename from lib/vxworks/testsuite/sem-4.c
rename to testsuite/vxworkstests/sem-4.c
diff --git a/lib/vxworks/testsuite/task-1.c b/testsuite/vxworkstests/task-1.c
similarity index 100%
rename from lib/vxworks/testsuite/task-1.c
rename to testsuite/vxworkstests/task-1.c
diff --git a/lib/vxworks/testsuite/task-2.c b/testsuite/vxworkstests/task-2.c
similarity index 100%
rename from lib/vxworks/testsuite/task-2.c
rename to testsuite/vxworkstests/task-2.c
diff --git a/testsuite/vxworkstests/vxworkstest_driver.c b/testsuite/vxworkstests/vxworkstest_driver.c
new file mode 100644
index 000000000..a356f7e07
--- /dev/null
+++ b/testsuite/vxworkstests/vxworkstest_driver.c
@@ -0,0 +1,74 @@
+#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(lst1)
+TEST(msgQ1)
+TEST(msgQ2)
+TEST(msgQ3)
+TEST(rng1)
+TEST(sem1)
+TEST(sem2)
+TEST(sem3)
+TEST(sem4)
+TEST(wd1)
+TEST(task1)
+TEST(task2)
+
+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;
+}
diff --git a/lib/vxworks/testsuite/wd-1.c b/testsuite/vxworkstests/wd-1.c
similarity index 100%
rename from lib/vxworks/testsuite/wd-1.c
rename to testsuite/vxworkstests/wd-1.c
-- 
2.34.1



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

* Re: [PATCH v2 0/9] Revive alchemy, pSOS and VxWorks tests
  2022-04-13 21:58 [PATCH v2 0/9] Revive alchemy, pSOS and VxWorks tests Richard Weinberger
                   ` (8 preceding siblings ...)
  2022-04-13 21:58 ` [PATCH 9/9] testsuite: Integrate vwworks tests into testsuite/ Richard Weinberger
@ 2022-04-14 11:18 ` Jan Kiszka
  2022-04-14 11:29   ` Richard Weinberger
                     ` (2 more replies)
  2023-04-06 10:33 ` [PATCH v3 0/11] " Aaron Marcher
  10 siblings, 3 replies; 112+ messages in thread
From: Jan Kiszka @ 2022-04-14 11:18 UTC (permalink / raw)
  To: Richard Weinberger, xenomai

On 13.04.22 23:58, Richard Weinberger via Xenomai wrote:
> This patch series is a first attempt to integrate the currently abandoned
> alchemy, pSOS and VxWorks 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.
> 
> Test results on a x86 VM (5.15.19, Xenomai master as of today):
> - Alchemy:
>   test2 fails:
> 	[8] at task-2.c:71
> 	[1] at task-2.c:24
> 	[9] at task-2.c:79
> 	[4] at task-2.c:43
> 	[10] at task-2.c:87
> 	[5] at task-2.c:48
> 	[11] at task-2.c:92
> 	[2] at task-2.c:29
> 	[6] at task-2.c:52
> 	   0"022.972| BUG in __traceobj_check_abort(): [FGND] wrong return status:
> 		      task-2.c:55 => EINVAL (want OK)
> 
>   task5 fails:
> 	[9] at task-5.c:79
> 	[1] at task-5.c:23
> 	[10] at task-5.c:87
> 	[3] at task-5.c:40
> 	[11] at task-5.c:95
> 	[4] at task-5.c:45
> 	[5] at task-5.c:50
> 	[6] at task-5.c:55
> 	[2] at task-5.c:28
> 	[7] at task-5.c:60
> 	   0"003.160| BUG in __traceobj_check_abort(): [FGND] wrong return status:
> 		      task-5.c:63 => EINVAL (want OK)

Seems we need to fix those at least.

> 
>   If Xenomai was configured with --enable-lores-clock, tests mq1, mutex1, pip1 and sem1 fail due to:
> 	undefined symbol: __clockobj_ticks_to_timeout

Missing lib dependency, likely. Cannot try out myself yet as patch 2
does not build.

> 
> - pSOS (Xenomai has to be configured with --enable-lores-clock):

If we add this test to smokey, and it requires lores-clock, we either
need to enable that in debian/rules or the Debian package built in
xenomai-images so that CI/CT will not fail. Well, it will fail so far
due to the test case problems. But that would be next.

>   rn1 fails:
> 	0"001.017| BUG in __traceobj_assert_failed(): [rn1] trace assertion failed:
> 		rn-1.c:46 => "ret == 0"
>   task2 fails:
> 	[8] at task-2.c:73
> 	[1] at task-2.c:23
> 	[9] at task-2.c:81
> 	[4] at task-2.c:44
> 	[10] at task-2.c:89
> 	[5] at task-2.c:49
> 	[11] at task-2.c:94
> 	[2] at task-2.c:28
> 	[3] at task-2.c:33
> 	[6] at task-2.c:53
> 	   0"004.756| BUG in __traceobj_assert_failed(): [FGND] trace assertion failed:
> 		      task-2.c:56 => "ret == 0"
> 
>   task6 fails:
> 	[9] at task-6.c:79
> 	[1] at task-6.c:22
> 	[10] at task-6.c:87
> 	[3] at task-6.c:39
> 	[11] at task-6.c:95
> 	[4] at task-6.c:44
> 	[5] at task-6.c:49
> 	[6] at task-6.c:54
> 	[2] at task-6.c:27
> 	[7] at task-6.c:59
> 	   0"002.870| BUG in __traceobj_assert_failed(): [FGND] trace assertion failed:
> 		      task-6.c:62 => "ret == 0 && oldprio == myprio"
> 
>   task8 runs forever (100% CPU)
> 
> - VxWorks:
>   task2 fails:
> 	[8] at task-2.c:85
> 	[1] at task-2.c:32
> 	[9] at task-2.c:91
> 	[4] at task-2.c:57
> 	[10] at task-2.c:97
> 	[5] at task-2.c:62
> 	[11] at task-2.c:103
> 	[2] at task-2.c:37
> 	[12] at task-2.c:109
> 	[6] at task-2.c:66
> 	   0"005.790| BUG in __traceobj_assert_failed(): [foregroundTask] trace assertion failed:
> 		      task-2.c:69 => "ret == 0"
> 

So... reviving means fixing first, unfortunately. Then enable CI/CT, and
then we can merge. The pattern looks scalable, but then we could also
apply it stepwise: first alchemy, then vxworks and finally psos with
that lores-clock topic.

Jan

-- 
Siemens AG, Technology
Competence Center Embedded Linux


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

* Re: [PATCH 3/9] testsuite: Add a simple test driver for alchemytests
  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
  0 siblings, 1 reply; 112+ messages in thread
From: Jan Kiszka @ 2022-04-14 11:28 UTC (permalink / raw)
  To: Richard Weinberger, xenomai

On 13.04.22 23:58, Richard Weinberger via Xenomai wrote:
> 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.

Maybe rather call this "wrapper" or "loader" - driver reminded my first
of a kernel driver.

Jan

> 
> 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;
> +}

-- 
Siemens AG, Technology
Competence Center Embedded Linux


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

* Re: [PATCH v2 0/9] Revive alchemy, pSOS and VxWorks tests
  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 15:13   ` Richard Weinberger
  2 siblings, 0 replies; 112+ messages in thread
From: Richard Weinberger @ 2022-04-14 11:29 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: xenomai

----- Ursprüngliche Mail -----
> Von: "Jan Kiszka" <jan.kiszka@siemens.com>
> Seems we need to fix those at least.

Agreed.
 
>> 
>>   If Xenomai was configured with --enable-lores-clock, tests mq1, mutex1, pip1 and
>>   sem1 fail due to:
>> 	undefined symbol: __clockobj_ticks_to_timeout
> 
> Missing lib dependency, likely. Cannot try out myself yet as patch 2
> does not build.

Maybe, I found it quite interesting that building the tests works fine
but at runtime I get the undefined symbol error.

> So... reviving means fixing first, unfortunately. Then enable CI/CT, and

This was expected, no worries.

> then we can merge. The pattern looks scalable, but then we could also
> apply it stepwise: first alchemy, then vxworks and finally psos with
> that lores-clock topic.

Sounds like a plan.

Thanks,
//richard


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

* Re: [PATCH 3/9] testsuite: Add a simple test driver for alchemytests
  2022-04-14 11:28   ` Jan Kiszka
@ 2022-04-14 11:42     ` Richard Weinberger
  0 siblings, 0 replies; 112+ messages in thread
From: Richard Weinberger @ 2022-04-14 11:42 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: xenomai

----- Ursprüngliche Mail -----
> Von: "Jan Kiszka" <jan.kiszka@siemens.com>
>> alchemytest_driver uses smokey and runs each test as new process.
> 
> Maybe rather call this "wrapper" or "loader" - driver reminded my first
> of a kernel driver.

Sure. Or "runner"?

Thanks,
//richard


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

* Re: [PATCH v2 0/9] Revive alchemy, pSOS and VxWorks tests
  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 15:13   ` Richard Weinberger
  2 siblings, 1 reply; 112+ messages in thread
From: Richard Weinberger @ 2022-04-14 12:58 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: Donnerstag, 14. April 2022 13:18:59
> Betreff: Re: [PATCH v2 0/9] Revive alchemy, pSOS and VxWorks tests

> On 13.04.22 23:58, Richard Weinberger via Xenomai wrote:
>> This patch series is a first attempt to integrate the currently abandoned
>> alchemy, pSOS and VxWorks 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.
>> 
>> Test results on a x86 VM (5.15.19, Xenomai master as of today):
>> - Alchemy:
>>   test2 fails:
>> 	[8] at task-2.c:71
>> 	[1] at task-2.c:24
>> 	[9] at task-2.c:79
>> 	[4] at task-2.c:43
>> 	[10] at task-2.c:87
>> 	[5] at task-2.c:48
>> 	[11] at task-2.c:92
>> 	[2] at task-2.c:29
>> 	[6] at task-2.c:52
>> 	   0"022.972| BUG in __traceobj_check_abort(): [FGND] wrong return status:
>> 		      task-2.c:55 => EINVAL (want OK)

task-2 seems suffers from modern gcc, changes to safety and count are dead stores.

This makes the test pass here:

diff --git a/testsuite/alchemytests/task-2.c b/testsuite/alchemytests/task-2.c
index e751ddd34..9d5281c75 100644
--- a/testsuite/alchemytests/task-2.c
+++ b/testsuite/alchemytests/task-2.c
@@ -28,8 +28,10 @@ static void background_task(void *arg)
 
        traceobj_mark(&trobj, 2);
 
-       while (--safety > 0)
+       while (--safety > 0) {
+               compiler_barrier();
                count++;
+       }
 
        traceobj_exit(&trobj);
 }

...same does marking both variables as volatile.

Thanks,
//richard


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

* Re: [PATCH v2 0/9] Revive alchemy, pSOS and VxWorks tests
  2022-04-14 12:58   ` Richard Weinberger
@ 2022-04-14 14:15     ` Bezdeka, Florian
  2022-04-14 14:19       ` Richard Weinberger
  0 siblings, 1 reply; 112+ messages in thread
From: Bezdeka, Florian @ 2022-04-14 14:15 UTC (permalink / raw)
  To: jan.kiszka, richard; +Cc: xenomai

On Thu, 2022-04-14 at 14:58 +0200, Richard Weinberger via Xenomai
wrote:
> ----- Ursprüngliche Mail -----
> > Von: "Jan Kiszka" <jan.kiszka@siemens.com>
> > An: "richard" <richard@nod.at>, "xenomai" <xenomai@xenomai.org>
> > Gesendet: Donnerstag, 14. April 2022 13:18:59
> > Betreff: Re: [PATCH v2 0/9] Revive alchemy, pSOS and VxWorks tests
> 
> > On 13.04.22 23:58, Richard Weinberger via Xenomai wrote:
> > > This patch series is a first attempt to integrate the currently abandoned
> > > alchemy, pSOS and VxWorks 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.
> > > 
> > > Test results on a x86 VM (5.15.19, Xenomai master as of today):
> > > - Alchemy:
> > >   test2 fails:
> > > 	[8] at task-2.c:71
> > > 	[1] at task-2.c:24
> > > 	[9] at task-2.c:79
> > > 	[4] at task-2.c:43
> > > 	[10] at task-2.c:87
> > > 	[5] at task-2.c:48
> > > 	[11] at task-2.c:92
> > > 	[2] at task-2.c:29
> > > 	[6] at task-2.c:52
> > > 	   0"022.972| BUG in __traceobj_check_abort(): [FGND] wrong return status:
> > > 		      task-2.c:55 => EINVAL (want OK)
> 
> task-2 seems suffers from modern gcc, changes to safety and count are dead stores.
> 
> This makes the test pass here:
> 
> diff --git a/testsuite/alchemytests/task-2.c b/testsuite/alchemytests/task-2.c
> index e751ddd34..9d5281c75 100644
> --- a/testsuite/alchemytests/task-2.c
> +++ b/testsuite/alchemytests/task-2.c
> @@ -28,8 +28,10 @@ static void background_task(void *arg)
>  
>         traceobj_mark(&trobj, 2);
>  
> -       while (--safety > 0)
> +       while (--safety > 0) {
> +               compiler_barrier();
>                 count++;
> +       }
>  
>         traceobj_exit(&trobj);
>  }
> 
> ...same does marking both variables as volatile.

I don't have much context here, but volatile sounds like a valid
solution (assuming that safety is written by a different thread)

> 
> Thanks,
> //richard
> 


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

* Re: [PATCH v2 0/9] Revive alchemy, pSOS and VxWorks tests
  2022-04-14 14:15     ` Bezdeka, Florian
@ 2022-04-14 14:19       ` Richard Weinberger
  0 siblings, 0 replies; 112+ messages in thread
From: Richard Weinberger @ 2022-04-14 14:19 UTC (permalink / raw)
  To: Florian Bezdeka; +Cc: Jan Kiszka, xenomai

----- Ursprüngliche Mail -----
> Von: "Florian Bezdeka" <florian.bezdeka@siemens.com>
>> ...same does marking both variables as volatile.
> 
> I don't have much context here, but volatile sounds like a valid
> solution (assuming that safety is written by a different thread)

Both variables are written by the very same thread.
The problem is that the don't get used later, so the compiler is free
to remove the loop. That's why the barrier fixes the problem.
It forces the compiler to keep the loop.

Thanks,
//richard


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

* Re: [PATCH v2 0/9] Revive alchemy, pSOS and VxWorks tests
  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 15:13   ` Richard Weinberger
  2022-04-14 15:34     ` Jan Kiszka
  2 siblings, 1 reply; 112+ messages in thread
From: Richard Weinberger @ 2022-04-14 15:13 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: xenomai

----- Ursprüngliche Mail -----
> Von: "Jan Kiszka" <jan.kiszka@siemens.com>
>>   task5 fails:
>> 	[9] at task-5.c:79
>> 	[1] at task-5.c:23
>> 	[10] at task-5.c:87
>> 	[3] at task-5.c:40
>> 	[11] at task-5.c:95
>> 	[4] at task-5.c:45
>> 	[5] at task-5.c:50
>> 	[6] at task-5.c:55
>> 	[2] at task-5.c:28
>> 	[7] at task-5.c:60
>> 	   0"003.160| BUG in __traceobj_check_abort(): [FGND] wrong return status:
>> 		      task-5.c:63 => EINVAL (want OK)


This failure is a little trickier.

Line 62 is:
ret = rt_task_set_priority(&t_bgnd, info.prio + 1);
ret is EINVAL, that's why the assert in line 63 fails.
It fails because t_bgnd has already terminated.

This concurs also with the above marker [2].
[2] is reached when t_bgnd is done.

The foreground task does:
        ret = rt_task_inquire(NULL, &info);
        traceobj_assert(&trobj, ret == 0 && info.prio == 21);

        traceobj_mark(&trobj, 6);

        ret = rt_task_set_priority(&t_bgnd, info.prio);
        traceobj_check(&trobj, ret, 0);

        traceobj_mark(&trobj, 7);

        ret = rt_task_set_priority(&t_bgnd, info.prio + 1);
        traceobj_check(&trobj, ret, 0);

        traceobj_mark(&trobj, 8);

So it asks for it's own priority, it must be 21, that's okay.
Then it raises the priority of t_bgnd from 20 to 21
and assumes that no scheduling happens. But this seems to fail.

Did the nucleus CPU scheduler guarantee that giving another task
the same priority of the calling task will favour the caller?
Now the gifted task seems to win.

Thanks,
//richard


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

* Re: [PATCH v2 0/9] Revive alchemy, pSOS and VxWorks tests
  2022-04-14 15:13   ` Richard Weinberger
@ 2022-04-14 15:34     ` Jan Kiszka
  2022-04-14 15:41       ` Richard Weinberger
  0 siblings, 1 reply; 112+ messages in thread
From: Jan Kiszka @ 2022-04-14 15:34 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: xenomai

On 14.04.22 17:13, Richard Weinberger wrote:
> ----- Ursprüngliche Mail -----
>> Von: "Jan Kiszka" <jan.kiszka@siemens.com>
>>>   task5 fails:
>>> 	[9] at task-5.c:79
>>> 	[1] at task-5.c:23
>>> 	[10] at task-5.c:87
>>> 	[3] at task-5.c:40
>>> 	[11] at task-5.c:95
>>> 	[4] at task-5.c:45
>>> 	[5] at task-5.c:50
>>> 	[6] at task-5.c:55
>>> 	[2] at task-5.c:28
>>> 	[7] at task-5.c:60
>>> 	   0"003.160| BUG in __traceobj_check_abort(): [FGND] wrong return status:
>>> 		      task-5.c:63 => EINVAL (want OK)
> 
> 
> This failure is a little trickier.
> 
> Line 62 is:
> ret = rt_task_set_priority(&t_bgnd, info.prio + 1);
> ret is EINVAL, that's why the assert in line 63 fails.
> It fails because t_bgnd has already terminated.
> 
> This concurs also with the above marker [2].
> [2] is reached when t_bgnd is done.
> 
> The foreground task does:
>         ret = rt_task_inquire(NULL, &info);
>         traceobj_assert(&trobj, ret == 0 && info.prio == 21);
> 
>         traceobj_mark(&trobj, 6);
> 
>         ret = rt_task_set_priority(&t_bgnd, info.prio);
>         traceobj_check(&trobj, ret, 0);
> 
>         traceobj_mark(&trobj, 7);
> 
>         ret = rt_task_set_priority(&t_bgnd, info.prio + 1);
>         traceobj_check(&trobj, ret, 0);
> 
>         traceobj_mark(&trobj, 8);
> 
> So it asks for it's own priority, it must be 21, that's okay.
> Then it raises the priority of t_bgnd from 20 to 21
> and assumes that no scheduling happens. But this seems to fail.
> 
> Did the nucleus CPU scheduler guarantee that giving another task
> the same priority of the calling task will favour the caller?
> Now the gifted task seems to win.

Did you configure with --enable-lazy-setsched? If not, set_prio should
send the caller to Linux, and that will definitely cause some scheduling
change.

Jan

-- 
Siemens AG, Technology
Competence Center Embedded Linux


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

* Re: [PATCH v2 0/9] Revive alchemy, pSOS and VxWorks tests
  2022-04-14 15:34     ` Jan Kiszka
@ 2022-04-14 15:41       ` Richard Weinberger
  2022-04-14 15:43         ` Jan Kiszka
  0 siblings, 1 reply; 112+ messages in thread
From: Richard Weinberger @ 2022-04-14 15:41 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: xenomai

----- Ursprüngliche Mail -----
>> Did the nucleus CPU scheduler guarantee that giving another task
>> the same priority of the calling task will favour the caller?
>> Now the gifted task seems to win.
> 
> Did you configure with --enable-lazy-setsched? If not, set_prio should
> send the caller to Linux, and that will definitely cause some scheduling
> change.

Yes. -enable-lazy-setsched is set.

Thanks,
//richard


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

* Re: [PATCH v2 0/9] Revive alchemy, pSOS and VxWorks tests
  2022-04-14 15:41       ` Richard Weinberger
@ 2022-04-14 15:43         ` Jan Kiszka
  0 siblings, 0 replies; 112+ messages in thread
From: Jan Kiszka @ 2022-04-14 15:43 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: xenomai

On 14.04.22 17:41, Richard Weinberger wrote:
> ----- Ursprüngliche Mail -----
>>> Did the nucleus CPU scheduler guarantee that giving another task
>>> the same priority of the calling task will favour the caller?
>>> Now the gifted task seems to win.
>>
>> Did you configure with --enable-lazy-setsched? If not, set_prio should
>> send the caller to Linux, and that will definitely cause some scheduling
>> change.
> 
> Yes. -enable-lazy-setsched is set.
> 

Then it's better to trace than to speculate.

Jan

-- 
Siemens AG, Technology
Competence Center Embedded Linux


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

* [PATCH v3 0/11] Revive alchemy, pSOS and VxWorks tests
  2022-04-13 21:58 [PATCH v2 0/9] Revive alchemy, pSOS and VxWorks tests Richard Weinberger
                   ` (9 preceding siblings ...)
  2022-04-14 11:18 ` [PATCH v2 0/9] Revive alchemy, pSOS and VxWorks tests Jan Kiszka
@ 2023-04-06 10:33 ` Aaron Marcher
  2023-04-06 10:33   ` [PATCH 01/11] testsuite: Move alchemy tests into testsuite/ Aaron Marcher
                     ` (12 more replies)
  10 siblings, 13 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-04-06 10:33 UTC (permalink / raw)
  To: xenomai; +Cc: richard, florian.bezdeka, jan.kiszka, Aaron Marcher

This patch series is an attempt to integrate the currently abandoned
alchemy, pSOS and VxWorks 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.

New test results on a x86 VM (5.15.94, Xenomai master as of today):

- vxworkstests/task-2 fails:

    [8] at
    testsuite/vxworkstests/task-2.c:85
    [1] at
    testsuite/vxworkstests/task-2.c:32
    [9] at
    testsuite/vxworkstests/task-2.c:91
    [4] at
    testsuite/vxworkstests/task-2.c:57
    [10] at
    testsuite/vxworkstests/task-2.c:97
    [5] at
    testsuite/vxworkstests/task-2.c:62
    [11] at
    testsuite/vxworkstests/task-2.c:103
    [2] at
    testsuite/vxworkstests/task-2.c:37
    [12] at
    testsuite/vxworkstests/task-2.c:109
    [6] at
    testsuite/vxworkstests/task-2.c:66
       0"014.637| BUG in __traceobj_assert_failed(): [foregroundTask] trace
    assertion failed:
                  testsuite/vxworkstests/task-2.c:69
    => "ret == 0"

- psostests/task-6 fails:

    [9] at
    testsuite/psostests/task-6.c:79
    [1] at
    testsuite/psostests/task-6.c:22
    [10] at
    testsuite/psostests/task-6.c:87
    [3] at
    testsuite/psostests/task-6.c:39
    [11] at
    testsuite/psostests/task-6.c:95
    [4] at
    testsuite/psostests/task-6.c:44
    [5] at
    testsuite/psostests/task-6.c:49
    [6] at
    testsuite/psostests/task-6.c:54
    [2] at
    testsuite/psostests/task-6.c:27
    [7] at
    testsuite/psostests/task-6.c:59
       0"011.370| BUG in __traceobj_assert_failed(): [FGND] trace assertion failed:
                  testsuite/psostests/task-6.c:62
    => "ret == 0 && oldprio == myprio"

- psostests/rn-1 fails:

    0"000.679| BUG in __traceobj_assert_failed(): [rn1] trace assertion failed:
              testsuite/psostests/rn-1.c:46
    => "ret == 0"

- task-8 runs forever (100% CPU)

Changes since v2:
 - Rebase to latest master
 - Fix build failures
 - Fix some failing tests

Aaron Marcher (2):
  alchemytests: check pipe-1 asprintf ret value
  vxworkstests: fix Makefile.am reference

Richard Weinberger (9):
  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
  testsuite: Move pSOS tests into testsuite/
  testsuite: Add a simple test driver for psostests
  testsuite: Integrate vwworks tests into testsuite/

 configure.ac                                  |   3 +
 lib/alchemy/testsuite/Makefile                |  70 --------
 lib/psos/testsuite/Makefile                   |  49 ------
 lib/vxworks/testsuite/Makefile                |  43 -----
 testsuite/Makefile.am                         |  10 +-
 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                    |   6 +-
 .../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 +-
 testsuite/psostests/Makefile.am               | 166 ++++++++++++++++++
 .../testsuite => testsuite/psostests}/mq-1.c  |   0
 .../testsuite => testsuite/psostests}/mq-2.c  |   0
 .../testsuite => testsuite/psostests}/mq-3.c  |   0
 testsuite/psostests/psostest_driver.c         |  85 +++++++++
 .../testsuite => testsuite/psostests}/pt-1.c  |   0
 .../testsuite => testsuite/psostests}/rn-1.c  |   0
 .../testsuite => testsuite/psostests}/sem-1.c |   0
 .../testsuite => testsuite/psostests}/sem-2.c |   0
 .../psostests}/task-1.c                       |   0
 .../psostests}/task-2.c                       |   0
 .../psostests}/task-3.c                       |   0
 .../psostests}/task-4.c                       |   0
 .../psostests}/task-5.c                       |   0
 .../psostests}/task-6.c                       |   0
 .../psostests}/task-7.c                       |   0
 .../psostests}/task-8.c                       |   0
 .../psostests}/task-9.c                       |   0
 .../testsuite => testsuite/psostests}/tm-1.c  |   0
 .../testsuite => testsuite/psostests}/tm-2.c  |   0
 .../testsuite => testsuite/psostests}/tm-3.c  |   0
 .../testsuite => testsuite/psostests}/tm-4.c  |   0
 .../testsuite => testsuite/psostests}/tm-5.c  |   0
 .../testsuite => testsuite/psostests}/tm-6.c  |   0
 .../testsuite => testsuite/psostests}/tm-7.c  |   0
 testsuite/vxworkstests/Makefile.am            | 100 +++++++++++
 .../vxworkstests}/lst-1.c                     |   0
 .../vxworkstests}/msgQ-1.c                    |   0
 .../vxworkstests}/msgQ-2.c                    |   0
 .../vxworkstests}/msgQ-3.c                    |   0
 .../vxworkstests}/rng-1.c                     |   0
 .../vxworkstests}/sem-1.c                     |   0
 .../vxworkstests}/sem-2.c                     |   0
 .../vxworkstests}/sem-3.c                     |   0
 .../vxworkstests}/sem-4.c                     |   0
 .../vxworkstests}/task-1.c                    |   0
 .../vxworkstests}/task-2.c                    |   0
 testsuite/vxworkstests/vxworkstest_driver.c   |  74 ++++++++
 .../vxworkstests}/wd-1.c                      |   0
 68 files changed, 685 insertions(+), 168 deletions(-)
 delete mode 100644 lib/alchemy/testsuite/Makefile
 delete mode 100644 lib/psos/testsuite/Makefile
 delete mode 100644 lib/vxworks/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 (97%)
 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%)
 create mode 100644 testsuite/psostests/Makefile.am
 rename {lib/psos/testsuite => testsuite/psostests}/mq-1.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/mq-2.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/mq-3.c (100%)
 create mode 100644 testsuite/psostests/psostest_driver.c
 rename {lib/psos/testsuite => testsuite/psostests}/pt-1.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/rn-1.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/sem-1.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/sem-2.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-1.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-2.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-3.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-4.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-5.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-6.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-7.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-8.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-9.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/tm-1.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/tm-2.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/tm-3.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/tm-4.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/tm-5.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/tm-6.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/tm-7.c (100%)
 create mode 100644 testsuite/vxworkstests/Makefile.am
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/lst-1.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/msgQ-1.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/msgQ-2.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/msgQ-3.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/rng-1.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/sem-1.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/sem-2.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/sem-3.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/sem-4.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/task-1.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/task-2.c (100%)
 create mode 100644 testsuite/vxworkstests/vxworkstest_driver.c
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/wd-1.c (100%)

-- 
2.35.3


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

* [PATCH 01/11] testsuite: Move alchemy tests into testsuite/
  2023-04-06 10:33 ` [PATCH v3 0/11] " Aaron Marcher
@ 2023-04-06 10:33   ` Aaron Marcher
  2023-04-06 10:33   ` [PATCH 02/11] testsuite: Hook up alchemytests Aaron Marcher
                     ` (11 subsequent siblings)
  12 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-04-06 10:33 UTC (permalink / raw)
  To: xenomai; +Cc: richard, florian.bezdeka, jan.kiszka, Aaron Marcher

From: Richard Weinberger <richard@nod.at>

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

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Aaron Marcher <aaron@sigma-star.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.35.3


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

* [PATCH 02/11] testsuite: Hook up alchemytests
  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   ` Aaron Marcher
  2023-04-06 10:33   ` [PATCH 03/11] testsuite: Add a simple test driver for alchemytests Aaron Marcher
                     ` (10 subsequent siblings)
  12 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-04-06 10:33 UTC (permalink / raw)
  To: xenomai; +Cc: richard, florian.bezdeka, jan.kiszka, Aaron Marcher

From: Richard Weinberger <richard@nod.at>

Build them using Xenomai's build system.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Aaron Marcher <aaron@sigma-star.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 3ce34048e6..36f4aa9933 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1045,6 +1045,7 @@ AC_CONFIG_FILES([ \
 	testsuite/smokey/x86io/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 4932f6d33e..e027485fb6 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 0000000000..35df0d49c2
--- /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.35.3


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

* [PATCH 03/11] testsuite: Add a simple test driver for alchemytests
  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   ` Aaron Marcher
  2023-04-06 10:33   ` [PATCH 04/11] Remove old alchemy tests Makefile Aaron Marcher
                     ` (9 subsequent siblings)
  12 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-04-06 10:33 UTC (permalink / raw)
  To: xenomai; +Cc: richard, florian.bezdeka, jan.kiszka, Aaron Marcher

From: Richard Weinberger <richard@nod.at>

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>
Signed-off-by: Aaron Marcher <aaron@sigma-star.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 35df0d49c2..9159a0b770 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 0000000000..45323507d0
--- /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.35.3


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

* [PATCH 04/11] Remove old alchemy tests Makefile
  2023-04-06 10:33 ` [PATCH v3 0/11] " Aaron Marcher
                     ` (2 preceding siblings ...)
  2023-04-06 10:33   ` [PATCH 03/11] testsuite: Add a simple test driver for alchemytests Aaron Marcher
@ 2023-04-06 10:33   ` Aaron Marcher
  2023-04-06 10:33   ` [PATCH 05/11] alchemytests: Fix gcc warning in buffer-1 Aaron Marcher
                     ` (8 subsequent siblings)
  12 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-04-06 10:33 UTC (permalink / raw)
  To: xenomai; +Cc: richard, florian.bezdeka, jan.kiszka, Aaron Marcher

From: Richard Weinberger <richard@nod.at>

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Aaron Marcher <aaron@sigma-star.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 a831c999e8..0000000000
--- 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.35.3


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

* [PATCH 05/11] alchemytests: Fix gcc warning in buffer-1
  2023-04-06 10:33 ` [PATCH v3 0/11] " Aaron Marcher
                     ` (3 preceding siblings ...)
  2023-04-06 10:33   ` [PATCH 04/11] Remove old alchemy tests Makefile Aaron Marcher
@ 2023-04-06 10:33   ` Aaron Marcher
  2023-04-06 10:33   ` [PATCH 06/11] alchemytests: Fix gcc warning in task-9 Aaron Marcher
                     ` (7 subsequent siblings)
  12 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-04-06 10:33 UTC (permalink / raw)
  To: xenomai; +Cc: richard, florian.bezdeka, jan.kiszka, Aaron Marcher

From: Richard Weinberger <richard@nod.at>

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>
Signed-off-by: Aaron Marcher <aaron@sigma-star.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 d6d1d9ad72..807db1dcfe 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.35.3


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

* [PATCH 06/11] alchemytests: Fix gcc warning in task-9
  2023-04-06 10:33 ` [PATCH v3 0/11] " Aaron Marcher
                     ` (4 preceding siblings ...)
  2023-04-06 10:33   ` [PATCH 05/11] alchemytests: Fix gcc warning in buffer-1 Aaron Marcher
@ 2023-04-06 10:33   ` Aaron Marcher
  2023-04-06 10:33   ` [PATCH 07/11] testsuite: Move pSOS tests into testsuite/ Aaron Marcher
                     ` (6 subsequent siblings)
  12 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-04-06 10:33 UTC (permalink / raw)
  To: xenomai; +Cc: richard, florian.bezdeka, jan.kiszka, Aaron Marcher

From: Richard Weinberger <richard@nod.at>

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>
Signed-off-by: Aaron Marcher <aaron@sigma-star.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 e358154c59..4b62a17beb 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.35.3


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

* [PATCH 07/11] testsuite: Move pSOS tests into testsuite/
  2023-04-06 10:33 ` [PATCH v3 0/11] " Aaron Marcher
                     ` (5 preceding siblings ...)
  2023-04-06 10:33   ` [PATCH 06/11] alchemytests: Fix gcc warning in task-9 Aaron Marcher
@ 2023-04-06 10:33   ` Aaron Marcher
  2023-04-06 10:33   ` [PATCH 08/11] testsuite: Add a simple test driver for psostests Aaron Marcher
                     ` (5 subsequent siblings)
  12 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-04-06 10:33 UTC (permalink / raw)
  To: xenomai; +Cc: richard, florian.bezdeka, jan.kiszka, Aaron Marcher

From: Richard Weinberger <richard@nod.at>

Just like for alchemy tests, integrate them into our test suite.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 configure.ac                                  |   1 +
 lib/psos/testsuite/Makefile                   |  49 ------
 testsuite/Makefile.am                         |   6 +-
 testsuite/psostests/Makefile.am               | 153 ++++++++++++++++++
 .../testsuite => testsuite/psostests}/mq-1.c  |   0
 .../testsuite => testsuite/psostests}/mq-2.c  |   0
 .../testsuite => testsuite/psostests}/mq-3.c  |   0
 .../testsuite => testsuite/psostests}/pt-1.c  |   0
 .../testsuite => testsuite/psostests}/rn-1.c  |   0
 .../testsuite => testsuite/psostests}/sem-1.c |   0
 .../testsuite => testsuite/psostests}/sem-2.c |   0
 .../psostests}/task-1.c                       |   0
 .../psostests}/task-2.c                       |   0
 .../psostests}/task-3.c                       |   0
 .../psostests}/task-4.c                       |   0
 .../psostests}/task-5.c                       |   0
 .../psostests}/task-6.c                       |   0
 .../psostests}/task-7.c                       |   0
 .../psostests}/task-8.c                       |   0
 .../psostests}/task-9.c                       |   0
 .../testsuite => testsuite/psostests}/tm-1.c  |   0
 .../testsuite => testsuite/psostests}/tm-2.c  |   0
 .../testsuite => testsuite/psostests}/tm-3.c  |   0
 .../testsuite => testsuite/psostests}/tm-4.c  |   0
 .../testsuite => testsuite/psostests}/tm-5.c  |   0
 .../testsuite => testsuite/psostests}/tm-6.c  |   0
 .../testsuite => testsuite/psostests}/tm-7.c  |   0
 27 files changed, 158 insertions(+), 51 deletions(-)
 delete mode 100644 lib/psos/testsuite/Makefile
 create mode 100644 testsuite/psostests/Makefile.am
 rename {lib/psos/testsuite => testsuite/psostests}/mq-1.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/mq-2.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/mq-3.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/pt-1.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/rn-1.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/sem-1.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/sem-2.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-1.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-2.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-3.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-4.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-5.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-6.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-7.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-8.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/task-9.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/tm-1.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/tm-2.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/tm-3.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/tm-4.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/tm-5.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/tm-6.c (100%)
 rename {lib/psos/testsuite => testsuite/psostests}/tm-7.c (100%)

diff --git a/configure.ac b/configure.ac
index 36f4aa9933..afb9d89151 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1046,6 +1046,7 @@ AC_CONFIG_FILES([ \
 	testsuite/clocktest/Makefile \
 	testsuite/xeno-test/Makefile \
 	testsuite/alchemytests/Makefile \
+	testsuite/psostests/Makefile \
 	utils/Makefile \
 	utils/hdb/Makefile \
 	utils/can/Makefile \
diff --git a/lib/psos/testsuite/Makefile b/lib/psos/testsuite/Makefile
deleted file mode 100644
index 3330a617ca..0000000000
--- a/lib/psos/testsuite/Makefile
+++ /dev/null
@@ -1,49 +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)
-
-ifeq ($(prefix),)
-$(error Please add <xenomai-install-path>/bin to your PATH variable or specify DESTDIR)
-endif
-
-TESTS := \
-	task-1 task-2 task-3 task-4 task-5 task-6 task-7 task-8 task-9 \
-	tm-1 tm-2 tm-3 tm-4 tm-5 tm-6 tm-7 \
-	mq-1 mq-2 mq-3 \
-	sem-1 sem-2 \
-	pt-1 \
-	rn-1
-
-CFLAGS := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --skin=psos --cflags) -g
-LDFLAGS := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --skin=psos --ldflags)
-CC = $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --cc)
-
-all: $(TESTS)
-
-%: %.c
-	$(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
-
-install: all
-	install -d $(prefix)/testsuite/psos
-	install -t $(prefix)/testsuite/psos $(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
diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
index e027485fb6..137bfbf31c 100644
--- a/testsuite/Makefile.am
+++ b/testsuite/Makefile.am
@@ -8,7 +8,8 @@ SUBDIRS += 		\
 	spitest		\
 	switchtest	\
 	xeno-test	\
-	alchemytests
+	alchemytests	\
+	psostests
 endif
 
 DIST_SUBDIRS =		\
@@ -20,4 +21,5 @@ DIST_SUBDIRS =		\
 	spitest		\
 	switchtest	\
 	xeno-test	\
-	alchemytests
+	alchemytests \
+	psostests
diff --git a/testsuite/psostests/Makefile.am b/testsuite/psostests/Makefile.am
new file mode 100644
index 0000000000..9e8aef62b7
--- /dev/null
+++ b/testsuite/psostests/Makefile.am
@@ -0,0 +1,153 @@
+testdir = @XENO_TEST_DIR@
+
+CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
+
+test_PROGRAMS = mq1	\
+		mq2	\
+		mq3	\
+		pt1	\
+		rn1	\
+		sem1	\
+		sem2	\
+		tm1	\
+		tm2	\
+		tm3	\
+		tm4	\
+		tm5	\
+		tm6	\
+		tm7	\
+		task1	\
+		task2	\
+		task3	\
+		task4	\
+		task5	\
+		task6	\
+		task7	\
+		task8	\
+		task9
+
+psoscppflags = 				\
+	$(XENO_USER_CFLAGS)		\
+	-I$(top_srcdir)/include
+
+psosldadd = 					\
+	../../lib/psos/libpsos@CORE@.la		\
+	../../lib/copperplate/libcopperplate@CORE@.la	\
+	@XENO_CORE_LDADD@ 			\
+	@XENO_USER_LDADD@			\
+	-lpthread -lrt -lm
+
+mq1_SOURCES = mq-1.c
+mq1_CPPFLAGS = $(psoscppflags)
+mq1_LDADD = $(psosldadd) -lpthread -lrt -lm
+mq1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+mq2_SOURCES = mq-2.c
+mq2_CPPFLAGS = $(psoscppflags)
+mq2_LDADD = $(psosldadd) -lpthread -lrt -lm
+mq2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+mq3_SOURCES = mq-3.c
+mq3_CPPFLAGS = $(psoscppflags)
+mq3_LDADD = $(psosldadd) -lpthread -lrt -lm
+mq3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+pt1_SOURCES = pt-1.c
+pt1_CPPFLAGS = $(psoscppflags)
+pt1_LDADD = $(psosldadd) -lpthread -lrt -lm
+pt1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+rn1_SOURCES = rn-1.c
+rn1_CPPFLAGS = $(psoscppflags)
+rn1_LDADD = $(psosldadd) -lpthread -lrt -lm
+rn1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+sem1_SOURCES = sem-1.c
+sem1_CPPFLAGS = $(psoscppflags)
+sem1_LDADD = $(psosldadd) -lpthread -lrt -lm
+sem1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+sem2_SOURCES = sem-2.c
+sem2_CPPFLAGS = $(psoscppflags)
+sem2_LDADD = $(psosldadd) -lpthread -lrt -lm
+sem2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+tm1_SOURCES = tm-1.c
+tm1_CPPFLAGS = $(psoscppflags)
+tm1_LDADD = $(psosldadd) -lpthread -lrt -lm
+tm1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+tm2_SOURCES = tm-2.c
+tm2_CPPFLAGS = $(psoscppflags)
+tm2_LDADD = $(psosldadd) -lpthread -lrt -lm
+tm2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+tm3_SOURCES = tm-3.c
+tm3_CPPFLAGS = $(psoscppflags)
+tm3_LDADD = $(psosldadd) -lpthread -lrt -lm
+tm3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+tm4_SOURCES = tm-4.c
+tm4_CPPFLAGS = $(psoscppflags)
+tm4_LDADD = $(psosldadd) -lpthread -lrt -lm
+tm4_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+tm5_SOURCES = tm-5.c
+tm5_CPPFLAGS = $(psoscppflags)
+tm5_LDADD = $(psosldadd) -lpthread -lrt -lm
+tm5_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+tm6_SOURCES = tm-6.c
+tm6_CPPFLAGS = $(psoscppflags)
+tm6_LDADD = $(psosldadd) -lpthread -lrt -lm
+tm6_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+tm7_SOURCES = tm-7.c
+tm7_CPPFLAGS = $(psoscppflags)
+tm7_LDADD = $(psosldadd) -lpthread -lrt -lm
+tm7_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task1_SOURCES = task-1.c
+task1_CPPFLAGS = $(psoscppflags)
+task1_LDADD = $(psosldadd) -lpthread -lrt -lm
+task1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task2_SOURCES = task-2.c
+task2_CPPFLAGS = $(psoscppflags)
+task2_LDADD = $(psosldadd) -lpthread -lrt -lm
+task2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task3_SOURCES = task-3.c
+task3_CPPFLAGS = $(psoscppflags)
+task3_LDADD = $(psosldadd) -lpthread -lrt -lm
+task3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task4_SOURCES = task-4.c
+task4_CPPFLAGS = $(psoscppflags)
+task4_LDADD = $(psosldadd) -lpthread -lrt -lm
+task4_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task5_SOURCES = task-5.c
+task5_CPPFLAGS = $(psoscppflags)
+task5_LDADD = $(psosldadd) -lpthread -lrt -lm
+task5_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task6_SOURCES = task-6.c
+task6_CPPFLAGS = $(psoscppflags)
+task6_LDADD = $(psosldadd) -lpthread -lrt -lm
+task6_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task7_SOURCES = task-7.c
+task7_CPPFLAGS = $(psoscppflags)
+task7_LDADD = $(psosldadd) -lpthread -lrt -lm
+task7_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task8_SOURCES = task-8.c
+task8_CPPFLAGS = $(psoscppflags)
+task8_LDADD = $(psosldadd) -lpthread -lrt -lm
+task8_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task9_SOURCES = task-9.c
+task9_CPPFLAGS = $(psoscppflags)
+task9_LDADD = $(psosldadd) -lpthread -lrt -lm
+task9_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
diff --git a/lib/psos/testsuite/mq-1.c b/testsuite/psostests/mq-1.c
similarity index 100%
rename from lib/psos/testsuite/mq-1.c
rename to testsuite/psostests/mq-1.c
diff --git a/lib/psos/testsuite/mq-2.c b/testsuite/psostests/mq-2.c
similarity index 100%
rename from lib/psos/testsuite/mq-2.c
rename to testsuite/psostests/mq-2.c
diff --git a/lib/psos/testsuite/mq-3.c b/testsuite/psostests/mq-3.c
similarity index 100%
rename from lib/psos/testsuite/mq-3.c
rename to testsuite/psostests/mq-3.c
diff --git a/lib/psos/testsuite/pt-1.c b/testsuite/psostests/pt-1.c
similarity index 100%
rename from lib/psos/testsuite/pt-1.c
rename to testsuite/psostests/pt-1.c
diff --git a/lib/psos/testsuite/rn-1.c b/testsuite/psostests/rn-1.c
similarity index 100%
rename from lib/psos/testsuite/rn-1.c
rename to testsuite/psostests/rn-1.c
diff --git a/lib/psos/testsuite/sem-1.c b/testsuite/psostests/sem-1.c
similarity index 100%
rename from lib/psos/testsuite/sem-1.c
rename to testsuite/psostests/sem-1.c
diff --git a/lib/psos/testsuite/sem-2.c b/testsuite/psostests/sem-2.c
similarity index 100%
rename from lib/psos/testsuite/sem-2.c
rename to testsuite/psostests/sem-2.c
diff --git a/lib/psos/testsuite/task-1.c b/testsuite/psostests/task-1.c
similarity index 100%
rename from lib/psos/testsuite/task-1.c
rename to testsuite/psostests/task-1.c
diff --git a/lib/psos/testsuite/task-2.c b/testsuite/psostests/task-2.c
similarity index 100%
rename from lib/psos/testsuite/task-2.c
rename to testsuite/psostests/task-2.c
diff --git a/lib/psos/testsuite/task-3.c b/testsuite/psostests/task-3.c
similarity index 100%
rename from lib/psos/testsuite/task-3.c
rename to testsuite/psostests/task-3.c
diff --git a/lib/psos/testsuite/task-4.c b/testsuite/psostests/task-4.c
similarity index 100%
rename from lib/psos/testsuite/task-4.c
rename to testsuite/psostests/task-4.c
diff --git a/lib/psos/testsuite/task-5.c b/testsuite/psostests/task-5.c
similarity index 100%
rename from lib/psos/testsuite/task-5.c
rename to testsuite/psostests/task-5.c
diff --git a/lib/psos/testsuite/task-6.c b/testsuite/psostests/task-6.c
similarity index 100%
rename from lib/psos/testsuite/task-6.c
rename to testsuite/psostests/task-6.c
diff --git a/lib/psos/testsuite/task-7.c b/testsuite/psostests/task-7.c
similarity index 100%
rename from lib/psos/testsuite/task-7.c
rename to testsuite/psostests/task-7.c
diff --git a/lib/psos/testsuite/task-8.c b/testsuite/psostests/task-8.c
similarity index 100%
rename from lib/psos/testsuite/task-8.c
rename to testsuite/psostests/task-8.c
diff --git a/lib/psos/testsuite/task-9.c b/testsuite/psostests/task-9.c
similarity index 100%
rename from lib/psos/testsuite/task-9.c
rename to testsuite/psostests/task-9.c
diff --git a/lib/psos/testsuite/tm-1.c b/testsuite/psostests/tm-1.c
similarity index 100%
rename from lib/psos/testsuite/tm-1.c
rename to testsuite/psostests/tm-1.c
diff --git a/lib/psos/testsuite/tm-2.c b/testsuite/psostests/tm-2.c
similarity index 100%
rename from lib/psos/testsuite/tm-2.c
rename to testsuite/psostests/tm-2.c
diff --git a/lib/psos/testsuite/tm-3.c b/testsuite/psostests/tm-3.c
similarity index 100%
rename from lib/psos/testsuite/tm-3.c
rename to testsuite/psostests/tm-3.c
diff --git a/lib/psos/testsuite/tm-4.c b/testsuite/psostests/tm-4.c
similarity index 100%
rename from lib/psos/testsuite/tm-4.c
rename to testsuite/psostests/tm-4.c
diff --git a/lib/psos/testsuite/tm-5.c b/testsuite/psostests/tm-5.c
similarity index 100%
rename from lib/psos/testsuite/tm-5.c
rename to testsuite/psostests/tm-5.c
diff --git a/lib/psos/testsuite/tm-6.c b/testsuite/psostests/tm-6.c
similarity index 100%
rename from lib/psos/testsuite/tm-6.c
rename to testsuite/psostests/tm-6.c
diff --git a/lib/psos/testsuite/tm-7.c b/testsuite/psostests/tm-7.c
similarity index 100%
rename from lib/psos/testsuite/tm-7.c
rename to testsuite/psostests/tm-7.c
-- 
2.35.3


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

* [PATCH 08/11] testsuite: Add a simple test driver for psostests
  2023-04-06 10:33 ` [PATCH v3 0/11] " Aaron Marcher
                     ` (6 preceding siblings ...)
  2023-04-06 10:33   ` [PATCH 07/11] testsuite: Move pSOS tests into testsuite/ Aaron Marcher
@ 2023-04-06 10:33   ` Aaron Marcher
  2023-04-06 10:33   ` [PATCH 09/11] testsuite: Integrate vwworks tests into testsuite/ Aaron Marcher
                     ` (4 subsequent siblings)
  12 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-04-06 10:33 UTC (permalink / raw)
  To: xenomai; +Cc: richard, florian.bezdeka, jan.kiszka, Aaron Marcher

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


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

* [PATCH 09/11] testsuite: Integrate vwworks tests into testsuite/
  2023-04-06 10:33 ` [PATCH v3 0/11] " Aaron Marcher
                     ` (7 preceding siblings ...)
  2023-04-06 10:33   ` [PATCH 08/11] testsuite: Add a simple test driver for psostests Aaron Marcher
@ 2023-04-06 10:33   ` Aaron Marcher
  2023-04-06 10:33   ` [PATCH 10/11] alchemytests: check pipe-1 asprintf ret value Aaron Marcher
                     ` (3 subsequent siblings)
  12 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-04-06 10:33 UTC (permalink / raw)
  To: xenomai; +Cc: richard, florian.bezdeka, jan.kiszka, Aaron Marcher

From: Richard Weinberger <richard@nod.at>

Same as for alchemy and pSOS.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 configure.ac                                  |   1 +
 lib/vxworks/testsuite/Makefile                |  43 --------
 testsuite/Makefile.am                         |   6 +-
 testsuite/vxworkstests/Makefile.am            | 100 ++++++++++++++++++
 .../vxworkstests}/lst-1.c                     |   0
 .../vxworkstests}/msgQ-1.c                    |   0
 .../vxworkstests}/msgQ-2.c                    |   0
 .../vxworkstests}/msgQ-3.c                    |   0
 .../vxworkstests}/rng-1.c                     |   0
 .../vxworkstests}/sem-1.c                     |   0
 .../vxworkstests}/sem-2.c                     |   0
 .../vxworkstests}/sem-3.c                     |   0
 .../vxworkstests}/sem-4.c                     |   0
 .../vxworkstests}/task-1.c                    |   0
 .../vxworkstests}/task-2.c                    |   0
 testsuite/vxworkstests/vxworkstest_driver.c   |  74 +++++++++++++
 .../vxworkstests}/wd-1.c                      |   0
 17 files changed, 179 insertions(+), 45 deletions(-)
 delete mode 100644 lib/vxworks/testsuite/Makefile
 create mode 100644 testsuite/vxworkstests/Makefile.am
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/lst-1.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/msgQ-1.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/msgQ-2.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/msgQ-3.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/rng-1.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/sem-1.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/sem-2.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/sem-3.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/sem-4.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/task-1.c (100%)
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/task-2.c (100%)
 create mode 100644 testsuite/vxworkstests/vxworkstest_driver.c
 rename {lib/vxworks/testsuite => testsuite/vxworkstests}/wd-1.c (100%)

diff --git a/configure.ac b/configure.ac
index afb9d89151..4d10acc973 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1047,6 +1047,7 @@ AC_CONFIG_FILES([ \
 	testsuite/xeno-test/Makefile \
 	testsuite/alchemytests/Makefile \
 	testsuite/psostests/Makefile \
+	testsuite/vxworkstests/Makefile \
 	utils/Makefile \
 	utils/hdb/Makefile \
 	utils/can/Makefile \
diff --git a/lib/vxworks/testsuite/Makefile b/lib/vxworks/testsuite/Makefile
deleted file mode 100644
index 648c9be90a..0000000000
--- a/lib/vxworks/testsuite/Makefile
+++ /dev/null
@@ -1,43 +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)
-
-ifeq ($(prefix),)
-$(error Please add <xenomai-install-path>/bin to your PATH variable or specify DESTDIR)
-endif
-
-TESTS := task-1 task-2 msgQ-1 msgQ-2 msgQ-3 wd-1 sem-1 sem-2 sem-3 sem-4 lst-1 rng-1
-
-CFLAGS := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --skin=vxworks --cflags) -g
-LDFLAGS := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --skin=vxworks --ldflags)
-CC = $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --cc)
-
-all: $(TESTS)
-
-%: %.c
-	$(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
-
-install: all
-	install -d $(prefix)/testsuite/vxworks
-	install -t $(prefix)/testsuite/vxworks $(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
diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
index 137bfbf31c..c4de671c06 100644
--- a/testsuite/Makefile.am
+++ b/testsuite/Makefile.am
@@ -9,7 +9,8 @@ SUBDIRS += 		\
 	switchtest	\
 	xeno-test	\
 	alchemytests	\
-	psostests
+	psostests	\
+	vxworkstests
 endif
 
 DIST_SUBDIRS =		\
@@ -22,4 +23,5 @@ DIST_SUBDIRS =		\
 	switchtest	\
 	xeno-test	\
 	alchemytests \
-	psostests
+	psostests \
+	vxworkstests
diff --git a/testsuite/vxworkstests/Makefile.am b/testsuite/vxworkstests/Makefile.am
new file mode 100644
index 0000000000..39cdd043b3
--- /dev/null
+++ b/testsuite/vxworkstests/Makefile.am
@@ -0,0 +1,100 @@
+testdir = @XENO_TEST_DIR@
+
+CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
+
+test_PROGRAMS = vxworkstest_driver \
+		lst1	\
+		msgQ1	\
+		msgQ2	\
+		msgQ3	\
+		rng1	\
+		sem1	\
+		sem2	\
+		sem3	\
+		sem4	\
+		wd1	\
+		task1	\
+		task2
+
+vxworkscppflags = 				\
+	$(XENO_USER_CFLAGS)		\
+	-I$(top_srcdir)/include
+
+vxworksldadd = 					\
+	../../lib/vxworks/libvxworks@CORE@.la		\
+	../../lib/copperplate/libcopperplate@CORE@.la	\
+	@XENO_CORE_LDADD@ 			\
+	@XENO_USER_LDADD@			\
+	-lpthread -lrt -lm
+
+lst1_SOURCES = lst-1.c
+lst_CPPFLAGS = $(vxworkscppflags)
+lst1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+lst1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task1_SOURCES = task-1.c
+task1_CPPFLAGS = $(vxworkscppflags)
+task1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+task1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+task2_SOURCES = task-2.c
+task2_CPPFLAGS = $(vxworkscppflags)
+task2_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+task2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+msgQ1_SOURCES = msgQ-1.c
+msgQ1_CPPFLAGS = $(vxworkscppflags)
+msgQ1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+msgQ1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+msgQ2_SOURCES = msgQ-2.c
+msgQ2_CPPFLAGS = $(vxworkscppflags)
+msgQ2_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+msgQ2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+msgQ3_SOURCES = msgQ-3.c
+msgQ3_CPPFLAGS = $(vxworkscppflags)
+msgQ3_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+msgQ3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+rng1_SOURCES = rng-1.c
+rng1_CPPFLAGS = $(vxworkscppflags)
+rng1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+rng1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+sem1_SOURCES = sem-1.c
+sem1_CPPFLAGS = $(vxworkscppflags)
+sem1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+sem1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+sem2_SOURCES = sem-2.c
+sem2_CPPFLAGS = $(vxworkscppflags)
+sem2_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+sem2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+sem3_SOURCES = sem-3.c
+sem3_CPPFLAGS = $(vxworkscppflags)
+sem3_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+sem3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+sem4_SOURCES = sem-4.c
+sem4_CPPFLAGS = $(vxworkscppflags)
+sem4_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+sem4_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+wd1_SOURCES = wd-1.c
+wd1_CPPFLAGS = $(vxworkscppflags)
+wd1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+wd1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+vxworkstest_driver_SOURCES = vxworkstest_driver.c
+vxworkstest_driver_CPPFLAGS =			\
+	$(XENO_USER_CFLAGS)			\
+	-I$(top_srcdir)/include
+vxworkstest_driver_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstest_driver_LDADD =			\
+	../../lib/vxworks/libvxworks@CORE@.la		\
+	../../lib/smokey/libsmokey@CORE@.la	\
+	@XENO_CORE_LDADD@		\
+	@XENO_USER_LDADD@		\
+	-lpthread -lrt
diff --git a/lib/vxworks/testsuite/lst-1.c b/testsuite/vxworkstests/lst-1.c
similarity index 100%
rename from lib/vxworks/testsuite/lst-1.c
rename to testsuite/vxworkstests/lst-1.c
diff --git a/lib/vxworks/testsuite/msgQ-1.c b/testsuite/vxworkstests/msgQ-1.c
similarity index 100%
rename from lib/vxworks/testsuite/msgQ-1.c
rename to testsuite/vxworkstests/msgQ-1.c
diff --git a/lib/vxworks/testsuite/msgQ-2.c b/testsuite/vxworkstests/msgQ-2.c
similarity index 100%
rename from lib/vxworks/testsuite/msgQ-2.c
rename to testsuite/vxworkstests/msgQ-2.c
diff --git a/lib/vxworks/testsuite/msgQ-3.c b/testsuite/vxworkstests/msgQ-3.c
similarity index 100%
rename from lib/vxworks/testsuite/msgQ-3.c
rename to testsuite/vxworkstests/msgQ-3.c
diff --git a/lib/vxworks/testsuite/rng-1.c b/testsuite/vxworkstests/rng-1.c
similarity index 100%
rename from lib/vxworks/testsuite/rng-1.c
rename to testsuite/vxworkstests/rng-1.c
diff --git a/lib/vxworks/testsuite/sem-1.c b/testsuite/vxworkstests/sem-1.c
similarity index 100%
rename from lib/vxworks/testsuite/sem-1.c
rename to testsuite/vxworkstests/sem-1.c
diff --git a/lib/vxworks/testsuite/sem-2.c b/testsuite/vxworkstests/sem-2.c
similarity index 100%
rename from lib/vxworks/testsuite/sem-2.c
rename to testsuite/vxworkstests/sem-2.c
diff --git a/lib/vxworks/testsuite/sem-3.c b/testsuite/vxworkstests/sem-3.c
similarity index 100%
rename from lib/vxworks/testsuite/sem-3.c
rename to testsuite/vxworkstests/sem-3.c
diff --git a/lib/vxworks/testsuite/sem-4.c b/testsuite/vxworkstests/sem-4.c
similarity index 100%
rename from lib/vxworks/testsuite/sem-4.c
rename to testsuite/vxworkstests/sem-4.c
diff --git a/lib/vxworks/testsuite/task-1.c b/testsuite/vxworkstests/task-1.c
similarity index 100%
rename from lib/vxworks/testsuite/task-1.c
rename to testsuite/vxworkstests/task-1.c
diff --git a/lib/vxworks/testsuite/task-2.c b/testsuite/vxworkstests/task-2.c
similarity index 100%
rename from lib/vxworks/testsuite/task-2.c
rename to testsuite/vxworkstests/task-2.c
diff --git a/testsuite/vxworkstests/vxworkstest_driver.c b/testsuite/vxworkstests/vxworkstest_driver.c
new file mode 100644
index 0000000000..a356f7e07a
--- /dev/null
+++ b/testsuite/vxworkstests/vxworkstest_driver.c
@@ -0,0 +1,74 @@
+#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(lst1)
+TEST(msgQ1)
+TEST(msgQ2)
+TEST(msgQ3)
+TEST(rng1)
+TEST(sem1)
+TEST(sem2)
+TEST(sem3)
+TEST(sem4)
+TEST(wd1)
+TEST(task1)
+TEST(task2)
+
+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;
+}
diff --git a/lib/vxworks/testsuite/wd-1.c b/testsuite/vxworkstests/wd-1.c
similarity index 100%
rename from lib/vxworks/testsuite/wd-1.c
rename to testsuite/vxworkstests/wd-1.c
-- 
2.35.3


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

* [PATCH 10/11] alchemytests: check pipe-1 asprintf ret value
  2023-04-06 10:33 ` [PATCH v3 0/11] " Aaron Marcher
                     ` (8 preceding siblings ...)
  2023-04-06 10:33   ` [PATCH 09/11] testsuite: Integrate vwworks tests into testsuite/ Aaron Marcher
@ 2023-04-06 10:33   ` Aaron Marcher
  2023-04-06 10:33   ` [PATCH 11/11] vxworkstests: fix Makefile.am reference Aaron Marcher
                     ` (2 subsequent siblings)
  12 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-04-06 10:33 UTC (permalink / raw)
  To: xenomai; +Cc: richard, florian.bezdeka, jan.kiszka, Aaron Marcher

Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 testsuite/alchemytests/pipe-1.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/testsuite/alchemytests/pipe-1.c b/testsuite/alchemytests/pipe-1.c
index 4202be2bac..da5fbf999f 100644
--- a/testsuite/alchemytests/pipe-1.c
+++ b/testsuite/alchemytests/pipe-1.c
@@ -48,11 +48,13 @@ static void realtime_task(void *arg)
 static void *regular_thread(void *arg)
 {
 	struct pipe_message m;
-	int fd, seq = 0;
+	int fd, res, seq = 0;
 	ssize_t ret;
 	char *rtp;
 
-	asprintf(&rtp, "/dev/rtp%d", minor);
+	res = asprintf(&rtp, "/dev/rtp%d", minor);
+	if (res < 0)
+		return NULL;
 
 	fd = open(rtp, O_RDWR);
 	free(rtp);
-- 
2.35.3


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

* [PATCH 11/11] vxworkstests: fix Makefile.am reference
  2023-04-06 10:33 ` [PATCH v3 0/11] " Aaron Marcher
                     ` (9 preceding siblings ...)
  2023-04-06 10:33   ` [PATCH 10/11] alchemytests: check pipe-1 asprintf ret value Aaron Marcher
@ 2023-04-06 10:33   ` 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-07-20 14:51   ` [PATCH v4 00/10] " Aaron Marcher
  12 siblings, 1 reply; 112+ messages in thread
From: Aaron Marcher @ 2023-04-06 10:33 UTC (permalink / raw)
  To: xenomai; +Cc: richard, florian.bezdeka, jan.kiszka, Aaron Marcher

Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 testsuite/vxworkstests/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testsuite/vxworkstests/Makefile.am b/testsuite/vxworkstests/Makefile.am
index 39cdd043b3..2c7c77e6ea 100644
--- a/testsuite/vxworkstests/Makefile.am
+++ b/testsuite/vxworkstests/Makefile.am
@@ -28,7 +28,7 @@ vxworksldadd = 					\
 	-lpthread -lrt -lm
 
 lst1_SOURCES = lst-1.c
-lst_CPPFLAGS = $(vxworkscppflags)
+lst1_CPPFLAGS = $(vxworkscppflags)
 lst1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
 lst1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
 
-- 
2.35.3


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

* Re: [PATCH v3 0/11] Revive alchemy, pSOS and VxWorks tests
  2023-04-06 10:33 ` [PATCH v3 0/11] " Aaron Marcher
                     ` (10 preceding siblings ...)
  2023-04-06 10:33   ` [PATCH 11/11] vxworkstests: fix Makefile.am reference Aaron Marcher
@ 2023-04-16  7:32   ` Jan Kiszka
  2023-04-16  7:41     ` Jan Kiszka
  2023-05-17  7:30     ` Aaron Marcher
  2023-07-20 14:51   ` [PATCH v4 00/10] " Aaron Marcher
  12 siblings, 2 replies; 112+ messages in thread
From: Jan Kiszka @ 2023-04-16  7:32 UTC (permalink / raw)
  To: Aaron Marcher, xenomai; +Cc: richard, florian.bezdeka

On 06.04.23 12:33, Aaron Marcher wrote:
> This patch series is an attempt to integrate the currently abandoned
> alchemy, pSOS and VxWorks 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.

...but it does hook up with smokey, thus will not run as part of
xeno-test and our CI. Please fix that - after either resolving the
remaining broken tests or disabling them for now. It should be easy to
spawn the new tests as separate processes from a smokey instance and
visualize their results as part of smokey.

Thanks,
Jan

-- 
Siemens AG, Technology
Competence Center Embedded Linux


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

* Re: [PATCH 11/11] vxworkstests: fix Makefile.am reference
  2023-04-06 10:33   ` [PATCH 11/11] vxworkstests: fix Makefile.am reference Aaron Marcher
@ 2023-04-16  7:33     ` Jan Kiszka
  0 siblings, 0 replies; 112+ messages in thread
From: Jan Kiszka @ 2023-04-16  7:33 UTC (permalink / raw)
  To: Aaron Marcher, xenomai; +Cc: richard, florian.bezdeka

On 06.04.23 12:33, Aaron Marcher wrote:
> Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
> ---
>  testsuite/vxworkstests/Makefile.am | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/testsuite/vxworkstests/Makefile.am b/testsuite/vxworkstests/Makefile.am
> index 39cdd043b3..2c7c77e6ea 100644
> --- a/testsuite/vxworkstests/Makefile.am
> +++ b/testsuite/vxworkstests/Makefile.am
> @@ -28,7 +28,7 @@ vxworksldadd = 					\
>  	-lpthread -lrt -lm
>  
>  lst1_SOURCES = lst-1.c
> -lst_CPPFLAGS = $(vxworkscppflags)
> +lst1_CPPFLAGS = $(vxworkscppflags)
>  lst1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
>  lst1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
>  

This should be folded into into patch 9.

Jan

-- 
Siemens AG, Technology
Competence Center Embedded Linux


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

* Re: [PATCH v3 0/11] Revive alchemy, pSOS and VxWorks tests
  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
  1 sibling, 1 reply; 112+ messages in thread
From: Jan Kiszka @ 2023-04-16  7:41 UTC (permalink / raw)
  To: Aaron Marcher, xenomai; +Cc: richard, florian.bezdeka

On 16.04.23 09:32, Jan Kiszka wrote:
> On 06.04.23 12:33, Aaron Marcher wrote:
>> This patch series is an attempt to integrate the currently abandoned
>> alchemy, pSOS and VxWorks 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.
> 
> ...but it does hook up with smokey, thus will not run as part of
> xeno-test and our CI. Please fix that - after either resolving the
> remaining broken tests or disabling them for now. It should be easy to
> spawn the new tests as separate processes from a smokey instance and
> visualize their results as part of smokey.
> 

BTW, mutex1 from alchemytest fails for me, all other alchemy tests are fine.

------------------------------------------------------------------------------
[ ERROR BACKTRACE: thread taskB ]

   #0  EEXIST in rt_mutex_create(), ../../../lib/alchemy/mutex.c:148
   #1  EEXIST in registry_add_file(),
../../../lib/copperplate/registry.c:239
=> #2  ESRCH in pvhash_remove(), ../../../lib/boilerplate/hash.c:436
------------------------------------------------------------------------------

I can confirm that task8 of the psos suite does not complete. And the
vxworks suite succeeds here completely.

Jan

-- 
Siemens AG, Technology
Competence Center Embedded Linux


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

* Re: [PATCH v3 0/11] Revive alchemy, pSOS and VxWorks tests
  2023-04-16  7:41     ` Jan Kiszka
@ 2023-04-16  9:03       ` Richard Weinberger
  0 siblings, 0 replies; 112+ messages in thread
From: Richard Weinberger @ 2023-04-16  9:03 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: aaron, xenomai, Florian Bezdeka

----- Ursprüngliche Mail -----
> Von: "Jan Kiszka" <jan.kiszka@siemens.com>
>> ...but it does hook up with smokey, thus will not run as part of
>> xeno-test and our CI. Please fix that - after either resolving the
>> remaining broken tests or disabling them for now. It should be easy to
>> spawn the new tests as separate processes from a smokey instance and
>> visualize their results as part of smokey.
>> 
> 
> BTW, mutex1 from alchemytest fails for me, all other alchemy tests are fine.

Not sure whether this is related, but on Thursday I ran into a bug in rt_mutex_create(),
it returns also positive error numbers.
This seems to be the fix:

diff --git a/lib/alchemy/mutex.c b/lib/alchemy/mutex.c
index f8933858647a..5836af59f05e 100644
--- a/lib/alchemy/mutex.c
+++ b/lib/alchemy/mutex.c
@@ -133,7 +133,7 @@ int rt_mutex_create(RT_MUTEX *mutex, const char *name)
 	pthread_mutexattr_settype(&mattr, PTHREAD_MUTEX_RECURSIVE);
 	/* pthread_mutexattr_setrobust() might not be implemented. */
 	pthread_mutexattr_setrobust(&mattr, PTHREAD_MUTEX_ROBUST_NP);
-	ret = __RT(pthread_mutex_init(&mcb->lock, &mattr));
+	ret = -__RT(pthread_mutex_init(&mcb->lock, &mattr));
 	if (ret) {
 		xnfree(mcb);
 		goto out;

Thanks,
//richard

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

* Re: [PATCH v3 0/11] Revive alchemy, pSOS and VxWorks tests
  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-05-17  7:30     ` Aaron Marcher
  2023-05-17  9:35       ` Jan Kiszka
  1 sibling, 1 reply; 112+ messages in thread
From: Aaron Marcher @ 2023-05-17  7:30 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: xenomai, richard

Hi Jan,

I tried integrating the tests into the smokey framework like other ones
in the repository. However, the linked tests never show up when listing
using `smokey -l`.

I made sure to place them in the `testsuite/smokey` directory, correctly
link them into the testsuite like the other tests and call
`smokey_test_plugin()` along with a run function spawning the tests.

Do you have any hints for me what to watch out for when integrating the
tests so that they correctly show up?

Thanks,
Aaron

-- 
sigma star gmbh | Eduard-Bodem-Gasse 6, 6020 Innsbruck, AUT
UID/VAT Nr: ATU 66964118 | FN: 374287y

On Sun, Apr 16, 2023 at 09:32:49AM +0200, Jan Kiszka wrote:
> On 06.04.23 12:33, Aaron Marcher wrote:
> > This patch series is an attempt to integrate the currently abandoned
> > alchemy, pSOS and VxWorks 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.
> 
> ...but it does hook up with smokey, thus will not run as part of
> xeno-test and our CI. Please fix that - after either resolving the
> remaining broken tests or disabling them for now. It should be easy to
> spawn the new tests as separate processes from a smokey instance and
> visualize their results as part of smokey.
> 
> Thanks,
> Jan
> 
> -- 
> Siemens AG, Technology
> Competence Center Embedded Linux

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

* Re: [PATCH v3 0/11] Revive alchemy, pSOS and VxWorks tests
  2023-05-17  7:30     ` Aaron Marcher
@ 2023-05-17  9:35       ` Jan Kiszka
  2023-05-20 14:57         ` Florian Bezdeka
  0 siblings, 1 reply; 112+ messages in thread
From: Jan Kiszka @ 2023-05-17  9:35 UTC (permalink / raw)
  To: Aaron Marcher, xenomai, richard

On 17.05.23 09:30, Aaron Marcher wrote:
> Hi Jan,
> 
> I tried integrating the tests into the smokey framework like other ones
> in the repository. However, the linked tests never show up when listing
> using `smokey -l`.
> 
> I made sure to place them in the `testsuite/smokey` directory, correctly
> link them into the testsuite like the other tests and call
> `smokey_test_plugin()` along with a run function spawning the tests.
> 
> Do you have any hints for me what to watch out for when integrating the
> tests so that they correctly show up?
> 

Hard to say without seeing the changes. When looking for past patterns,
check e.g.
https://source.denx.de/Xenomai/xenomai/-/commit/78e4d58be37f8a498a03993f74251af57f11c1b7

Jan

-- 
Siemens AG, Technology
Competence Center Embedded Linux


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

* Re: [PATCH v3 0/11] Revive alchemy, pSOS and VxWorks tests
  2023-05-17  9:35       ` Jan Kiszka
@ 2023-05-20 14:57         ` Florian Bezdeka
  0 siblings, 0 replies; 112+ messages in thread
From: Florian Bezdeka @ 2023-05-20 14:57 UTC (permalink / raw)
  To: Jan Kiszka, Aaron Marcher, xenomai, richard

Hi Aaron,

On Wed, 2023-05-17 at 11:35 +0200, Jan Kiszka wrote:
> On 17.05.23 09:30, Aaron Marcher wrote:
> > Hi Jan,
> > 
> > I tried integrating the tests into the smokey framework like other ones
> > in the repository. However, the linked tests never show up when listing
> > using `smokey -l`.
> > 
> > I made sure to place them in the `testsuite/smokey` directory, correctly
> > link them into the testsuite like the other tests and call
> > `smokey_test_plugin()` along with a run function spawning the tests.
> > 
> > Do you have any hints for me what to watch out for when integrating the
> > tests so that they correctly show up?
> > 
> 
> Hard to say without seeing the changes. When looking for past patterns,
> check e.g.
> https://source.denx.de/Xenomai/xenomai/-/commit/78e4d58be37f8a498a03993f74251af57f11c1b7

My best guess would be that the Makefile is missing in AC_CONFIG_FILES
(2nd hunk within the referenced changes) or that
testsuite/smoke/Makefile.am was not updated to include your new test
directory.

If futher help is needed it might be a good idea to post a patch tagged
as RFC.

Florian

> 
> Jan
> 


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

* [PATCH v4 00/10] Revive alchemy, pSOS and VxWorks tests
  2023-04-06 10:33 ` [PATCH v3 0/11] " Aaron Marcher
                     ` (11 preceding siblings ...)
  2023-04-16  7:32   ` [PATCH v3 0/11] Revive alchemy, pSOS and VxWorks tests Jan Kiszka
@ 2023-07-20 14:51   ` Aaron Marcher
  2023-07-20 14:51     ` [PATCH 01/10] testsuite: Fully integrate alchemytests into smokey Aaron Marcher
                       ` (11 more replies)
  12 siblings, 12 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-07-20 14:51 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

This patch series fully integrates the currently abandoned alchemy, pSOS
and VxWorks tests into Xenomai's testsuite.
For each test, a Smokey testcase is hooked up.

Aaron Marcher (7):
  testsuite: Fully integrate alchemytests into smokey
  testsuite: Fully integrate psostests into smokey
  testsuite: Fully integrate vwworkstests into smokey
  alchemytests: Check pipe-1 asprintf ret value
  alchemytests: Fix task-2
  alchemytests: Fix task-5 logic
  testsuite: disable broken tests

Richard Weinberger (3):
  testsuite: Remove old alchemytests Makefile
  alchemytests: Fix gcc warning in buffer-1
  alchemytests: Fix gcc warning in task-9

 configure.ac                                  |   7 +-
 lib/alchemy/testsuite/Makefile                |  70 ---------
 lib/psos/testsuite/Makefile                   |  49 ------
 lib/vxworks/testsuite/Makefile                |  43 -----
 testsuite/smokey/Makefile.am                  |  15 +-
 testsuite/smokey/alchemytests/Makefile.am     | 148 ++++++++++++++++++
 .../smokey/alchemytests}/alarm-1.c            |   0
 testsuite/smokey/alchemytests/alchemytests.c  |  55 +++++++
 .../smokey/alchemytests/alchemytests_driver.c |  32 ++++
 .../smokey/alchemytests}/buffer-1.c           |   2 +-
 .../smokey/alchemytests}/event-1.c            |   0
 .../smokey/alchemytests}/heap-1.c             |   0
 .../smokey/alchemytests}/heap-2.c             |   0
 .../smokey/alchemytests}/mq-1.c               |   0
 .../smokey/alchemytests}/mq-2.c               |   0
 .../smokey/alchemytests}/mq-3.c               |   0
 .../smokey/alchemytests}/mutex-1.c            |   0
 .../smokey/alchemytests}/pipe-1.c             |   6 +-
 .../smokey/alchemytests}/sem-1.c              |   0
 .../smokey/alchemytests}/sem-2.c              |   0
 .../smokey/alchemytests}/task-1.c             |   0
 .../smokey/alchemytests}/task-10.c            |   0
 .../smokey/alchemytests}/task-2.c             |   4 +-
 .../smokey/alchemytests}/task-3.c             |   0
 .../smokey/alchemytests}/task-4.c             |   0
 .../smokey/alchemytests}/task-5.c             |  10 +-
 .../smokey/alchemytests}/task-6.c             |   0
 .../smokey/alchemytests}/task-7.c             |   0
 .../smokey/alchemytests}/task-8.c             |   0
 .../smokey/alchemytests}/task-9.c             |   2 +-
 testsuite/smokey/psostests/Makefile.am        | 148 ++++++++++++++++++
 .../smokey/psostests}/mq-1.c                  |   0
 .../smokey/psostests}/mq-2.c                  |   0
 .../smokey/psostests}/mq-3.c                  |   0
 testsuite/smokey/psostests/psostests.c        |  68 ++++++++
 testsuite/smokey/psostests/psostests_driver.c |  33 ++++
 .../smokey/psostests}/pt-1.c                  |   0
 .../smokey/psostests}/rn-1.c                  |   0
 .../smokey/psostests}/sem-1.c                 |   0
 .../smokey/psostests}/sem-2.c                 |   0
 .../smokey/psostests}/task-1.c                |   0
 .../smokey/psostests}/task-2.c                |   0
 .../smokey/psostests}/task-3.c                |   0
 .../smokey/psostests}/task-4.c                |   0
 .../smokey/psostests}/task-5.c                |   0
 .../smokey/psostests}/task-6.c                |   0
 .../smokey/psostests}/task-7.c                |   0
 .../smokey/psostests}/task-8.c                |   0
 .../smokey/psostests}/task-9.c                |   0
 .../smokey/psostests}/tm-1.c                  |   0
 .../smokey/psostests}/tm-2.c                  |   0
 .../smokey/psostests}/tm-3.c                  |   0
 .../smokey/psostests}/tm-4.c                  |   0
 .../smokey/psostests}/tm-5.c                  |   0
 .../smokey/psostests}/tm-6.c                  |   0
 .../smokey/psostests}/tm-7.c                  |   0
 testsuite/smokey/vxworkstests/Makefile.am     |  94 +++++++++++
 .../smokey/vxworkstests}/lst-1.c              |   0
 .../smokey/vxworkstests}/msgQ-1.c             |   0
 .../smokey/vxworkstests}/msgQ-2.c             |   0
 .../smokey/vxworkstests}/msgQ-3.c             |   0
 .../smokey/vxworkstests}/rng-1.c              |   0
 .../smokey/vxworkstests}/sem-1.c              |   0
 .../smokey/vxworkstests}/sem-2.c              |   0
 .../smokey/vxworkstests}/sem-3.c              |   0
 .../smokey/vxworkstests}/sem-4.c              |   0
 .../smokey/vxworkstests}/task-1.c             |   0
 .../smokey/vxworkstests}/task-2.c             |   0
 testsuite/smokey/vxworkstests/vxworkstests.c  |  45 ++++++
 .../smokey/vxworkstests/vxworkstests_driver.c |  32 ++++
 .../smokey/vxworkstests}/wd-1.c               |   0
 71 files changed, 686 insertions(+), 177 deletions(-)
 delete mode 100644 lib/alchemy/testsuite/Makefile
 delete mode 100644 lib/psos/testsuite/Makefile
 delete mode 100644 lib/vxworks/testsuite/Makefile
 create mode 100644 testsuite/smokey/alchemytests/Makefile.am
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/alarm-1.c (100%)
 create mode 100644 testsuite/smokey/alchemytests/alchemytests.c
 create mode 100644 testsuite/smokey/alchemytests/alchemytests_driver.c
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/buffer-1.c (99%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/event-1.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/heap-1.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/heap-2.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-1.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-2.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-3.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mutex-1.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/pipe-1.c (97%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/sem-1.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/sem-2.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-1.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-10.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-2.c (97%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-3.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-4.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-5.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-6.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-7.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-8.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-9.c (97%)
 create mode 100644 testsuite/smokey/psostests/Makefile.am
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/mq-1.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/mq-2.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/mq-3.c (100%)
 create mode 100644 testsuite/smokey/psostests/psostests.c
 create mode 100644 testsuite/smokey/psostests/psostests_driver.c
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/pt-1.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/rn-1.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/sem-1.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/sem-2.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-1.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-2.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-3.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-4.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-5.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-6.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-7.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-8.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-9.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-1.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-2.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-3.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-4.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-5.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-6.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-7.c (100%)
 create mode 100644 testsuite/smokey/vxworkstests/Makefile.am
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/lst-1.c (100%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-1.c (100%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-2.c (100%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-3.c (100%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/rng-1.c (100%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-1.c (100%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-2.c (100%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-3.c (100%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-4.c (100%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/task-1.c (100%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/task-2.c (100%)
 create mode 100644 testsuite/smokey/vxworkstests/vxworkstests.c
 create mode 100644 testsuite/smokey/vxworkstests/vxworkstests_driver.c
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/wd-1.c (100%)

-- 
2.35.3


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

* [PATCH 01/10] testsuite: Fully integrate alchemytests into smokey
  2023-07-20 14:51   ` [PATCH v4 00/10] " Aaron Marcher
@ 2023-07-20 14:51     ` Aaron Marcher
  2023-07-20 16:50       ` Jan Kiszka
  2023-07-20 14:51     ` [PATCH 02/10] testsuite: Fully integrate psostests " Aaron Marcher
                       ` (10 subsequent siblings)
  11 siblings, 1 reply; 112+ messages in thread
From: Aaron Marcher @ 2023-07-20 14:51 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

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

Build them using Xenomai's build system and hook them up using
Smokey. Every test binary has it's own respective testcase in the
testsuite.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 configure.ac                                  |   7 +-
 testsuite/Makefile.am                         |   8 +-
 testsuite/smokey/Makefile.am                  |   9 +-
 testsuite/smokey/alchemytests/Makefile.am     | 148 ++++++++++++++++++
 .../smokey/alchemytests}/alarm-1.c            |   0
 testsuite/smokey/alchemytests/alchemytests.c  |  55 +++++++
 .../smokey/alchemytests/alchemytests_driver.c |  32 ++++
 .../smokey/alchemytests}/buffer-1.c           |   0
 .../smokey/alchemytests}/event-1.c            |   0
 .../smokey/alchemytests}/heap-1.c             |   0
 .../smokey/alchemytests}/heap-2.c             |   0
 .../smokey/alchemytests}/mq-1.c               |   0
 .../smokey/alchemytests}/mq-2.c               |   0
 .../smokey/alchemytests}/mq-3.c               |   0
 .../smokey/alchemytests}/mutex-1.c            |   0
 .../smokey/alchemytests}/pipe-1.c             |   0
 .../smokey/alchemytests}/sem-1.c              |   0
 .../smokey/alchemytests}/sem-2.c              |   0
 .../smokey/alchemytests}/task-1.c             |   0
 .../smokey/alchemytests}/task-10.c            |   0
 .../smokey/alchemytests}/task-2.c             |   0
 .../smokey/alchemytests}/task-3.c             |   0
 .../smokey/alchemytests}/task-4.c             |   0
 .../smokey/alchemytests}/task-5.c             |   0
 .../smokey/alchemytests}/task-6.c             |   0
 .../smokey/alchemytests}/task-7.c             |   0
 .../smokey/alchemytests}/task-8.c             |   0
 .../smokey/alchemytests}/task-9.c             |   0
 28 files changed, 252 insertions(+), 7 deletions(-)
 create mode 100644 testsuite/smokey/alchemytests/Makefile.am
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/alarm-1.c (100%)
 create mode 100644 testsuite/smokey/alchemytests/alchemytests.c
 create mode 100644 testsuite/smokey/alchemytests/alchemytests_driver.c
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/buffer-1.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/event-1.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/heap-1.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/heap-2.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-1.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-2.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-3.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mutex-1.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/pipe-1.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/sem-1.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/sem-2.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-1.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-10.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-2.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-3.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-4.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-5.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-6.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-7.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-8.c (100%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-9.c (100%)

diff --git a/configure.ac b/configure.ac
index 3ce34048e..fe59333ed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1041,10 +1041,13 @@ AC_CONFIG_FILES([ \
 	testsuite/smokey/cpu-affinity/Makefile \
 	testsuite/smokey/gdb/Makefile \
 	testsuite/smokey/y2038/Makefile \
-	testsuite/smokey/can/Makefile
-	testsuite/smokey/x86io/Makefile
+	testsuite/smokey/can/Makefile \
+	testsuite/smokey/x86io/Makefile \
+	testsuite/smokey/alchemytests/Makefile \
 	testsuite/clocktest/Makefile \
 	testsuite/xeno-test/Makefile \
+	testsuite/psostests/Makefile \
+	testsuite/vxworkstests/Makefile \
 	utils/Makefile \
 	utils/hdb/Makefile \
 	utils/can/Makefile \
diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
index 4932f6d33..1be7eaba4 100644
--- a/testsuite/Makefile.am
+++ b/testsuite/Makefile.am
@@ -7,7 +7,9 @@ SUBDIRS += 		\
 	gpiotest	\
 	spitest		\
 	switchtest	\
-	xeno-test
+	xeno-test	\
+	psostests	\
+	vxworkstests
 endif
 
 DIST_SUBDIRS =		\
@@ -18,4 +20,6 @@ DIST_SUBDIRS =		\
 	smokey		\
 	spitest		\
 	switchtest	\
-	xeno-test
+	xeno-test	\
+	psostests \
+	vxworkstests
diff --git a/testsuite/smokey/Makefile.am b/testsuite/smokey/Makefile.am
index 79dc61e9f..633a87387 100644
--- a/testsuite/smokey/Makefile.am
+++ b/testsuite/smokey/Makefile.am
@@ -40,12 +40,14 @@ COBALT_SUBDIRS = 	\
 	tsc		\
 	vdso-access 	\
 	xddp		\
-	y2038
+	y2038 \
+	alchemytests
 
 MERCURY_SUBDIRS =	\
 	memory-heapmem	\
 	memory-tlsf	\
-	memcheck
+	memcheck \
+	alchemytests
 
 DIST_SUBDIRS = 		\
 	arith 		\
@@ -80,7 +82,8 @@ DIST_SUBDIRS = 		\
 	tsc		\
 	vdso-access 	\
 	xddp		\
-	y2038
+	y2038 \
+	alchemytests
 
 if XENO_X86
 DIST_SUBDIRS += x86io
diff --git a/testsuite/smokey/alchemytests/Makefile.am b/testsuite/smokey/alchemytests/Makefile.am
new file mode 100644
index 000000000..9da3a98f3
--- /dev/null
+++ b/testsuite/smokey/alchemytests/Makefile.am
@@ -0,0 +1,148 @@
+testdir = @XENO_TEST_DIR@
+noinst_LIBRARIES = libalchemytests.a
+
+libalchemytests_a_SOURCES = alchemytests.c
+libalchemytests_a_CPPFLAGS = 		\
+	@XENO_USER_CFLAGS@	\
+	-I$(top_srcdir)		\
+	-I$(top_srcdir)/include \
+	-DXENO_TEST_DIR='"$(XENO_TEST_DIR)"'
+
+CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
+
+test_PROGRAMS = \
+		alchemytests \
+		alchemytests_alarm1		   \
+		alchemytests_buffer1		   \
+		alchemytests_event1		   \
+		alchemytests_heap1		   \
+		alchemytests_heap2		   \
+		alchemytests_mq1		   \
+		alchemytests_mq2		   \
+		alchemytests_mq3		   \
+		alchemytests_mutex1		   \
+		alchemytests_pipe1		   \
+		alchemytests_sem1		   \
+		alchemytests_sem2		   \
+		alchemytests_task1		   \
+		alchemytests_task2		   \
+		alchemytests_task3		   \
+		alchemytests_task4		   \
+		alchemytests_task5		   \
+		alchemytests_task6		   \
+		alchemytests_task7		   \
+		alchemytests_task8		   \
+		alchemytests_task9		   \
+		alchemytests_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
+
+alchemytests_SOURCES = alchemytests_driver.c
+alchemytests_CPPFLAGS =			\
+	$(XENO_USER_CFLAGS)			\
+	-I$(top_srcdir)/include
+alchemytests_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_LDADD =			\
+	../../../lib/smokey/libsmokey@CORE@.la	\
+	@XENO_CORE_LDADD@		\
+	@XENO_USER_LDADD@		\
+	-lpthread -lrt
+
+alchemytests_alarm1_SOURCES = alarm-1.c
+alchemytests_alarm1_CPPFLAGS = $(alchemycppflags)
+alchemytests_alarm1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_alarm1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_event1_SOURCES = event-1.c
+alchemytests_event1_CPPFLAGS = $(alchemycppflags)
+alchemytests_event1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_event1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_heap1_SOURCES = heap-1.c
+alchemytests_heap1_CPPFLAGS = $(alchemycppflags)
+alchemytests_heap1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_heap1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_heap2_SOURCES = heap-2.c
+alchemytests_heap2_CPPFLAGS = $(alchemycppflags)
+alchemytests_heap2_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_heap2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_buffer1_SOURCES = buffer-1.c
+alchemytests_buffer1_CPPFLAGS = $(alchemycppflags)
+alchemytests_buffer1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_buffer1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_mutex1_SOURCES = mutex-1.c
+alchemytests_mutex1_CPPFLAGS = $(alchemycppflags)
+alchemytests_mutex1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_mutex1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_pipe1_SOURCES = pipe-1.c
+alchemytests_pipe1_CPPFLAGS = $(alchemycppflags)
+alchemytests_pipe1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_pipe1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_mq1_SOURCES = mq-1.c
+alchemytests_mq1_CPPFLAGS = $(alchemycppflags)
+alchemytests_mq1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_mq1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_mq2_SOURCES = mq-2.c
+alchemytests_mq2_CPPFLAGS = $(alchemycppflags)
+alchemytests_mq2_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_mq2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_mq3_SOURCES = mq-3.c
+alchemytests_mq3_CPPFLAGS = $(alchemycppflags)
+alchemytests_mq3_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_mq3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_sem1_SOURCES = sem-1.c
+alchemytests_sem1_CPPFLAGS = $(alchemycppflags)
+alchemytests_sem1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_sem1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_sem2_SOURCES = sem-2.c
+alchemytests_sem2_CPPFLAGS = $(alchemycppflags)
+alchemytests_sem2_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_sem2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task1_SOURCES = task-1.c
+alchemytests_task1_CPPFLAGS = $(alchemycppflags)
+alchemytests_task1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_task1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task2_SOURCES = task-2.c
+alchemytests_task2_CPPFLAGS = $(alchemycppflags)
+alchemytests_task2_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_task2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task3_SOURCES = task-3.c
+alchemytests_task3_CPPFLAGS = $(alchemycppflags)
+alchemytests_task3_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_task3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task4_SOURCES = task-4.c
+alchemytests_task4_CPPFLAGS = $(alchemycppflags)
+alchemytests_task4_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_task4_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task5_SOURCES = task-5.c
+alchemytests_task5_CPPFLAGS = $(alchemycppflags)
+alchemytests_task5_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_task5_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task6_SOURCES = task-6.c
+alchemytests_task6_CPPFLAGS = $(alchemycppflags)
+alchemytests_task6_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_task6_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task7_SOURCES = task-7.c
+alchemytests_task7_CPPFLAGS = $(alchemycppflags)
+alchemytests_task7_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_task7_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task8_SOURCES = task-8.c
+alchemytests_task8_CPPFLAGS = $(alchemycppflags)
+alchemytests_task8_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_task8_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task9_SOURCES = task-9.c
+alchemytests_task9_CPPFLAGS = $(alchemycppflags)
+alchemytests_task9_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_task9_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task10_SOURCES = task-10.c
+alchemytests_task10_CPPFLAGS = $(alchemycppflags)
+alchemytests_task10_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_task10_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
diff --git a/lib/alchemy/testsuite/alarm-1.c b/testsuite/smokey/alchemytests/alarm-1.c
similarity index 100%
rename from lib/alchemy/testsuite/alarm-1.c
rename to testsuite/smokey/alchemytests/alarm-1.c
diff --git a/testsuite/smokey/alchemytests/alchemytests.c b/testsuite/smokey/alchemytests/alchemytests.c
new file mode 100644
index 000000000..8dea068bc
--- /dev/null
+++ b/testsuite/smokey/alchemytests/alchemytests.c
@@ -0,0 +1,55 @@
+#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>
+
+#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", XENO_TEST_DIR, t->name);
+	if (ret == -1)
+		return -ENOMEM;
+
+	ret = system(tst_path);
+	free(tst_path);
+
+	return ret;
+}
+
+TEST(alchemytests)
+TEST(alchemytests_alarm1)
+TEST(alchemytests_buffer1)
+TEST(alchemytests_event1)
+TEST(alchemytests_heap1)
+TEST(alchemytests_heap2)
+TEST(alchemytests_mq1)
+TEST(alchemytests_mq2)
+TEST(alchemytests_mq3)
+TEST(alchemytests_mutex1)
+TEST(alchemytests_pipe1)
+TEST(alchemytests_sem1)
+TEST(alchemytests_sem2)
+TEST(alchemytests_task1)
+TEST(alchemytests_task2)
+TEST(alchemytests_task3)
+TEST(alchemytests_task4)
+TEST(alchemytests_task5)
+TEST(alchemytests_task6)
+TEST(alchemytests_task7)
+TEST(alchemytests_task8)
+TEST(alchemytests_task9)
+TEST(alchemytests_task10)
+
diff --git a/testsuite/smokey/alchemytests/alchemytests_driver.c b/testsuite/smokey/alchemytests/alchemytests_driver.c
new file mode 100644
index 000000000..cf9045bb5
--- /dev/null
+++ b/testsuite/smokey/alchemytests/alchemytests_driver.c
@@ -0,0 +1,32 @@
+#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>
+
+int main(int argc, char *const argv[])
+{
+	struct smokey_test *t;
+	int ret, fails = 0;
+
+	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;
+}
diff --git a/lib/alchemy/testsuite/buffer-1.c b/testsuite/smokey/alchemytests/buffer-1.c
similarity index 100%
rename from lib/alchemy/testsuite/buffer-1.c
rename to testsuite/smokey/alchemytests/buffer-1.c
diff --git a/lib/alchemy/testsuite/event-1.c b/testsuite/smokey/alchemytests/event-1.c
similarity index 100%
rename from lib/alchemy/testsuite/event-1.c
rename to testsuite/smokey/alchemytests/event-1.c
diff --git a/lib/alchemy/testsuite/heap-1.c b/testsuite/smokey/alchemytests/heap-1.c
similarity index 100%
rename from lib/alchemy/testsuite/heap-1.c
rename to testsuite/smokey/alchemytests/heap-1.c
diff --git a/lib/alchemy/testsuite/heap-2.c b/testsuite/smokey/alchemytests/heap-2.c
similarity index 100%
rename from lib/alchemy/testsuite/heap-2.c
rename to testsuite/smokey/alchemytests/heap-2.c
diff --git a/lib/alchemy/testsuite/mq-1.c b/testsuite/smokey/alchemytests/mq-1.c
similarity index 100%
rename from lib/alchemy/testsuite/mq-1.c
rename to testsuite/smokey/alchemytests/mq-1.c
diff --git a/lib/alchemy/testsuite/mq-2.c b/testsuite/smokey/alchemytests/mq-2.c
similarity index 100%
rename from lib/alchemy/testsuite/mq-2.c
rename to testsuite/smokey/alchemytests/mq-2.c
diff --git a/lib/alchemy/testsuite/mq-3.c b/testsuite/smokey/alchemytests/mq-3.c
similarity index 100%
rename from lib/alchemy/testsuite/mq-3.c
rename to testsuite/smokey/alchemytests/mq-3.c
diff --git a/lib/alchemy/testsuite/mutex-1.c b/testsuite/smokey/alchemytests/mutex-1.c
similarity index 100%
rename from lib/alchemy/testsuite/mutex-1.c
rename to testsuite/smokey/alchemytests/mutex-1.c
diff --git a/lib/alchemy/testsuite/pipe-1.c b/testsuite/smokey/alchemytests/pipe-1.c
similarity index 100%
rename from lib/alchemy/testsuite/pipe-1.c
rename to testsuite/smokey/alchemytests/pipe-1.c
diff --git a/lib/alchemy/testsuite/sem-1.c b/testsuite/smokey/alchemytests/sem-1.c
similarity index 100%
rename from lib/alchemy/testsuite/sem-1.c
rename to testsuite/smokey/alchemytests/sem-1.c
diff --git a/lib/alchemy/testsuite/sem-2.c b/testsuite/smokey/alchemytests/sem-2.c
similarity index 100%
rename from lib/alchemy/testsuite/sem-2.c
rename to testsuite/smokey/alchemytests/sem-2.c
diff --git a/lib/alchemy/testsuite/task-1.c b/testsuite/smokey/alchemytests/task-1.c
similarity index 100%
rename from lib/alchemy/testsuite/task-1.c
rename to testsuite/smokey/alchemytests/task-1.c
diff --git a/lib/alchemy/testsuite/task-10.c b/testsuite/smokey/alchemytests/task-10.c
similarity index 100%
rename from lib/alchemy/testsuite/task-10.c
rename to testsuite/smokey/alchemytests/task-10.c
diff --git a/lib/alchemy/testsuite/task-2.c b/testsuite/smokey/alchemytests/task-2.c
similarity index 100%
rename from lib/alchemy/testsuite/task-2.c
rename to testsuite/smokey/alchemytests/task-2.c
diff --git a/lib/alchemy/testsuite/task-3.c b/testsuite/smokey/alchemytests/task-3.c
similarity index 100%
rename from lib/alchemy/testsuite/task-3.c
rename to testsuite/smokey/alchemytests/task-3.c
diff --git a/lib/alchemy/testsuite/task-4.c b/testsuite/smokey/alchemytests/task-4.c
similarity index 100%
rename from lib/alchemy/testsuite/task-4.c
rename to testsuite/smokey/alchemytests/task-4.c
diff --git a/lib/alchemy/testsuite/task-5.c b/testsuite/smokey/alchemytests/task-5.c
similarity index 100%
rename from lib/alchemy/testsuite/task-5.c
rename to testsuite/smokey/alchemytests/task-5.c
diff --git a/lib/alchemy/testsuite/task-6.c b/testsuite/smokey/alchemytests/task-6.c
similarity index 100%
rename from lib/alchemy/testsuite/task-6.c
rename to testsuite/smokey/alchemytests/task-6.c
diff --git a/lib/alchemy/testsuite/task-7.c b/testsuite/smokey/alchemytests/task-7.c
similarity index 100%
rename from lib/alchemy/testsuite/task-7.c
rename to testsuite/smokey/alchemytests/task-7.c
diff --git a/lib/alchemy/testsuite/task-8.c b/testsuite/smokey/alchemytests/task-8.c
similarity index 100%
rename from lib/alchemy/testsuite/task-8.c
rename to testsuite/smokey/alchemytests/task-8.c
diff --git a/lib/alchemy/testsuite/task-9.c b/testsuite/smokey/alchemytests/task-9.c
similarity index 100%
rename from lib/alchemy/testsuite/task-9.c
rename to testsuite/smokey/alchemytests/task-9.c
-- 
2.35.3


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

* [PATCH 02/10] testsuite: Fully integrate psostests into smokey
  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 14:51     ` Aaron Marcher
  2023-07-20 14:51     ` [PATCH 03/10] testsuite: Fully integrate vwworkstests " Aaron Marcher
                       ` (9 subsequent siblings)
  11 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-07-20 14:51 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

Just like for alchemytests, integrate them into our testsuite.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 configure.ac                                  |   2 +-
 lib/psos/testsuite/Makefile                   |  49 ------
 testsuite/Makefile.am                         |   2 -
 testsuite/smokey/Makefile.am                  |   9 +-
 testsuite/smokey/psostests/Makefile.am        | 148 ++++++++++++++++++
 .../smokey/psostests}/mq-1.c                  |   0
 .../smokey/psostests}/mq-2.c                  |   0
 .../smokey/psostests}/mq-3.c                  |   0
 testsuite/smokey/psostests/psostests.c        |  56 +++++++
 testsuite/smokey/psostests/psostests_driver.c |  33 ++++
 .../smokey/psostests}/pt-1.c                  |   0
 .../smokey/psostests}/rn-1.c                  |   0
 .../smokey/psostests}/sem-1.c                 |   0
 .../smokey/psostests}/sem-2.c                 |   0
 .../smokey/psostests}/task-1.c                |   0
 .../smokey/psostests}/task-2.c                |   0
 .../smokey/psostests}/task-3.c                |   0
 .../smokey/psostests}/task-4.c                |   0
 .../smokey/psostests}/task-5.c                |   0
 .../smokey/psostests}/task-6.c                |   0
 .../smokey/psostests}/task-7.c                |   0
 .../smokey/psostests}/task-8.c                |   0
 .../smokey/psostests}/task-9.c                |   0
 .../smokey/psostests}/tm-1.c                  |   0
 .../smokey/psostests}/tm-2.c                  |   0
 .../smokey/psostests}/tm-3.c                  |   0
 .../smokey/psostests}/tm-4.c                  |   0
 .../smokey/psostests}/tm-5.c                  |   0
 .../smokey/psostests}/tm-6.c                  |   0
 .../smokey/psostests}/tm-7.c                  |   0
 30 files changed, 244 insertions(+), 55 deletions(-)
 delete mode 100644 lib/psos/testsuite/Makefile
 create mode 100644 testsuite/smokey/psostests/Makefile.am
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/mq-1.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/mq-2.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/mq-3.c (100%)
 create mode 100644 testsuite/smokey/psostests/psostests.c
 create mode 100644 testsuite/smokey/psostests/psostests_driver.c
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/pt-1.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/rn-1.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/sem-1.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/sem-2.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-1.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-2.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-3.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-4.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-5.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-6.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-7.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-8.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-9.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-1.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-2.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-3.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-4.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-5.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-6.c (100%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-7.c (100%)

diff --git a/configure.ac b/configure.ac
index fe59333ed..9db5438eb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1044,9 +1044,9 @@ AC_CONFIG_FILES([ \
 	testsuite/smokey/can/Makefile \
 	testsuite/smokey/x86io/Makefile \
 	testsuite/smokey/alchemytests/Makefile \
+	testsuite/smokey/psostests/Makefile \
 	testsuite/clocktest/Makefile \
 	testsuite/xeno-test/Makefile \
-	testsuite/psostests/Makefile \
 	testsuite/vxworkstests/Makefile \
 	utils/Makefile \
 	utils/hdb/Makefile \
diff --git a/lib/psos/testsuite/Makefile b/lib/psos/testsuite/Makefile
deleted file mode 100644
index 3330a617c..000000000
--- a/lib/psos/testsuite/Makefile
+++ /dev/null
@@ -1,49 +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)
-
-ifeq ($(prefix),)
-$(error Please add <xenomai-install-path>/bin to your PATH variable or specify DESTDIR)
-endif
-
-TESTS := \
-	task-1 task-2 task-3 task-4 task-5 task-6 task-7 task-8 task-9 \
-	tm-1 tm-2 tm-3 tm-4 tm-5 tm-6 tm-7 \
-	mq-1 mq-2 mq-3 \
-	sem-1 sem-2 \
-	pt-1 \
-	rn-1
-
-CFLAGS := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --skin=psos --cflags) -g
-LDFLAGS := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --skin=psos --ldflags)
-CC = $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --cc)
-
-all: $(TESTS)
-
-%: %.c
-	$(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
-
-install: all
-	install -d $(prefix)/testsuite/psos
-	install -t $(prefix)/testsuite/psos $(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
diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
index 1be7eaba4..bb94f6ba6 100644
--- a/testsuite/Makefile.am
+++ b/testsuite/Makefile.am
@@ -8,7 +8,6 @@ SUBDIRS += 		\
 	spitest		\
 	switchtest	\
 	xeno-test	\
-	psostests	\
 	vxworkstests
 endif
 
@@ -21,5 +20,4 @@ DIST_SUBDIRS =		\
 	spitest		\
 	switchtest	\
 	xeno-test	\
-	psostests \
 	vxworkstests
diff --git a/testsuite/smokey/Makefile.am b/testsuite/smokey/Makefile.am
index 633a87387..457e22a84 100644
--- a/testsuite/smokey/Makefile.am
+++ b/testsuite/smokey/Makefile.am
@@ -41,13 +41,15 @@ COBALT_SUBDIRS = 	\
 	vdso-access 	\
 	xddp		\
 	y2038 \
-	alchemytests
+	alchemytests \
+	psostests
 
 MERCURY_SUBDIRS =	\
 	memory-heapmem	\
 	memory-tlsf	\
 	memcheck \
-	alchemytests
+	alchemytests \
+	psostests
 
 DIST_SUBDIRS = 		\
 	arith 		\
@@ -83,7 +85,8 @@ DIST_SUBDIRS = 		\
 	vdso-access 	\
 	xddp		\
 	y2038 \
-	alchemytests
+	alchemytests \
+	psostests
 
 if XENO_X86
 DIST_SUBDIRS += x86io
diff --git a/testsuite/smokey/psostests/Makefile.am b/testsuite/smokey/psostests/Makefile.am
new file mode 100644
index 000000000..bd6abc74c
--- /dev/null
+++ b/testsuite/smokey/psostests/Makefile.am
@@ -0,0 +1,148 @@
+testdir = @XENO_TEST_DIR@
+noinst_LIBRARIES = libpsostests.a
+
+libpsostests_a_SOURCES = psostests.c
+libpsostests_a_CPPFLAGS = 		\
+	@XENO_USER_CFLAGS@	\
+	-I$(top_srcdir)		\
+	-I$(top_srcdir)/include \
+	-DXENO_TEST_DIR='"$(XENO_TEST_DIR)"'
+
+CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
+
+test_PROGRAMS = \
+		psostests       \
+		psostests_mq1	\
+		psostests_mq2	\
+		psostests_mq3	\
+		psostests_pt1	\
+		psostests_rn1	\
+		psostests_sem1	\
+		psostests_sem2	\
+		psostests_tm1	\
+		psostests_tm2	\
+		psostests_tm3	\
+		psostests_tm4	\
+		psostests_tm5	\
+		psostests_tm6	\
+		psostests_tm7	\
+		psostests_task1	\
+		psostests_task2	\
+		psostests_task3	\
+		psostests_task4	\
+		psostests_task5	\
+		psostests_task6	\
+		psostests_task7	\
+		psostests_task8	\
+		psostests_task9
+
+psoscppflags = 				\
+	$(XENO_USER_CFLAGS)		\
+	-I$(top_srcdir)		\
+	-I$(top_srcdir)/include
+
+psosldadd = 					\
+	../../../lib/psos/libpsos@CORE@.la		\
+	../../../lib/copperplate/libcopperplate@CORE@.la	\
+	@XENO_CORE_LDADD@ 			\
+	@XENO_USER_LDADD@			\
+	-lpthread -lrt -lm
+
+psostests_SOURCES = psostests_driver.c
+psostests_CPPFLAGS = $(psoscppflags)
+psostests_LDADD = ../../../lib/smokey/libsmokey@CORE@.la -lpthread -lrt
+psostests_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+psostests_mq1_SOURCES = mq-1.c
+psostests_mq1_CPPFLAGS = $(psoscppflags)
+psostests_mq1_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_mq1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_mq2_SOURCES = mq-2.c
+psostests_mq2_CPPFLAGS = $(psoscppflags)
+psostests_mq2_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_mq2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_mq3_SOURCES = mq-3.c
+psostests_mq3_CPPFLAGS = $(psoscppflags)
+psostests_mq3_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_mq3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_pt1_SOURCES = pt-1.c
+psostests_pt1_CPPFLAGS = $(psoscppflags)
+psostests_pt1_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_pt1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_rn1_SOURCES = rn-1.c
+psostests_rn1_CPPFLAGS = $(psoscppflags)
+psostests_rn1_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_rn1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_sem1_SOURCES = sem-1.c
+psostests_sem1_CPPFLAGS = $(psoscppflags)
+psostests_sem1_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_sem1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_sem2_SOURCES = sem-2.c
+psostests_sem2_CPPFLAGS = $(psoscppflags)
+psostests_sem2_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_sem2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_tm1_SOURCES = tm-1.c
+psostests_tm1_CPPFLAGS = $(psoscppflags)
+psostests_tm1_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_tm1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_tm2_SOURCES = tm-2.c
+psostests_tm2_CPPFLAGS = $(psoscppflags)
+psostests_tm2_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_tm2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_tm3_SOURCES = tm-3.c
+psostests_tm3_CPPFLAGS = $(psoscppflags)
+psostests_tm3_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_tm3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_tm4_SOURCES = tm-4.c
+psostests_tm4_CPPFLAGS = $(psoscppflags)
+psostests_tm4_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_tm4_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_tm5_SOURCES = tm-5.c
+psostests_tm5_CPPFLAGS = $(psoscppflags)
+psostests_tm5_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_tm5_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_tm6_SOURCES = tm-6.c
+psostests_tm6_CPPFLAGS = $(psoscppflags)
+psostests_tm6_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_tm6_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_tm7_SOURCES = tm-7.c
+psostests_tm7_CPPFLAGS = $(psoscppflags)
+psostests_tm7_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_tm7_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task1_SOURCES = task-1.c
+psostests_task1_CPPFLAGS = $(psoscppflags)
+psostests_task1_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_task1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task2_SOURCES = task-2.c
+psostests_task2_CPPFLAGS = $(psoscppflags)
+psostests_task2_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_task2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task3_SOURCES = task-3.c
+psostests_task3_CPPFLAGS = $(psoscppflags)
+psostests_task3_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_task3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task4_SOURCES = task-4.c
+psostests_task4_CPPFLAGS = $(psoscppflags)
+psostests_task4_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_task4_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task5_SOURCES = task-5.c
+psostests_task5_CPPFLAGS = $(psoscppflags)
+psostests_task5_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_task5_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task6_SOURCES = task-6.c
+psostests_task6_CPPFLAGS = $(psoscppflags)
+psostests_task6_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_task6_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task7_SOURCES = task-7.c
+psostests_task7_CPPFLAGS = $(psoscppflags)
+psostests_task7_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_task7_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task8_SOURCES = task-8.c
+psostests_task8_CPPFLAGS = $(psoscppflags)
+psostests_task8_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_task8_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task9_SOURCES = task-9.c
+psostests_task9_CPPFLAGS = $(psoscppflags)
+psostests_task9_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_task9_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
diff --git a/lib/psos/testsuite/mq-1.c b/testsuite/smokey/psostests/mq-1.c
similarity index 100%
rename from lib/psos/testsuite/mq-1.c
rename to testsuite/smokey/psostests/mq-1.c
diff --git a/lib/psos/testsuite/mq-2.c b/testsuite/smokey/psostests/mq-2.c
similarity index 100%
rename from lib/psos/testsuite/mq-2.c
rename to testsuite/smokey/psostests/mq-2.c
diff --git a/lib/psos/testsuite/mq-3.c b/testsuite/smokey/psostests/mq-3.c
similarity index 100%
rename from lib/psos/testsuite/mq-3.c
rename to testsuite/smokey/psostests/mq-3.c
diff --git a/testsuite/smokey/psostests/psostests.c b/testsuite/smokey/psostests/psostests.c
new file mode 100644
index 000000000..66c913213
--- /dev/null
+++ b/testsuite/smokey/psostests/psostests.c
@@ -0,0 +1,56 @@
+#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>
+
+#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", XENO_TEST_DIR, t->name);
+	if (ret == -1)
+		return -ENOMEM;
+
+	ret = system(tst_path);
+	free(tst_path);
+
+	return ret;
+}
+
+TEST(psostests)
+TEST(psostests_mq1)
+TEST(psostests_mq2)
+TEST(psostests_mq3)
+TEST(psostests_pt1)
+TEST(psostests_rn1)
+TEST(psostests_sem1)
+TEST(psostests_sem2)
+TEST(psostests_task1)
+TEST(psostests_task2)
+TEST(psostests_task3)
+TEST(psostests_task4)
+TEST(psostests_task5)
+TEST(psostests_task6)
+TEST(psostests_task7)
+TEST(psostests_task8)
+TEST(psostests_task9)
+TEST(psostests_tm1)
+TEST(psostests_tm2)
+TEST(psostests_tm3)
+TEST(psostests_tm4)
+TEST(psostests_tm5)
+TEST(psostests_tm6)
+TEST(psostests_tm7)
+
diff --git a/testsuite/smokey/psostests/psostests_driver.c b/testsuite/smokey/psostests/psostests_driver.c
new file mode 100644
index 000000000..d79e44c74
--- /dev/null
+++ b/testsuite/smokey/psostests/psostests_driver.c
@@ -0,0 +1,33 @@
+#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>
+
+int main(int argc, char *const argv[])
+{
+       struct smokey_test *t;
+       int ret, fails = 0;
+
+       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;
+}
+
diff --git a/lib/psos/testsuite/pt-1.c b/testsuite/smokey/psostests/pt-1.c
similarity index 100%
rename from lib/psos/testsuite/pt-1.c
rename to testsuite/smokey/psostests/pt-1.c
diff --git a/lib/psos/testsuite/rn-1.c b/testsuite/smokey/psostests/rn-1.c
similarity index 100%
rename from lib/psos/testsuite/rn-1.c
rename to testsuite/smokey/psostests/rn-1.c
diff --git a/lib/psos/testsuite/sem-1.c b/testsuite/smokey/psostests/sem-1.c
similarity index 100%
rename from lib/psos/testsuite/sem-1.c
rename to testsuite/smokey/psostests/sem-1.c
diff --git a/lib/psos/testsuite/sem-2.c b/testsuite/smokey/psostests/sem-2.c
similarity index 100%
rename from lib/psos/testsuite/sem-2.c
rename to testsuite/smokey/psostests/sem-2.c
diff --git a/lib/psos/testsuite/task-1.c b/testsuite/smokey/psostests/task-1.c
similarity index 100%
rename from lib/psos/testsuite/task-1.c
rename to testsuite/smokey/psostests/task-1.c
diff --git a/lib/psos/testsuite/task-2.c b/testsuite/smokey/psostests/task-2.c
similarity index 100%
rename from lib/psos/testsuite/task-2.c
rename to testsuite/smokey/psostests/task-2.c
diff --git a/lib/psos/testsuite/task-3.c b/testsuite/smokey/psostests/task-3.c
similarity index 100%
rename from lib/psos/testsuite/task-3.c
rename to testsuite/smokey/psostests/task-3.c
diff --git a/lib/psos/testsuite/task-4.c b/testsuite/smokey/psostests/task-4.c
similarity index 100%
rename from lib/psos/testsuite/task-4.c
rename to testsuite/smokey/psostests/task-4.c
diff --git a/lib/psos/testsuite/task-5.c b/testsuite/smokey/psostests/task-5.c
similarity index 100%
rename from lib/psos/testsuite/task-5.c
rename to testsuite/smokey/psostests/task-5.c
diff --git a/lib/psos/testsuite/task-6.c b/testsuite/smokey/psostests/task-6.c
similarity index 100%
rename from lib/psos/testsuite/task-6.c
rename to testsuite/smokey/psostests/task-6.c
diff --git a/lib/psos/testsuite/task-7.c b/testsuite/smokey/psostests/task-7.c
similarity index 100%
rename from lib/psos/testsuite/task-7.c
rename to testsuite/smokey/psostests/task-7.c
diff --git a/lib/psos/testsuite/task-8.c b/testsuite/smokey/psostests/task-8.c
similarity index 100%
rename from lib/psos/testsuite/task-8.c
rename to testsuite/smokey/psostests/task-8.c
diff --git a/lib/psos/testsuite/task-9.c b/testsuite/smokey/psostests/task-9.c
similarity index 100%
rename from lib/psos/testsuite/task-9.c
rename to testsuite/smokey/psostests/task-9.c
diff --git a/lib/psos/testsuite/tm-1.c b/testsuite/smokey/psostests/tm-1.c
similarity index 100%
rename from lib/psos/testsuite/tm-1.c
rename to testsuite/smokey/psostests/tm-1.c
diff --git a/lib/psos/testsuite/tm-2.c b/testsuite/smokey/psostests/tm-2.c
similarity index 100%
rename from lib/psos/testsuite/tm-2.c
rename to testsuite/smokey/psostests/tm-2.c
diff --git a/lib/psos/testsuite/tm-3.c b/testsuite/smokey/psostests/tm-3.c
similarity index 100%
rename from lib/psos/testsuite/tm-3.c
rename to testsuite/smokey/psostests/tm-3.c
diff --git a/lib/psos/testsuite/tm-4.c b/testsuite/smokey/psostests/tm-4.c
similarity index 100%
rename from lib/psos/testsuite/tm-4.c
rename to testsuite/smokey/psostests/tm-4.c
diff --git a/lib/psos/testsuite/tm-5.c b/testsuite/smokey/psostests/tm-5.c
similarity index 100%
rename from lib/psos/testsuite/tm-5.c
rename to testsuite/smokey/psostests/tm-5.c
diff --git a/lib/psos/testsuite/tm-6.c b/testsuite/smokey/psostests/tm-6.c
similarity index 100%
rename from lib/psos/testsuite/tm-6.c
rename to testsuite/smokey/psostests/tm-6.c
diff --git a/lib/psos/testsuite/tm-7.c b/testsuite/smokey/psostests/tm-7.c
similarity index 100%
rename from lib/psos/testsuite/tm-7.c
rename to testsuite/smokey/psostests/tm-7.c
-- 
2.35.3


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

* [PATCH 03/10] testsuite: Fully integrate vwworkstests into smokey
  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 14:51     ` [PATCH 02/10] testsuite: Fully integrate psostests " Aaron Marcher
@ 2023-07-20 14:51     ` Aaron Marcher
  2023-07-20 14:51     ` [PATCH 04/10] testsuite: Remove old alchemytests Makefile Aaron Marcher
                       ` (8 subsequent siblings)
  11 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-07-20 14:51 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

Same as for alchemytests and psostests.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 configure.ac                                  |  2 +-
 lib/vxworks/testsuite/Makefile                | 43 ---------
 testsuite/Makefile.am                         |  6 +-
 testsuite/smokey/Makefile.am                  |  3 +
 testsuite/smokey/vxworkstests/Makefile.am     | 94 +++++++++++++++++++
 .../smokey/vxworkstests}/lst-1.c              |  0
 .../smokey/vxworkstests}/msgQ-1.c             |  0
 .../smokey/vxworkstests}/msgQ-2.c             |  0
 .../smokey/vxworkstests}/msgQ-3.c             |  0
 .../smokey/vxworkstests}/rng-1.c              |  0
 .../smokey/vxworkstests}/sem-1.c              |  0
 .../smokey/vxworkstests}/sem-2.c              |  0
 .../smokey/vxworkstests}/sem-3.c              |  0
 .../smokey/vxworkstests}/sem-4.c              |  0
 .../smokey/vxworkstests}/task-1.c             |  0
 .../smokey/vxworkstests}/task-2.c             |  0
 testsuite/smokey/vxworkstests/vxworkstests.c  | 45 +++++++++
 .../smokey/vxworkstests/vxworkstests_driver.c | 32 +++++++
 .../smokey/vxworkstests}/wd-1.c               |  0
 19 files changed, 177 insertions(+), 48 deletions(-)
 delete mode 100644 lib/vxworks/testsuite/Makefile
 create mode 100644 testsuite/smokey/vxworkstests/Makefile.am
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/lst-1.c (100%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-1.c (100%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-2.c (100%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-3.c (100%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/rng-1.c (100%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-1.c (100%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-2.c (100%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-3.c (100%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-4.c (100%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/task-1.c (100%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/task-2.c (100%)
 create mode 100644 testsuite/smokey/vxworkstests/vxworkstests.c
 create mode 100644 testsuite/smokey/vxworkstests/vxworkstests_driver.c
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/wd-1.c (100%)

diff --git a/configure.ac b/configure.ac
index 9db5438eb..a601f94cd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1045,9 +1045,9 @@ AC_CONFIG_FILES([ \
 	testsuite/smokey/x86io/Makefile \
 	testsuite/smokey/alchemytests/Makefile \
 	testsuite/smokey/psostests/Makefile \
+	testsuite/smokey/vxworkstests/Makefile \
 	testsuite/clocktest/Makefile \
 	testsuite/xeno-test/Makefile \
-	testsuite/vxworkstests/Makefile \
 	utils/Makefile \
 	utils/hdb/Makefile \
 	utils/can/Makefile \
diff --git a/lib/vxworks/testsuite/Makefile b/lib/vxworks/testsuite/Makefile
deleted file mode 100644
index 648c9be90..000000000
--- a/lib/vxworks/testsuite/Makefile
+++ /dev/null
@@ -1,43 +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)
-
-ifeq ($(prefix),)
-$(error Please add <xenomai-install-path>/bin to your PATH variable or specify DESTDIR)
-endif
-
-TESTS := task-1 task-2 msgQ-1 msgQ-2 msgQ-3 wd-1 sem-1 sem-2 sem-3 sem-4 lst-1 rng-1
-
-CFLAGS := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --skin=vxworks --cflags) -g
-LDFLAGS := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --skin=vxworks --ldflags)
-CC = $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --cc)
-
-all: $(TESTS)
-
-%: %.c
-	$(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
-
-install: all
-	install -d $(prefix)/testsuite/vxworks
-	install -t $(prefix)/testsuite/vxworks $(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
diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
index bb94f6ba6..4932f6d33 100644
--- a/testsuite/Makefile.am
+++ b/testsuite/Makefile.am
@@ -7,8 +7,7 @@ SUBDIRS += 		\
 	gpiotest	\
 	spitest		\
 	switchtest	\
-	xeno-test	\
-	vxworkstests
+	xeno-test
 endif
 
 DIST_SUBDIRS =		\
@@ -19,5 +18,4 @@ DIST_SUBDIRS =		\
 	smokey		\
 	spitest		\
 	switchtest	\
-	xeno-test	\
-	vxworkstests
+	xeno-test
diff --git a/testsuite/smokey/Makefile.am b/testsuite/smokey/Makefile.am
index 457e22a84..888e83b1c 100644
--- a/testsuite/smokey/Makefile.am
+++ b/testsuite/smokey/Makefile.am
@@ -42,6 +42,7 @@ COBALT_SUBDIRS = 	\
 	xddp		\
 	y2038 \
 	alchemytests \
+	vxworkstests \
 	psostests
 
 MERCURY_SUBDIRS =	\
@@ -49,6 +50,7 @@ MERCURY_SUBDIRS =	\
 	memory-tlsf	\
 	memcheck \
 	alchemytests \
+	vxworkstests \
 	psostests
 
 DIST_SUBDIRS = 		\
@@ -86,6 +88,7 @@ DIST_SUBDIRS = 		\
 	xddp		\
 	y2038 \
 	alchemytests \
+	vxworkstests \
 	psostests
 
 if XENO_X86
diff --git a/testsuite/smokey/vxworkstests/Makefile.am b/testsuite/smokey/vxworkstests/Makefile.am
new file mode 100644
index 000000000..ba942c455
--- /dev/null
+++ b/testsuite/smokey/vxworkstests/Makefile.am
@@ -0,0 +1,94 @@
+testdir = @XENO_TEST_DIR@
+noinst_LIBRARIES = libvxworkstests.a
+
+libvxworkstests_a_SOURCES = vxworkstests.c
+libvxworkstests_a_CPPFLAGS = 		\
+	@XENO_USER_CFLAGS@	\
+	-I$(top_srcdir)		\
+	-I$(top_srcdir)/include \
+	-DXENO_TEST_DIR='"$(XENO_TEST_DIR)"'
+
+CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
+
+test_PROGRAMS = \
+		vxworkstests \
+		vxworkstests_lst1	\
+		vxworkstests_msgQ1	\
+		vxworkstests_msgQ2	\
+		vxworkstests_msgQ3	\
+		vxworkstests_rng1	\
+		vxworkstests_sem1	\
+		vxworkstests_sem2	\
+		vxworkstests_sem3	\
+		vxworkstests_sem4	\
+		vxworkstests_wd1	\
+		vxworkstests_task1	\
+		vxworkstests_task2
+
+vxworkscppflags = 				\
+	$(XENO_USER_CFLAGS)		\
+	-I$(top_srcdir)/include
+
+vxworksldadd = 					\
+	../../../lib/vxworks/libvxworks@CORE@.la		\
+	../../../lib/copperplate/libcopperplate@CORE@.la	\
+	@XENO_CORE_LDADD@ 			\
+	@XENO_USER_LDADD@			\
+	-lpthread -lrt -lm
+
+vxworkstests_SOURCES = vxworkstests_driver.c
+vxworkstests_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_LDADD =			\
+	../../../lib/smokey/libsmokey@CORE@.la	\
+	-lpthread -lrt
+
+vxworkstests_lst1_SOURCES = lst-1.c
+vxworkstests_lst1_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_lst1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_lst1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_task1_SOURCES = task-1.c
+vxworkstests_task1_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_task1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_task1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_task2_SOURCES = task-2.c
+vxworkstests_task2_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_task2_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_task2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_msgQ1_SOURCES = msgQ-1.c
+vxworkstests_msgQ1_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_msgQ1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_msgQ1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_msgQ2_SOURCES = msgQ-2.c
+vxworkstests_msgQ2_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_msgQ2_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_msgQ2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_msgQ3_SOURCES = msgQ-3.c
+vxworkstests_msgQ3_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_msgQ3_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_msgQ3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_rng1_SOURCES = rng-1.c
+vxworkstests_rng1_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_rng1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_rng1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_sem1_SOURCES = sem-1.c
+vxworkstests_sem1_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_sem1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_sem1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_sem2_SOURCES = sem-2.c
+vxworkstests_sem2_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_sem2_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_sem2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_sem3_SOURCES = sem-3.c
+vxworkstests_sem3_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_sem3_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_sem3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_sem4_SOURCES = sem-4.c
+vxworkstests_sem4_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_sem4_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_sem4_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_wd1_SOURCES = wd-1.c
+vxworkstests_wd1_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_wd1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_wd1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
diff --git a/lib/vxworks/testsuite/lst-1.c b/testsuite/smokey/vxworkstests/lst-1.c
similarity index 100%
rename from lib/vxworks/testsuite/lst-1.c
rename to testsuite/smokey/vxworkstests/lst-1.c
diff --git a/lib/vxworks/testsuite/msgQ-1.c b/testsuite/smokey/vxworkstests/msgQ-1.c
similarity index 100%
rename from lib/vxworks/testsuite/msgQ-1.c
rename to testsuite/smokey/vxworkstests/msgQ-1.c
diff --git a/lib/vxworks/testsuite/msgQ-2.c b/testsuite/smokey/vxworkstests/msgQ-2.c
similarity index 100%
rename from lib/vxworks/testsuite/msgQ-2.c
rename to testsuite/smokey/vxworkstests/msgQ-2.c
diff --git a/lib/vxworks/testsuite/msgQ-3.c b/testsuite/smokey/vxworkstests/msgQ-3.c
similarity index 100%
rename from lib/vxworks/testsuite/msgQ-3.c
rename to testsuite/smokey/vxworkstests/msgQ-3.c
diff --git a/lib/vxworks/testsuite/rng-1.c b/testsuite/smokey/vxworkstests/rng-1.c
similarity index 100%
rename from lib/vxworks/testsuite/rng-1.c
rename to testsuite/smokey/vxworkstests/rng-1.c
diff --git a/lib/vxworks/testsuite/sem-1.c b/testsuite/smokey/vxworkstests/sem-1.c
similarity index 100%
rename from lib/vxworks/testsuite/sem-1.c
rename to testsuite/smokey/vxworkstests/sem-1.c
diff --git a/lib/vxworks/testsuite/sem-2.c b/testsuite/smokey/vxworkstests/sem-2.c
similarity index 100%
rename from lib/vxworks/testsuite/sem-2.c
rename to testsuite/smokey/vxworkstests/sem-2.c
diff --git a/lib/vxworks/testsuite/sem-3.c b/testsuite/smokey/vxworkstests/sem-3.c
similarity index 100%
rename from lib/vxworks/testsuite/sem-3.c
rename to testsuite/smokey/vxworkstests/sem-3.c
diff --git a/lib/vxworks/testsuite/sem-4.c b/testsuite/smokey/vxworkstests/sem-4.c
similarity index 100%
rename from lib/vxworks/testsuite/sem-4.c
rename to testsuite/smokey/vxworkstests/sem-4.c
diff --git a/lib/vxworks/testsuite/task-1.c b/testsuite/smokey/vxworkstests/task-1.c
similarity index 100%
rename from lib/vxworks/testsuite/task-1.c
rename to testsuite/smokey/vxworkstests/task-1.c
diff --git a/lib/vxworks/testsuite/task-2.c b/testsuite/smokey/vxworkstests/task-2.c
similarity index 100%
rename from lib/vxworks/testsuite/task-2.c
rename to testsuite/smokey/vxworkstests/task-2.c
diff --git a/testsuite/smokey/vxworkstests/vxworkstests.c b/testsuite/smokey/vxworkstests/vxworkstests.c
new file mode 100644
index 000000000..a3f84ce01
--- /dev/null
+++ b/testsuite/smokey/vxworkstests/vxworkstests.c
@@ -0,0 +1,45 @@
+#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>
+
+#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", XENO_TEST_DIR, t->name);
+	if (ret == -1)
+		return -ENOMEM;
+
+	ret = system(tst_path);
+	free(tst_path);
+
+	return ret;
+}
+
+TEST(vxworkstests)
+TEST(vxworkstests_lst1)
+TEST(vxworkstests_msgQ1)
+TEST(vxworkstests_msgQ2)
+TEST(vxworkstests_msgQ3)
+TEST(vxworkstests_rng1)
+TEST(vxworkstests_sem1)
+TEST(vxworkstests_sem2)
+TEST(vxworkstests_sem3)
+TEST(vxworkstests_sem4)
+TEST(vxworkstests_wd1)
+TEST(vxworkstests_task1)
+TEST(vxworkstests_task2)
+
diff --git a/testsuite/smokey/vxworkstests/vxworkstests_driver.c b/testsuite/smokey/vxworkstests/vxworkstests_driver.c
new file mode 100644
index 000000000..cf9045bb5
--- /dev/null
+++ b/testsuite/smokey/vxworkstests/vxworkstests_driver.c
@@ -0,0 +1,32 @@
+#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>
+
+int main(int argc, char *const argv[])
+{
+	struct smokey_test *t;
+	int ret, fails = 0;
+
+	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;
+}
diff --git a/lib/vxworks/testsuite/wd-1.c b/testsuite/smokey/vxworkstests/wd-1.c
similarity index 100%
rename from lib/vxworks/testsuite/wd-1.c
rename to testsuite/smokey/vxworkstests/wd-1.c
-- 
2.35.3


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

* [PATCH 04/10] testsuite: Remove old alchemytests Makefile
  2023-07-20 14:51   ` [PATCH v4 00/10] " Aaron Marcher
                       ` (2 preceding siblings ...)
  2023-07-20 14:51     ` [PATCH 03/10] testsuite: Fully integrate vwworkstests " Aaron Marcher
@ 2023-07-20 14:51     ` Aaron Marcher
  2023-07-20 14:51     ` [PATCH 05/10] alchemytests: Fix gcc warning in buffer-1 Aaron Marcher
                       ` (7 subsequent siblings)
  11 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-07-20 14:51 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

From: Richard Weinberger <richard@nod.at>

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Aaron Marcher <aaron@sigma-star.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.35.3


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

* [PATCH 05/10] alchemytests: Fix gcc warning in buffer-1
  2023-07-20 14:51   ` [PATCH v4 00/10] " Aaron Marcher
                       ` (3 preceding siblings ...)
  2023-07-20 14:51     ` [PATCH 04/10] testsuite: Remove old alchemytests Makefile Aaron Marcher
@ 2023-07-20 14:51     ` Aaron Marcher
  2023-07-20 14:51     ` [PATCH 06/10] alchemytests: Fix gcc warning in task-9 Aaron Marcher
                       ` (6 subsequent siblings)
  11 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-07-20 14:51 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

From: Richard Weinberger <richard@nod.at>

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>
Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 testsuite/smokey/alchemytests/buffer-1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testsuite/smokey/alchemytests/buffer-1.c b/testsuite/smokey/alchemytests/buffer-1.c
index d6d1d9ad7..807db1dcf 100644
--- a/testsuite/smokey/alchemytests/buffer-1.c
+++ b/testsuite/smokey/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.35.3


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

* [PATCH 06/10] alchemytests: Fix gcc warning in task-9
  2023-07-20 14:51   ` [PATCH v4 00/10] " Aaron Marcher
                       ` (4 preceding siblings ...)
  2023-07-20 14:51     ` [PATCH 05/10] alchemytests: Fix gcc warning in buffer-1 Aaron Marcher
@ 2023-07-20 14:51     ` Aaron Marcher
  2023-07-20 14:51     ` [PATCH 07/10] alchemytests: Check pipe-1 asprintf ret value Aaron Marcher
                       ` (5 subsequent siblings)
  11 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-07-20 14:51 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

From: Richard Weinberger <richard@nod.at>

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>
Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 testsuite/smokey/alchemytests/task-9.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testsuite/smokey/alchemytests/task-9.c b/testsuite/smokey/alchemytests/task-9.c
index e358154c5..4b62a17be 100644
--- a/testsuite/smokey/alchemytests/task-9.c
+++ b/testsuite/smokey/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.35.3


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

* [PATCH 07/10] alchemytests: Check pipe-1 asprintf ret value
  2023-07-20 14:51   ` [PATCH v4 00/10] " Aaron Marcher
                       ` (5 preceding siblings ...)
  2023-07-20 14:51     ` [PATCH 06/10] alchemytests: Fix gcc warning in task-9 Aaron Marcher
@ 2023-07-20 14:51     ` Aaron Marcher
  2023-07-20 14:51     ` [PATCH 08/10] alchemytests: Fix task-2 Aaron Marcher
                       ` (4 subsequent siblings)
  11 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-07-20 14:51 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 testsuite/smokey/alchemytests/pipe-1.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/testsuite/smokey/alchemytests/pipe-1.c b/testsuite/smokey/alchemytests/pipe-1.c
index 4202be2ba..da5fbf999 100644
--- a/testsuite/smokey/alchemytests/pipe-1.c
+++ b/testsuite/smokey/alchemytests/pipe-1.c
@@ -48,11 +48,13 @@ static void realtime_task(void *arg)
 static void *regular_thread(void *arg)
 {
 	struct pipe_message m;
-	int fd, seq = 0;
+	int fd, res, seq = 0;
 	ssize_t ret;
 	char *rtp;
 
-	asprintf(&rtp, "/dev/rtp%d", minor);
+	res = asprintf(&rtp, "/dev/rtp%d", minor);
+	if (res < 0)
+		return NULL;
 
 	fd = open(rtp, O_RDWR);
 	free(rtp);
-- 
2.35.3


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

* [PATCH 08/10] alchemytests: Fix task-2
  2023-07-20 14:51   ` [PATCH v4 00/10] " Aaron Marcher
                       ` (6 preceding siblings ...)
  2023-07-20 14:51     ` [PATCH 07/10] alchemytests: Check pipe-1 asprintf ret value Aaron Marcher
@ 2023-07-20 14:51     ` Aaron Marcher
  2023-07-20 14:51     ` [PATCH 09/10] alchemytests: Fix task-5 logic Aaron Marcher
                       ` (3 subsequent siblings)
  11 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-07-20 14:51 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

https://lore.kernel.org/xenomai/2065449276.254073.1649941119506.JavaMail.zimbra@nod.at/

Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 testsuite/smokey/alchemytests/task-2.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/testsuite/smokey/alchemytests/task-2.c b/testsuite/smokey/alchemytests/task-2.c
index e751ddd34..9d5281c75 100644
--- a/testsuite/smokey/alchemytests/task-2.c
+++ b/testsuite/smokey/alchemytests/task-2.c
@@ -28,8 +28,10 @@ static void background_task(void *arg)
 
 	traceobj_mark(&trobj, 2);
 
-	while (--safety > 0)
+	while (--safety > 0) {
+		compiler_barrier();
 		count++;
+	}
 
 	traceobj_exit(&trobj);
 }
-- 
2.35.3


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

* [PATCH 09/10] alchemytests: Fix task-5 logic
  2023-07-20 14:51   ` [PATCH v4 00/10] " Aaron Marcher
                       ` (7 preceding siblings ...)
  2023-07-20 14:51     ` [PATCH 08/10] alchemytests: Fix task-2 Aaron Marcher
@ 2023-07-20 14:51     ` Aaron Marcher
  2023-07-20 14:51     ` [PATCH 10/10] testsuite: disable broken tests Aaron Marcher
                       ` (2 subsequent siblings)
  11 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-07-20 14:51 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

Semaphore call in wrong logical order, so that on the second
rt_task_set_priority call the task doesn't exist anymore and thus the
call fails with EINVAL.

This commit fixes the order so that the test passes again.

Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 testsuite/smokey/alchemytests/task-5.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/testsuite/smokey/alchemytests/task-5.c b/testsuite/smokey/alchemytests/task-5.c
index 3c0fa427c..c402de22e 100644
--- a/testsuite/smokey/alchemytests/task-5.c
+++ b/testsuite/smokey/alchemytests/task-5.c
@@ -44,17 +44,17 @@ static void foreground_task(void *arg)
 
 	traceobj_mark(&trobj, 4);
 
-	ret = rt_sem_v(&sem);
-	traceobj_check(&trobj, ret, 0);
+	ret = rt_task_inquire(NULL, &info);
+	traceobj_assert(&trobj, ret == 0 && info.prio == 21);
 
 	traceobj_mark(&trobj, 5);
 
-	ret = rt_task_inquire(NULL, &info);
-	traceobj_assert(&trobj, ret == 0 && info.prio == 21);
+	ret = rt_task_set_priority(&t_bgnd, info.prio);
+	traceobj_check(&trobj, ret, 0);
 
 	traceobj_mark(&trobj, 6);
 
-	ret = rt_task_set_priority(&t_bgnd, info.prio);
+	ret = rt_sem_v(&sem);
 	traceobj_check(&trobj, ret, 0);
 
 	traceobj_mark(&trobj, 7);
-- 
2.35.3


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

* [PATCH 10/10] testsuite: disable broken tests
  2023-07-20 14:51   ` [PATCH v4 00/10] " Aaron Marcher
                       ` (8 preceding siblings ...)
  2023-07-20 14:51     ` [PATCH 09/10] alchemytests: Fix task-5 logic Aaron Marcher
@ 2023-07-20 14:51     ` Aaron Marcher
  2023-07-20 14:54     ` [PATCH v4 00/10] Revive alchemy, pSOS and VxWorks tests Jan Kiszka
  2023-07-24 13:52     ` [PATCH v5 " Aaron Marcher
  11 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-07-20 14:51 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

as discussed on the mailing list, disable broken tests (for now)

Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 testsuite/smokey/psostests/psostests.c | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/testsuite/smokey/psostests/psostests.c b/testsuite/smokey/psostests/psostests.c
index 66c913213..805cdd429 100644
--- a/testsuite/smokey/psostests/psostests.c
+++ b/testsuite/smokey/psostests/psostests.c
@@ -34,18 +34,30 @@ TEST(psostests_mq1)
 TEST(psostests_mq2)
 TEST(psostests_mq3)
 TEST(psostests_pt1)
-TEST(psostests_rn1)
+// 0"000.679| BUG in __traceobj_assert_failed(): [rn1] trace assertion failed:
+//            testsuite/psostests/rn-1.c:46
+// => "ret == 0"
+//TEST(psostests_rn1)
 TEST(psostests_sem1)
 TEST(psostests_sem2)
 TEST(psostests_task1)
-TEST(psostests_task2)
+// 0"014.452| BUG in __traceobj_assert_failed(): [FGND] trace assertion failed:
+//            ../../../../../../../../../workspace/sources/xenomai/testsuite/smokey/psostests/task-2.c:56 => "ret == 0"
+//TEST(psostests_task2)
 TEST(psostests_task3)
 TEST(psostests_task4)
 TEST(psostests_task5)
-TEST(psostests_task6)
+// 0"011.370| BUG in __traceobj_assert_failed(): [FGND] trace assertion failed:
+//            testsuite/psostests/task-6.c:62
+// => "ret == 0 && oldprio == myprio"
+// TEST(psostests_task6)
 TEST(psostests_task7)
-TEST(psostests_task8)
-TEST(psostests_task9)
+// runs forever (100% CPU)
+//TEST(psostests_task8)
+// 0"002.198| WARNING: [main] lack of resources for core thread, EBUSY
+// 0"003.421| BUG in __traceobj_assert_failed(): [root] trace assertion failed:
+//           ../../../../../../../../../workspace/sources/xenomai/testsuite/smokey/psostests/task-9.c:29 => "ret == 0"
+//TEST(psostests_task9)
 TEST(psostests_tm1)
 TEST(psostests_tm2)
 TEST(psostests_tm3)
-- 
2.35.3


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

* Re: [PATCH v4 00/10] Revive alchemy, pSOS and VxWorks tests
  2023-07-20 14:51   ` [PATCH v4 00/10] " Aaron Marcher
                       ` (9 preceding siblings ...)
  2023-07-20 14:51     ` [PATCH 10/10] testsuite: disable broken tests Aaron Marcher
@ 2023-07-20 14:54     ` Jan Kiszka
  2023-07-20 15:01       ` Aaron Marcher
  2023-07-24 13:52     ` [PATCH v5 " Aaron Marcher
  11 siblings, 1 reply; 112+ messages in thread
From: Jan Kiszka @ 2023-07-20 14:54 UTC (permalink / raw)
  To: Aaron Marcher, xenomai; +Cc: richard

On 20.07.23 16:51, Aaron Marcher wrote:
> This patch series fully integrates the currently abandoned alchemy, pSOS
> and VxWorks tests into Xenomai's testsuite.
> For each test, a Smokey testcase is hooked up.
> 
> Aaron Marcher (7):
>   testsuite: Fully integrate alchemytests into smokey
>   testsuite: Fully integrate psostests into smokey
>   testsuite: Fully integrate vwworkstests into smokey
>   alchemytests: Check pipe-1 asprintf ret value
>   alchemytests: Fix task-2
>   alchemytests: Fix task-5 logic
>   testsuite: disable broken tests
> 
> Richard Weinberger (3):
>   testsuite: Remove old alchemytests Makefile
>   alchemytests: Fix gcc warning in buffer-1
>   alchemytests: Fix gcc warning in task-9
> 

Thanks for the update! For the lazy maintainer at least: What's new in v4?

Jan

-- 
Siemens AG, Technology
Linux Expert Center


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

* Re: [PATCH v4 00/10] Revive alchemy, pSOS and VxWorks tests
  2023-07-20 14:54     ` [PATCH v4 00/10] Revive alchemy, pSOS and VxWorks tests Jan Kiszka
@ 2023-07-20 15:01       ` Aaron Marcher
  0 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-07-20 15:01 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: xenomai, richard

Hi Jan,

> Thanks for the update! For the lazy maintainer at least: What's new in v4?

sorry for the missing changelog. Here are all major changes since v3:

- Fully integrated all tests into Smokey framework, as discussed
- Disabled some tests with comments, as discussed
- Fixed task-2 in alchemytests
- Fixed task-5 in alchemytests
- Rebased to latest master

Aaron

-- 
sigma star gmbh | Eduard-Bodem-Gasse 6, 6020 Innsbruck, AUT
UID/VAT Nr: ATU 66964118 | FN: 374287y

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

* Re: [PATCH 01/10] testsuite: Fully integrate alchemytests into smokey
  2023-07-20 14:51     ` [PATCH 01/10] testsuite: Fully integrate alchemytests into smokey Aaron Marcher
@ 2023-07-20 16:50       ` Jan Kiszka
  0 siblings, 0 replies; 112+ messages in thread
From: Jan Kiszka @ 2023-07-20 16:50 UTC (permalink / raw)
  To: Aaron Marcher, xenomai; +Cc: richard

On 20.07.23 16:51, Aaron Marcher wrote:
> This is the very first step to have the alchemy tests embedded
> into our testsuite.
> 
> Build them using Xenomai's build system and hook them up using
> Smokey. Every test binary has it's own respective testcase in the
> testsuite.
> 
> Signed-off-by: Richard Weinberger <richard@nod.at>
> Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
> ---
>  configure.ac                                  |   7 +-
>  testsuite/Makefile.am                         |   8 +-
>  testsuite/smokey/Makefile.am                  |   9 +-
>  testsuite/smokey/alchemytests/Makefile.am     | 148 ++++++++++++++++++
>  .../smokey/alchemytests}/alarm-1.c            |   0
>  testsuite/smokey/alchemytests/alchemytests.c  |  55 +++++++
>  .../smokey/alchemytests/alchemytests_driver.c |  32 ++++
>  .../smokey/alchemytests}/buffer-1.c           |   0
>  .../smokey/alchemytests}/event-1.c            |   0
>  .../smokey/alchemytests}/heap-1.c             |   0
>  .../smokey/alchemytests}/heap-2.c             |   0
>  .../smokey/alchemytests}/mq-1.c               |   0
>  .../smokey/alchemytests}/mq-2.c               |   0
>  .../smokey/alchemytests}/mq-3.c               |   0
>  .../smokey/alchemytests}/mutex-1.c            |   0
>  .../smokey/alchemytests}/pipe-1.c             |   0
>  .../smokey/alchemytests}/sem-1.c              |   0
>  .../smokey/alchemytests}/sem-2.c              |   0
>  .../smokey/alchemytests}/task-1.c             |   0
>  .../smokey/alchemytests}/task-10.c            |   0
>  .../smokey/alchemytests}/task-2.c             |   0
>  .../smokey/alchemytests}/task-3.c             |   0
>  .../smokey/alchemytests}/task-4.c             |   0
>  .../smokey/alchemytests}/task-5.c             |   0
>  .../smokey/alchemytests}/task-6.c             |   0
>  .../smokey/alchemytests}/task-7.c             |   0
>  .../smokey/alchemytests}/task-8.c             |   0
>  .../smokey/alchemytests}/task-9.c             |   0
>  28 files changed, 252 insertions(+), 7 deletions(-)
>  create mode 100644 testsuite/smokey/alchemytests/Makefile.am
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/alarm-1.c (100%)
>  create mode 100644 testsuite/smokey/alchemytests/alchemytests.c
>  create mode 100644 testsuite/smokey/alchemytests/alchemytests_driver.c
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/buffer-1.c (100%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/event-1.c (100%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/heap-1.c (100%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/heap-2.c (100%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-1.c (100%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-2.c (100%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-3.c (100%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mutex-1.c (100%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/pipe-1.c (100%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/sem-1.c (100%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/sem-2.c (100%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-1.c (100%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-10.c (100%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-2.c (100%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-3.c (100%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-4.c (100%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-5.c (100%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-6.c (100%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-7.c (100%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-8.c (100%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-9.c (100%)
> 
> diff --git a/configure.ac b/configure.ac
> index 3ce34048e..fe59333ed 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1041,10 +1041,13 @@ AC_CONFIG_FILES([ \
>  	testsuite/smokey/cpu-affinity/Makefile \
>  	testsuite/smokey/gdb/Makefile \
>  	testsuite/smokey/y2038/Makefile \
> -	testsuite/smokey/can/Makefile
> -	testsuite/smokey/x86io/Makefile
> +	testsuite/smokey/can/Makefile \
> +	testsuite/smokey/x86io/Makefile \
> +	testsuite/smokey/alchemytests/Makefile \
>  	testsuite/clocktest/Makefile \
>  	testsuite/xeno-test/Makefile \
> +	testsuite/psostests/Makefile \
> +	testsuite/vxworkstests/Makefile \
>  	utils/Makefile \
>  	utils/hdb/Makefile \
>  	utils/can/Makefile \
> diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
> index 4932f6d33..1be7eaba4 100644
> --- a/testsuite/Makefile.am
> +++ b/testsuite/Makefile.am
> @@ -7,7 +7,9 @@ SUBDIRS += 		\
>  	gpiotest	\
>  	spitest		\
>  	switchtest	\
> -	xeno-test
> +	xeno-test	\
> +	psostests	\
> +	vxworkstests
>  endif
>  
>  DIST_SUBDIRS =		\
> @@ -18,4 +20,6 @@ DIST_SUBDIRS =		\
>  	smokey		\
>  	spitest		\
>  	switchtest	\
> -	xeno-test
> +	xeno-test	\
> +	psostests \
> +	vxworkstests
> diff --git a/testsuite/smokey/Makefile.am b/testsuite/smokey/Makefile.am
> index 79dc61e9f..633a87387 100644
> --- a/testsuite/smokey/Makefile.am
> +++ b/testsuite/smokey/Makefile.am
> @@ -40,12 +40,14 @@ COBALT_SUBDIRS = 	\
>  	tsc		\
>  	vdso-access 	\
>  	xddp		\
> -	y2038
> +	y2038 \
> +	alchemytests
>  
>  MERCURY_SUBDIRS =	\
>  	memory-heapmem	\
>  	memory-tlsf	\
> -	memcheck
> +	memcheck \
> +	alchemytests
>  
>  DIST_SUBDIRS = 		\
>  	arith 		\
> @@ -80,7 +82,8 @@ DIST_SUBDIRS = 		\
>  	tsc		\
>  	vdso-access 	\
>  	xddp		\
> -	y2038
> +	y2038 \
> +	alchemytests
>  
>  if XENO_X86
>  DIST_SUBDIRS += x86io
> diff --git a/testsuite/smokey/alchemytests/Makefile.am b/testsuite/smokey/alchemytests/Makefile.am
> new file mode 100644
> index 000000000..9da3a98f3
> --- /dev/null
> +++ b/testsuite/smokey/alchemytests/Makefile.am
> @@ -0,0 +1,148 @@
> +testdir = @XENO_TEST_DIR@
> +noinst_LIBRARIES = libalchemytests.a
> +
> +libalchemytests_a_SOURCES = alchemytests.c
> +libalchemytests_a_CPPFLAGS = 		\
> +	@XENO_USER_CFLAGS@	\
> +	-I$(top_srcdir)		\
> +	-I$(top_srcdir)/include \
> +	-DXENO_TEST_DIR='"$(XENO_TEST_DIR)"'
> +
> +CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
> +
> +test_PROGRAMS = \
> +		alchemytests \
> +		alchemytests_alarm1		   \
> +		alchemytests_buffer1		   \
> +		alchemytests_event1		   \
> +		alchemytests_heap1		   \
> +		alchemytests_heap2		   \
> +		alchemytests_mq1		   \
> +		alchemytests_mq2		   \
> +		alchemytests_mq3		   \
> +		alchemytests_mutex1		   \
> +		alchemytests_pipe1		   \
> +		alchemytests_sem1		   \
> +		alchemytests_sem2		   \
> +		alchemytests_task1		   \
> +		alchemytests_task2		   \
> +		alchemytests_task3		   \
> +		alchemytests_task4		   \
> +		alchemytests_task5		   \
> +		alchemytests_task6		   \
> +		alchemytests_task7		   \
> +		alchemytests_task8		   \
> +		alchemytests_task9		   \
> +		alchemytests_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
> +
> +alchemytests_SOURCES = alchemytests_driver.c
> +alchemytests_CPPFLAGS =			\
> +	$(XENO_USER_CFLAGS)			\
> +	-I$(top_srcdir)/include
> +alchemytests_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_LDADD =			\
> +	../../../lib/smokey/libsmokey@CORE@.la	\
> +	@XENO_CORE_LDADD@		\
> +	@XENO_USER_LDADD@		\
> +	-lpthread -lrt
> +
> +alchemytests_alarm1_SOURCES = alarm-1.c
> +alchemytests_alarm1_CPPFLAGS = $(alchemycppflags)
> +alchemytests_alarm1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_alarm1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_event1_SOURCES = event-1.c
> +alchemytests_event1_CPPFLAGS = $(alchemycppflags)
> +alchemytests_event1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_event1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_heap1_SOURCES = heap-1.c
> +alchemytests_heap1_CPPFLAGS = $(alchemycppflags)
> +alchemytests_heap1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_heap1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_heap2_SOURCES = heap-2.c
> +alchemytests_heap2_CPPFLAGS = $(alchemycppflags)
> +alchemytests_heap2_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_heap2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_buffer1_SOURCES = buffer-1.c
> +alchemytests_buffer1_CPPFLAGS = $(alchemycppflags)
> +alchemytests_buffer1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_buffer1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_mutex1_SOURCES = mutex-1.c
> +alchemytests_mutex1_CPPFLAGS = $(alchemycppflags)
> +alchemytests_mutex1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_mutex1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_pipe1_SOURCES = pipe-1.c
> +alchemytests_pipe1_CPPFLAGS = $(alchemycppflags)
> +alchemytests_pipe1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_pipe1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_mq1_SOURCES = mq-1.c
> +alchemytests_mq1_CPPFLAGS = $(alchemycppflags)
> +alchemytests_mq1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_mq1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_mq2_SOURCES = mq-2.c
> +alchemytests_mq2_CPPFLAGS = $(alchemycppflags)
> +alchemytests_mq2_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_mq2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_mq3_SOURCES = mq-3.c
> +alchemytests_mq3_CPPFLAGS = $(alchemycppflags)
> +alchemytests_mq3_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_mq3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_sem1_SOURCES = sem-1.c
> +alchemytests_sem1_CPPFLAGS = $(alchemycppflags)
> +alchemytests_sem1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_sem1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_sem2_SOURCES = sem-2.c
> +alchemytests_sem2_CPPFLAGS = $(alchemycppflags)
> +alchemytests_sem2_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_sem2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_task1_SOURCES = task-1.c
> +alchemytests_task1_CPPFLAGS = $(alchemycppflags)
> +alchemytests_task1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_task1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_task2_SOURCES = task-2.c
> +alchemytests_task2_CPPFLAGS = $(alchemycppflags)
> +alchemytests_task2_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_task2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_task3_SOURCES = task-3.c
> +alchemytests_task3_CPPFLAGS = $(alchemycppflags)
> +alchemytests_task3_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_task3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_task4_SOURCES = task-4.c
> +alchemytests_task4_CPPFLAGS = $(alchemycppflags)
> +alchemytests_task4_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_task4_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_task5_SOURCES = task-5.c
> +alchemytests_task5_CPPFLAGS = $(alchemycppflags)
> +alchemytests_task5_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_task5_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_task6_SOURCES = task-6.c
> +alchemytests_task6_CPPFLAGS = $(alchemycppflags)
> +alchemytests_task6_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_task6_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_task7_SOURCES = task-7.c
> +alchemytests_task7_CPPFLAGS = $(alchemycppflags)
> +alchemytests_task7_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_task7_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_task8_SOURCES = task-8.c
> +alchemytests_task8_CPPFLAGS = $(alchemycppflags)
> +alchemytests_task8_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_task8_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_task9_SOURCES = task-9.c
> +alchemytests_task9_CPPFLAGS = $(alchemycppflags)
> +alchemytests_task9_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_task9_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_task10_SOURCES = task-10.c
> +alchemytests_task10_CPPFLAGS = $(alchemycppflags)
> +alchemytests_task10_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_task10_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +
> diff --git a/lib/alchemy/testsuite/alarm-1.c b/testsuite/smokey/alchemytests/alarm-1.c
> similarity index 100%
> rename from lib/alchemy/testsuite/alarm-1.c
> rename to testsuite/smokey/alchemytests/alarm-1.c
> diff --git a/testsuite/smokey/alchemytests/alchemytests.c b/testsuite/smokey/alchemytests/alchemytests.c
> new file mode 100644
> index 000000000..8dea068bc
> --- /dev/null
> +++ b/testsuite/smokey/alchemytests/alchemytests.c
> @@ -0,0 +1,55 @@
> +#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>
> +
> +#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", XENO_TEST_DIR, t->name);
> +	if (ret == -1)
> +		return -ENOMEM;
> +
> +	ret = system(tst_path);
> +	free(tst_path);
> +
> +	return ret;
> +}
> +
> +TEST(alchemytests)
> +TEST(alchemytests_alarm1)
> +TEST(alchemytests_buffer1)
> +TEST(alchemytests_event1)
> +TEST(alchemytests_heap1)
> +TEST(alchemytests_heap2)
> +TEST(alchemytests_mq1)
> +TEST(alchemytests_mq2)
> +TEST(alchemytests_mq3)
> +TEST(alchemytests_mutex1)
> +TEST(alchemytests_pipe1)
> +TEST(alchemytests_sem1)
> +TEST(alchemytests_sem2)
> +TEST(alchemytests_task1)
> +TEST(alchemytests_task2)
> +TEST(alchemytests_task3)
> +TEST(alchemytests_task4)
> +TEST(alchemytests_task5)
> +TEST(alchemytests_task6)
> +TEST(alchemytests_task7)
> +TEST(alchemytests_task8)
> +TEST(alchemytests_task9)
> +TEST(alchemytests_task10)
> +
> diff --git a/testsuite/smokey/alchemytests/alchemytests_driver.c b/testsuite/smokey/alchemytests/alchemytests_driver.c
> new file mode 100644
> index 000000000..cf9045bb5
> --- /dev/null
> +++ b/testsuite/smokey/alchemytests/alchemytests_driver.c
> @@ -0,0 +1,32 @@
> +#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>
> +
> +int main(int argc, char *const argv[])
> +{
> +	struct smokey_test *t;
> +	int ret, fails = 0;
> +
> +	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;
> +}
> diff --git a/lib/alchemy/testsuite/buffer-1.c b/testsuite/smokey/alchemytests/buffer-1.c
> similarity index 100%
> rename from lib/alchemy/testsuite/buffer-1.c
> rename to testsuite/smokey/alchemytests/buffer-1.c
> diff --git a/lib/alchemy/testsuite/event-1.c b/testsuite/smokey/alchemytests/event-1.c
> similarity index 100%
> rename from lib/alchemy/testsuite/event-1.c
> rename to testsuite/smokey/alchemytests/event-1.c
> diff --git a/lib/alchemy/testsuite/heap-1.c b/testsuite/smokey/alchemytests/heap-1.c
> similarity index 100%
> rename from lib/alchemy/testsuite/heap-1.c
> rename to testsuite/smokey/alchemytests/heap-1.c
> diff --git a/lib/alchemy/testsuite/heap-2.c b/testsuite/smokey/alchemytests/heap-2.c
> similarity index 100%
> rename from lib/alchemy/testsuite/heap-2.c
> rename to testsuite/smokey/alchemytests/heap-2.c
> diff --git a/lib/alchemy/testsuite/mq-1.c b/testsuite/smokey/alchemytests/mq-1.c
> similarity index 100%
> rename from lib/alchemy/testsuite/mq-1.c
> rename to testsuite/smokey/alchemytests/mq-1.c
> diff --git a/lib/alchemy/testsuite/mq-2.c b/testsuite/smokey/alchemytests/mq-2.c
> similarity index 100%
> rename from lib/alchemy/testsuite/mq-2.c
> rename to testsuite/smokey/alchemytests/mq-2.c
> diff --git a/lib/alchemy/testsuite/mq-3.c b/testsuite/smokey/alchemytests/mq-3.c
> similarity index 100%
> rename from lib/alchemy/testsuite/mq-3.c
> rename to testsuite/smokey/alchemytests/mq-3.c
> diff --git a/lib/alchemy/testsuite/mutex-1.c b/testsuite/smokey/alchemytests/mutex-1.c
> similarity index 100%
> rename from lib/alchemy/testsuite/mutex-1.c
> rename to testsuite/smokey/alchemytests/mutex-1.c
> diff --git a/lib/alchemy/testsuite/pipe-1.c b/testsuite/smokey/alchemytests/pipe-1.c
> similarity index 100%
> rename from lib/alchemy/testsuite/pipe-1.c
> rename to testsuite/smokey/alchemytests/pipe-1.c
> diff --git a/lib/alchemy/testsuite/sem-1.c b/testsuite/smokey/alchemytests/sem-1.c
> similarity index 100%
> rename from lib/alchemy/testsuite/sem-1.c
> rename to testsuite/smokey/alchemytests/sem-1.c
> diff --git a/lib/alchemy/testsuite/sem-2.c b/testsuite/smokey/alchemytests/sem-2.c
> similarity index 100%
> rename from lib/alchemy/testsuite/sem-2.c
> rename to testsuite/smokey/alchemytests/sem-2.c
> diff --git a/lib/alchemy/testsuite/task-1.c b/testsuite/smokey/alchemytests/task-1.c
> similarity index 100%
> rename from lib/alchemy/testsuite/task-1.c
> rename to testsuite/smokey/alchemytests/task-1.c
> diff --git a/lib/alchemy/testsuite/task-10.c b/testsuite/smokey/alchemytests/task-10.c
> similarity index 100%
> rename from lib/alchemy/testsuite/task-10.c
> rename to testsuite/smokey/alchemytests/task-10.c
> diff --git a/lib/alchemy/testsuite/task-2.c b/testsuite/smokey/alchemytests/task-2.c
> similarity index 100%
> rename from lib/alchemy/testsuite/task-2.c
> rename to testsuite/smokey/alchemytests/task-2.c
> diff --git a/lib/alchemy/testsuite/task-3.c b/testsuite/smokey/alchemytests/task-3.c
> similarity index 100%
> rename from lib/alchemy/testsuite/task-3.c
> rename to testsuite/smokey/alchemytests/task-3.c
> diff --git a/lib/alchemy/testsuite/task-4.c b/testsuite/smokey/alchemytests/task-4.c
> similarity index 100%
> rename from lib/alchemy/testsuite/task-4.c
> rename to testsuite/smokey/alchemytests/task-4.c
> diff --git a/lib/alchemy/testsuite/task-5.c b/testsuite/smokey/alchemytests/task-5.c
> similarity index 100%
> rename from lib/alchemy/testsuite/task-5.c
> rename to testsuite/smokey/alchemytests/task-5.c
> diff --git a/lib/alchemy/testsuite/task-6.c b/testsuite/smokey/alchemytests/task-6.c
> similarity index 100%
> rename from lib/alchemy/testsuite/task-6.c
> rename to testsuite/smokey/alchemytests/task-6.c
> diff --git a/lib/alchemy/testsuite/task-7.c b/testsuite/smokey/alchemytests/task-7.c
> similarity index 100%
> rename from lib/alchemy/testsuite/task-7.c
> rename to testsuite/smokey/alchemytests/task-7.c
> diff --git a/lib/alchemy/testsuite/task-8.c b/testsuite/smokey/alchemytests/task-8.c
> similarity index 100%
> rename from lib/alchemy/testsuite/task-8.c
> rename to testsuite/smokey/alchemytests/task-8.c
> diff --git a/lib/alchemy/testsuite/task-9.c b/testsuite/smokey/alchemytests/task-9.c
> similarity index 100%
> rename from lib/alchemy/testsuite/task-9.c
> rename to testsuite/smokey/alchemytests/task-9.c

Could we also get a copyright header for new files, please? At least an
SPDX-License-Identifier line.

Jan

-- 
Siemens AG, Technology
Linux Expert Center


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

* [PATCH v5 00/10] Revive alchemy, pSOS and VxWorks tests
  2023-07-20 14:51   ` [PATCH v4 00/10] " Aaron Marcher
                       ` (10 preceding siblings ...)
  2023-07-20 14:54     ` [PATCH v4 00/10] Revive alchemy, pSOS and VxWorks tests Jan Kiszka
@ 2023-07-24 13:52     ` Aaron Marcher
  2023-07-24 13:52       ` [PATCH 01/10] testsuite: Fully integrate alchemytests into smokey Aaron Marcher
                         ` (9 more replies)
  11 siblings, 10 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-07-24 13:52 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

This patch series fully integrates the currently abandoned alchemy, pSOS
and VxWorks tests into Xenomai's testsuite.
For each test, a Smokey testcase is hooked up.

Changes since v4:
- Added SPDX-License-Identifier lines

Aaron Marcher (7):
  testsuite: Fully integrate alchemytests into smokey
  testsuite: Fully integrate psostests into smokey
  testsuite: Fully integrate vwworkstests into smokey
  alchemytests: Check pipe-1 asprintf ret value
  alchemytests: Fix task-2
  alchemytests: Fix task-5 logic
  testsuite: disable broken tests

Richard Weinberger (3):
  testsuite: Remove old alchemytests Makefile
  alchemytests: Fix gcc warning in buffer-1
  alchemytests: Fix gcc warning in task-9

 configure.ac                                  |   7 +-
 lib/alchemy/testsuite/Makefile                |  70 ---------
 lib/psos/testsuite/Makefile                   |  49 ------
 lib/vxworks/testsuite/Makefile                |  43 -----
 testsuite/smokey/Makefile.am                  |  15 +-
 testsuite/smokey/alchemytests/Makefile.am     | 148 ++++++++++++++++++
 .../smokey/alchemytests}/alarm-1.c            |   1 +
 testsuite/smokey/alchemytests/alchemytests.c  |  56 +++++++
 .../smokey/alchemytests/alchemytests_driver.c |  33 ++++
 .../smokey/alchemytests}/buffer-1.c           |   3 +-
 .../smokey/alchemytests}/event-1.c            |   1 +
 .../smokey/alchemytests}/heap-1.c             |   1 +
 .../smokey/alchemytests}/heap-2.c             |   1 +
 .../smokey/alchemytests}/mq-1.c               |   1 +
 .../smokey/alchemytests}/mq-2.c               |   1 +
 .../smokey/alchemytests}/mq-3.c               |   1 +
 .../smokey/alchemytests}/mutex-1.c            |   1 +
 .../smokey/alchemytests}/pipe-1.c             |   7 +-
 .../smokey/alchemytests}/sem-1.c              |   1 +
 .../smokey/alchemytests}/sem-2.c              |   1 +
 .../smokey/alchemytests}/task-1.c             |   1 +
 .../smokey/alchemytests}/task-10.c            |   1 +
 .../smokey/alchemytests}/task-2.c             |   5 +-
 .../smokey/alchemytests}/task-3.c             |   1 +
 .../smokey/alchemytests}/task-4.c             |   1 +
 .../smokey/alchemytests}/task-5.c             |  11 +-
 .../smokey/alchemytests}/task-6.c             |   1 +
 .../smokey/alchemytests}/task-7.c             |   1 +
 .../smokey/alchemytests}/task-8.c             |   1 +
 .../smokey/alchemytests}/task-9.c             |   3 +-
 testsuite/smokey/psostests/Makefile.am        | 148 ++++++++++++++++++
 .../smokey/psostests}/mq-1.c                  |   1 +
 .../smokey/psostests}/mq-2.c                  |   1 +
 .../smokey/psostests}/mq-3.c                  |   1 +
 testsuite/smokey/psostests/psostests.c        |  69 ++++++++
 testsuite/smokey/psostests/psostests_driver.c |  34 ++++
 .../smokey/psostests}/pt-1.c                  |   1 +
 .../smokey/psostests}/rn-1.c                  |   1 +
 .../smokey/psostests}/sem-1.c                 |   1 +
 .../smokey/psostests}/sem-2.c                 |   1 +
 .../smokey/psostests}/task-1.c                |   1 +
 .../smokey/psostests}/task-2.c                |   1 +
 .../smokey/psostests}/task-3.c                |   1 +
 .../smokey/psostests}/task-4.c                |   1 +
 .../smokey/psostests}/task-5.c                |   1 +
 .../smokey/psostests}/task-6.c                |   1 +
 .../smokey/psostests}/task-7.c                |   1 +
 .../smokey/psostests}/task-8.c                |   1 +
 .../smokey/psostests}/task-9.c                |   1 +
 .../smokey/psostests}/tm-1.c                  |   1 +
 .../smokey/psostests}/tm-2.c                  |   1 +
 .../smokey/psostests}/tm-3.c                  |   1 +
 .../smokey/psostests}/tm-4.c                  |   1 +
 .../smokey/psostests}/tm-5.c                  |   1 +
 .../smokey/psostests}/tm-6.c                  |   1 +
 .../smokey/psostests}/tm-7.c                  |   1 +
 testsuite/smokey/vxworkstests/Makefile.am     |  94 +++++++++++
 .../smokey/vxworkstests}/lst-1.c              |   1 +
 .../smokey/vxworkstests}/msgQ-1.c             |   1 +
 .../smokey/vxworkstests}/msgQ-2.c             |   1 +
 .../smokey/vxworkstests}/msgQ-3.c             |   1 +
 .../smokey/vxworkstests}/rng-1.c              |   1 +
 .../smokey/vxworkstests}/sem-1.c              |   1 +
 .../smokey/vxworkstests}/sem-2.c              |   1 +
 .../smokey/vxworkstests}/sem-3.c              |   1 +
 .../smokey/vxworkstests}/sem-4.c              |   1 +
 .../smokey/vxworkstests}/task-1.c             |   1 +
 .../smokey/vxworkstests}/task-2.c             |   1 +
 testsuite/smokey/vxworkstests/vxworkstests.c  |  46 ++++++
 .../smokey/vxworkstests/vxworkstests_driver.c |  33 ++++
 .../smokey/vxworkstests}/wd-1.c               |   1 +
 71 files changed, 749 insertions(+), 177 deletions(-)
 delete mode 100644 lib/alchemy/testsuite/Makefile
 delete mode 100644 lib/psos/testsuite/Makefile
 delete mode 100644 lib/vxworks/testsuite/Makefile
 create mode 100644 testsuite/smokey/alchemytests/Makefile.am
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/alarm-1.c (97%)
 create mode 100644 testsuite/smokey/alchemytests/alchemytests.c
 create mode 100644 testsuite/smokey/alchemytests/alchemytests_driver.c
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/buffer-1.c (97%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/event-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/heap-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/heap-2.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-2.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-3.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mutex-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/pipe-1.c (96%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/sem-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/sem-2.c (97%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-1.c (94%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-10.c (97%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-2.c (95%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-3.c (97%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-4.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-5.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-6.c (97%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-7.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-8.c (97%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-9.c (94%)
 create mode 100644 testsuite/smokey/psostests/Makefile.am
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/mq-1.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/mq-2.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/mq-3.c (98%)
 create mode 100644 testsuite/smokey/psostests/psostests.c
 create mode 100644 testsuite/smokey/psostests/psostests_driver.c
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/pt-1.c (96%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/rn-1.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/sem-1.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/sem-2.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-1.c (95%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-2.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-3.c (96%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-4.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-5.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-6.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-7.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-8.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-9.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-1.c (95%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-2.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-3.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-4.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-5.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-6.c (95%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-7.c (95%)
 create mode 100644 testsuite/smokey/vxworkstests/Makefile.am
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/lst-1.c (99%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-1.c (98%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-2.c (98%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-3.c (98%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/rng-1.c (99%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-1.c (98%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-2.c (98%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-3.c (97%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-4.c (98%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/task-1.c (96%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/task-2.c (98%)
 create mode 100644 testsuite/smokey/vxworkstests/vxworkstests.c
 create mode 100644 testsuite/smokey/vxworkstests/vxworkstests_driver.c
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/wd-1.c (97%)

-- 
2.35.3


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

* [PATCH 01/10] testsuite: Fully integrate alchemytests into smokey
  2023-07-24 13:52     ` [PATCH v5 " Aaron Marcher
@ 2023-07-24 13:52       ` Aaron Marcher
  2023-08-10  7:07         ` Florian Bezdeka
  2023-07-24 13:52       ` [PATCH 02/10] testsuite: Fully integrate psostests " Aaron Marcher
                         ` (8 subsequent siblings)
  9 siblings, 1 reply; 112+ messages in thread
From: Aaron Marcher @ 2023-07-24 13:52 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

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

Build them using Xenomai's build system and hook them up using
Smokey. Every test binary has it's own respective testcase in the
testsuite.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 configure.ac                                  |   7 +-
 testsuite/Makefile.am                         |   8 +-
 testsuite/smokey/Makefile.am                  |   9 +-
 testsuite/smokey/alchemytests/Makefile.am     | 148 ++++++++++++++++++
 .../smokey/alchemytests}/alarm-1.c            |   1 +
 testsuite/smokey/alchemytests/alchemytests.c  |  56 +++++++
 .../smokey/alchemytests/alchemytests_driver.c |  33 ++++
 .../smokey/alchemytests}/buffer-1.c           |   1 +
 .../smokey/alchemytests}/event-1.c            |   1 +
 .../smokey/alchemytests}/heap-1.c             |   1 +
 .../smokey/alchemytests}/heap-2.c             |   1 +
 .../smokey/alchemytests}/mq-1.c               |   1 +
 .../smokey/alchemytests}/mq-2.c               |   1 +
 .../smokey/alchemytests}/mq-3.c               |   1 +
 .../smokey/alchemytests}/mutex-1.c            |   1 +
 .../smokey/alchemytests}/pipe-1.c             |   1 +
 .../smokey/alchemytests}/sem-1.c              |   1 +
 .../smokey/alchemytests}/sem-2.c              |   1 +
 .../smokey/alchemytests}/task-1.c             |   1 +
 .../smokey/alchemytests}/task-10.c            |   1 +
 .../smokey/alchemytests}/task-2.c             |   1 +
 .../smokey/alchemytests}/task-3.c             |   1 +
 .../smokey/alchemytests}/task-4.c             |   1 +
 .../smokey/alchemytests}/task-5.c             |   1 +
 .../smokey/alchemytests}/task-6.c             |   1 +
 .../smokey/alchemytests}/task-7.c             |   1 +
 .../smokey/alchemytests}/task-8.c             |   1 +
 .../smokey/alchemytests}/task-9.c             |   1 +
 28 files changed, 276 insertions(+), 7 deletions(-)
 create mode 100644 testsuite/smokey/alchemytests/Makefile.am
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/alarm-1.c (97%)
 create mode 100644 testsuite/smokey/alchemytests/alchemytests.c
 create mode 100644 testsuite/smokey/alchemytests/alchemytests_driver.c
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/buffer-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/event-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/heap-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/heap-2.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-2.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-3.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mutex-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/pipe-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/sem-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/sem-2.c (97%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-1.c (94%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-10.c (97%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-2.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-3.c (97%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-4.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-5.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-6.c (97%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-7.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-8.c (97%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-9.c (97%)

diff --git a/configure.ac b/configure.ac
index 3ce34048e..fe59333ed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1041,10 +1041,13 @@ AC_CONFIG_FILES([ \
 	testsuite/smokey/cpu-affinity/Makefile \
 	testsuite/smokey/gdb/Makefile \
 	testsuite/smokey/y2038/Makefile \
-	testsuite/smokey/can/Makefile
-	testsuite/smokey/x86io/Makefile
+	testsuite/smokey/can/Makefile \
+	testsuite/smokey/x86io/Makefile \
+	testsuite/smokey/alchemytests/Makefile \
 	testsuite/clocktest/Makefile \
 	testsuite/xeno-test/Makefile \
+	testsuite/psostests/Makefile \
+	testsuite/vxworkstests/Makefile \
 	utils/Makefile \
 	utils/hdb/Makefile \
 	utils/can/Makefile \
diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
index 4932f6d33..1be7eaba4 100644
--- a/testsuite/Makefile.am
+++ b/testsuite/Makefile.am
@@ -7,7 +7,9 @@ SUBDIRS += 		\
 	gpiotest	\
 	spitest		\
 	switchtest	\
-	xeno-test
+	xeno-test	\
+	psostests	\
+	vxworkstests
 endif
 
 DIST_SUBDIRS =		\
@@ -18,4 +20,6 @@ DIST_SUBDIRS =		\
 	smokey		\
 	spitest		\
 	switchtest	\
-	xeno-test
+	xeno-test	\
+	psostests \
+	vxworkstests
diff --git a/testsuite/smokey/Makefile.am b/testsuite/smokey/Makefile.am
index 79dc61e9f..633a87387 100644
--- a/testsuite/smokey/Makefile.am
+++ b/testsuite/smokey/Makefile.am
@@ -40,12 +40,14 @@ COBALT_SUBDIRS = 	\
 	tsc		\
 	vdso-access 	\
 	xddp		\
-	y2038
+	y2038 \
+	alchemytests
 
 MERCURY_SUBDIRS =	\
 	memory-heapmem	\
 	memory-tlsf	\
-	memcheck
+	memcheck \
+	alchemytests
 
 DIST_SUBDIRS = 		\
 	arith 		\
@@ -80,7 +82,8 @@ DIST_SUBDIRS = 		\
 	tsc		\
 	vdso-access 	\
 	xddp		\
-	y2038
+	y2038 \
+	alchemytests
 
 if XENO_X86
 DIST_SUBDIRS += x86io
diff --git a/testsuite/smokey/alchemytests/Makefile.am b/testsuite/smokey/alchemytests/Makefile.am
new file mode 100644
index 000000000..9da3a98f3
--- /dev/null
+++ b/testsuite/smokey/alchemytests/Makefile.am
@@ -0,0 +1,148 @@
+testdir = @XENO_TEST_DIR@
+noinst_LIBRARIES = libalchemytests.a
+
+libalchemytests_a_SOURCES = alchemytests.c
+libalchemytests_a_CPPFLAGS = 		\
+	@XENO_USER_CFLAGS@	\
+	-I$(top_srcdir)		\
+	-I$(top_srcdir)/include \
+	-DXENO_TEST_DIR='"$(XENO_TEST_DIR)"'
+
+CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
+
+test_PROGRAMS = \
+		alchemytests \
+		alchemytests_alarm1		   \
+		alchemytests_buffer1		   \
+		alchemytests_event1		   \
+		alchemytests_heap1		   \
+		alchemytests_heap2		   \
+		alchemytests_mq1		   \
+		alchemytests_mq2		   \
+		alchemytests_mq3		   \
+		alchemytests_mutex1		   \
+		alchemytests_pipe1		   \
+		alchemytests_sem1		   \
+		alchemytests_sem2		   \
+		alchemytests_task1		   \
+		alchemytests_task2		   \
+		alchemytests_task3		   \
+		alchemytests_task4		   \
+		alchemytests_task5		   \
+		alchemytests_task6		   \
+		alchemytests_task7		   \
+		alchemytests_task8		   \
+		alchemytests_task9		   \
+		alchemytests_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
+
+alchemytests_SOURCES = alchemytests_driver.c
+alchemytests_CPPFLAGS =			\
+	$(XENO_USER_CFLAGS)			\
+	-I$(top_srcdir)/include
+alchemytests_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_LDADD =			\
+	../../../lib/smokey/libsmokey@CORE@.la	\
+	@XENO_CORE_LDADD@		\
+	@XENO_USER_LDADD@		\
+	-lpthread -lrt
+
+alchemytests_alarm1_SOURCES = alarm-1.c
+alchemytests_alarm1_CPPFLAGS = $(alchemycppflags)
+alchemytests_alarm1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_alarm1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_event1_SOURCES = event-1.c
+alchemytests_event1_CPPFLAGS = $(alchemycppflags)
+alchemytests_event1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_event1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_heap1_SOURCES = heap-1.c
+alchemytests_heap1_CPPFLAGS = $(alchemycppflags)
+alchemytests_heap1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_heap1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_heap2_SOURCES = heap-2.c
+alchemytests_heap2_CPPFLAGS = $(alchemycppflags)
+alchemytests_heap2_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_heap2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_buffer1_SOURCES = buffer-1.c
+alchemytests_buffer1_CPPFLAGS = $(alchemycppflags)
+alchemytests_buffer1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_buffer1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_mutex1_SOURCES = mutex-1.c
+alchemytests_mutex1_CPPFLAGS = $(alchemycppflags)
+alchemytests_mutex1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_mutex1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_pipe1_SOURCES = pipe-1.c
+alchemytests_pipe1_CPPFLAGS = $(alchemycppflags)
+alchemytests_pipe1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_pipe1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_mq1_SOURCES = mq-1.c
+alchemytests_mq1_CPPFLAGS = $(alchemycppflags)
+alchemytests_mq1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_mq1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_mq2_SOURCES = mq-2.c
+alchemytests_mq2_CPPFLAGS = $(alchemycppflags)
+alchemytests_mq2_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_mq2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_mq3_SOURCES = mq-3.c
+alchemytests_mq3_CPPFLAGS = $(alchemycppflags)
+alchemytests_mq3_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_mq3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_sem1_SOURCES = sem-1.c
+alchemytests_sem1_CPPFLAGS = $(alchemycppflags)
+alchemytests_sem1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_sem1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_sem2_SOURCES = sem-2.c
+alchemytests_sem2_CPPFLAGS = $(alchemycppflags)
+alchemytests_sem2_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_sem2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task1_SOURCES = task-1.c
+alchemytests_task1_CPPFLAGS = $(alchemycppflags)
+alchemytests_task1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_task1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task2_SOURCES = task-2.c
+alchemytests_task2_CPPFLAGS = $(alchemycppflags)
+alchemytests_task2_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_task2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task3_SOURCES = task-3.c
+alchemytests_task3_CPPFLAGS = $(alchemycppflags)
+alchemytests_task3_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_task3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task4_SOURCES = task-4.c
+alchemytests_task4_CPPFLAGS = $(alchemycppflags)
+alchemytests_task4_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_task4_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task5_SOURCES = task-5.c
+alchemytests_task5_CPPFLAGS = $(alchemycppflags)
+alchemytests_task5_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_task5_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task6_SOURCES = task-6.c
+alchemytests_task6_CPPFLAGS = $(alchemycppflags)
+alchemytests_task6_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_task6_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task7_SOURCES = task-7.c
+alchemytests_task7_CPPFLAGS = $(alchemycppflags)
+alchemytests_task7_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_task7_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task8_SOURCES = task-8.c
+alchemytests_task8_CPPFLAGS = $(alchemycppflags)
+alchemytests_task8_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_task8_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task9_SOURCES = task-9.c
+alchemytests_task9_CPPFLAGS = $(alchemycppflags)
+alchemytests_task9_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_task9_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task10_SOURCES = task-10.c
+alchemytests_task10_CPPFLAGS = $(alchemycppflags)
+alchemytests_task10_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_task10_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
diff --git a/lib/alchemy/testsuite/alarm-1.c b/testsuite/smokey/alchemytests/alarm-1.c
similarity index 97%
rename from lib/alchemy/testsuite/alarm-1.c
rename to testsuite/smokey/alchemytests/alarm-1.c
index 29b3bbe74..eb6c5310a 100644
--- a/lib/alchemy/testsuite/alarm-1.c
+++ b/testsuite/smokey/alchemytests/alarm-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/testsuite/smokey/alchemytests/alchemytests.c b/testsuite/smokey/alchemytests/alchemytests.c
new file mode 100644
index 000000000..ee8d1703b
--- /dev/null
+++ b/testsuite/smokey/alchemytests/alchemytests.c
@@ -0,0 +1,56 @@
+// SPDX-License-Identifier: GPL-2.0
+#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>
+
+#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", XENO_TEST_DIR, t->name);
+	if (ret == -1)
+		return -ENOMEM;
+
+	ret = system(tst_path);
+	free(tst_path);
+
+	return ret;
+}
+
+TEST(alchemytests)
+TEST(alchemytests_alarm1)
+TEST(alchemytests_buffer1)
+TEST(alchemytests_event1)
+TEST(alchemytests_heap1)
+TEST(alchemytests_heap2)
+TEST(alchemytests_mq1)
+TEST(alchemytests_mq2)
+TEST(alchemytests_mq3)
+TEST(alchemytests_mutex1)
+TEST(alchemytests_pipe1)
+TEST(alchemytests_sem1)
+TEST(alchemytests_sem2)
+TEST(alchemytests_task1)
+TEST(alchemytests_task2)
+TEST(alchemytests_task3)
+TEST(alchemytests_task4)
+TEST(alchemytests_task5)
+TEST(alchemytests_task6)
+TEST(alchemytests_task7)
+TEST(alchemytests_task8)
+TEST(alchemytests_task9)
+TEST(alchemytests_task10)
+
diff --git a/testsuite/smokey/alchemytests/alchemytests_driver.c b/testsuite/smokey/alchemytests/alchemytests_driver.c
new file mode 100644
index 000000000..7cacbb399
--- /dev/null
+++ b/testsuite/smokey/alchemytests/alchemytests_driver.c
@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: GPL-2.0
+#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>
+
+int main(int argc, char *const argv[])
+{
+	struct smokey_test *t;
+	int ret, fails = 0;
+
+	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;
+}
diff --git a/lib/alchemy/testsuite/buffer-1.c b/testsuite/smokey/alchemytests/buffer-1.c
similarity index 98%
rename from lib/alchemy/testsuite/buffer-1.c
rename to testsuite/smokey/alchemytests/buffer-1.c
index d6d1d9ad7..fdcb5e8d7 100644
--- a/lib/alchemy/testsuite/buffer-1.c
+++ b/testsuite/smokey/alchemytests/buffer-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <memory.h>
diff --git a/lib/alchemy/testsuite/event-1.c b/testsuite/smokey/alchemytests/event-1.c
similarity index 98%
rename from lib/alchemy/testsuite/event-1.c
rename to testsuite/smokey/alchemytests/event-1.c
index 0893df36d..9ce679c71 100644
--- a/lib/alchemy/testsuite/event-1.c
+++ b/testsuite/smokey/alchemytests/event-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/heap-1.c b/testsuite/smokey/alchemytests/heap-1.c
similarity index 98%
rename from lib/alchemy/testsuite/heap-1.c
rename to testsuite/smokey/alchemytests/heap-1.c
index 48bc4a56e..f0904439f 100644
--- a/lib/alchemy/testsuite/heap-1.c
+++ b/testsuite/smokey/alchemytests/heap-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/heap-2.c b/testsuite/smokey/alchemytests/heap-2.c
similarity index 98%
rename from lib/alchemy/testsuite/heap-2.c
rename to testsuite/smokey/alchemytests/heap-2.c
index ad67afb2f..1f80db80c 100644
--- a/lib/alchemy/testsuite/heap-2.c
+++ b/testsuite/smokey/alchemytests/heap-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/mq-1.c b/testsuite/smokey/alchemytests/mq-1.c
similarity index 98%
rename from lib/alchemy/testsuite/mq-1.c
rename to testsuite/smokey/alchemytests/mq-1.c
index ac9801e72..952ff6448 100644
--- a/lib/alchemy/testsuite/mq-1.c
+++ b/testsuite/smokey/alchemytests/mq-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/mq-2.c b/testsuite/smokey/alchemytests/mq-2.c
similarity index 98%
rename from lib/alchemy/testsuite/mq-2.c
rename to testsuite/smokey/alchemytests/mq-2.c
index 9fea471b7..acc6ec051 100644
--- a/lib/alchemy/testsuite/mq-2.c
+++ b/testsuite/smokey/alchemytests/mq-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/mq-3.c b/testsuite/smokey/alchemytests/mq-3.c
similarity index 98%
rename from lib/alchemy/testsuite/mq-3.c
rename to testsuite/smokey/alchemytests/mq-3.c
index 7fcae020a..cb4c77d43 100644
--- a/lib/alchemy/testsuite/mq-3.c
+++ b/testsuite/smokey/alchemytests/mq-3.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/mutex-1.c b/testsuite/smokey/alchemytests/mutex-1.c
similarity index 98%
rename from lib/alchemy/testsuite/mutex-1.c
rename to testsuite/smokey/alchemytests/mutex-1.c
index ef58a2c86..f08665254 100644
--- a/lib/alchemy/testsuite/mutex-1.c
+++ b/testsuite/smokey/alchemytests/mutex-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/pipe-1.c b/testsuite/smokey/alchemytests/pipe-1.c
similarity index 98%
rename from lib/alchemy/testsuite/pipe-1.c
rename to testsuite/smokey/alchemytests/pipe-1.c
index 4202be2ba..4011f9c8a 100644
--- a/lib/alchemy/testsuite/pipe-1.c
+++ b/testsuite/smokey/alchemytests/pipe-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <fcntl.h>
diff --git a/lib/alchemy/testsuite/sem-1.c b/testsuite/smokey/alchemytests/sem-1.c
similarity index 98%
rename from lib/alchemy/testsuite/sem-1.c
rename to testsuite/smokey/alchemytests/sem-1.c
index 3e526eddf..080bcea9a 100644
--- a/lib/alchemy/testsuite/sem-1.c
+++ b/testsuite/smokey/alchemytests/sem-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/sem-2.c b/testsuite/smokey/alchemytests/sem-2.c
similarity index 97%
rename from lib/alchemy/testsuite/sem-2.c
rename to testsuite/smokey/alchemytests/sem-2.c
index c01f6a431..74cce2b7d 100644
--- a/lib/alchemy/testsuite/sem-2.c
+++ b/testsuite/smokey/alchemytests/sem-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/task-1.c b/testsuite/smokey/alchemytests/task-1.c
similarity index 94%
rename from lib/alchemy/testsuite/task-1.c
rename to testsuite/smokey/alchemytests/task-1.c
index 34a6c22fd..d3d9a6f7f 100644
--- a/lib/alchemy/testsuite/task-1.c
+++ b/testsuite/smokey/alchemytests/task-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/task-10.c b/testsuite/smokey/alchemytests/task-10.c
similarity index 97%
rename from lib/alchemy/testsuite/task-10.c
rename to testsuite/smokey/alchemytests/task-10.c
index 58f4cb035..c4a29ae76 100644
--- a/lib/alchemy/testsuite/task-10.c
+++ b/testsuite/smokey/alchemytests/task-10.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/task-2.c b/testsuite/smokey/alchemytests/task-2.c
similarity index 98%
rename from lib/alchemy/testsuite/task-2.c
rename to testsuite/smokey/alchemytests/task-2.c
index e751ddd34..592f2ed20 100644
--- a/lib/alchemy/testsuite/task-2.c
+++ b/testsuite/smokey/alchemytests/task-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/task-3.c b/testsuite/smokey/alchemytests/task-3.c
similarity index 97%
rename from lib/alchemy/testsuite/task-3.c
rename to testsuite/smokey/alchemytests/task-3.c
index 06f235af9..eb24935a4 100644
--- a/lib/alchemy/testsuite/task-3.c
+++ b/testsuite/smokey/alchemytests/task-3.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/task-4.c b/testsuite/smokey/alchemytests/task-4.c
similarity index 98%
rename from lib/alchemy/testsuite/task-4.c
rename to testsuite/smokey/alchemytests/task-4.c
index eba7fbb86..90e0236be 100644
--- a/lib/alchemy/testsuite/task-4.c
+++ b/testsuite/smokey/alchemytests/task-4.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/task-5.c b/testsuite/smokey/alchemytests/task-5.c
similarity index 98%
rename from lib/alchemy/testsuite/task-5.c
rename to testsuite/smokey/alchemytests/task-5.c
index 3c0fa427c..b9075945d 100644
--- a/lib/alchemy/testsuite/task-5.c
+++ b/testsuite/smokey/alchemytests/task-5.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/task-6.c b/testsuite/smokey/alchemytests/task-6.c
similarity index 97%
rename from lib/alchemy/testsuite/task-6.c
rename to testsuite/smokey/alchemytests/task-6.c
index 7c88fde9c..fa58d0fdc 100644
--- a/lib/alchemy/testsuite/task-6.c
+++ b/testsuite/smokey/alchemytests/task-6.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/task-7.c b/testsuite/smokey/alchemytests/task-7.c
similarity index 98%
rename from lib/alchemy/testsuite/task-7.c
rename to testsuite/smokey/alchemytests/task-7.c
index 1350bb39c..d118abf42 100644
--- a/lib/alchemy/testsuite/task-7.c
+++ b/testsuite/smokey/alchemytests/task-7.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/task-8.c b/testsuite/smokey/alchemytests/task-8.c
similarity index 97%
rename from lib/alchemy/testsuite/task-8.c
rename to testsuite/smokey/alchemytests/task-8.c
index bb6dfff06..959b3d3c4 100644
--- a/lib/alchemy/testsuite/task-8.c
+++ b/testsuite/smokey/alchemytests/task-8.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/task-9.c b/testsuite/smokey/alchemytests/task-9.c
similarity index 97%
rename from lib/alchemy/testsuite/task-9.c
rename to testsuite/smokey/alchemytests/task-9.c
index e358154c5..56cc7bfeb 100644
--- a/lib/alchemy/testsuite/task-9.c
+++ b/testsuite/smokey/alchemytests/task-9.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <signal.h>
-- 
2.35.3


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

* [PATCH 02/10] testsuite: Fully integrate psostests into smokey
  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-07-24 13:52       ` Aaron Marcher
  2023-07-24 13:52       ` [PATCH 03/10] testsuite: Fully integrate vwworkstests " Aaron Marcher
                         ` (7 subsequent siblings)
  9 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-07-24 13:52 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

Just like for alchemytests, integrate them into our testsuite.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 configure.ac                                  |   2 +-
 lib/psos/testsuite/Makefile                   |  49 ------
 testsuite/Makefile.am                         |   2 -
 testsuite/smokey/Makefile.am                  |   9 +-
 testsuite/smokey/psostests/Makefile.am        | 148 ++++++++++++++++++
 .../smokey/psostests}/mq-1.c                  |   1 +
 .../smokey/psostests}/mq-2.c                  |   1 +
 .../smokey/psostests}/mq-3.c                  |   1 +
 testsuite/smokey/psostests/psostests.c        |  57 +++++++
 testsuite/smokey/psostests/psostests_driver.c |  34 ++++
 .../smokey/psostests}/pt-1.c                  |   1 +
 .../smokey/psostests}/rn-1.c                  |   1 +
 .../smokey/psostests}/sem-1.c                 |   1 +
 .../smokey/psostests}/sem-2.c                 |   1 +
 .../smokey/psostests}/task-1.c                |   1 +
 .../smokey/psostests}/task-2.c                |   1 +
 .../smokey/psostests}/task-3.c                |   1 +
 .../smokey/psostests}/task-4.c                |   1 +
 .../smokey/psostests}/task-5.c                |   1 +
 .../smokey/psostests}/task-6.c                |   1 +
 .../smokey/psostests}/task-7.c                |   1 +
 .../smokey/psostests}/task-8.c                |   1 +
 .../smokey/psostests}/task-9.c                |   1 +
 .../smokey/psostests}/tm-1.c                  |   1 +
 .../smokey/psostests}/tm-2.c                  |   1 +
 .../smokey/psostests}/tm-3.c                  |   1 +
 .../smokey/psostests}/tm-4.c                  |   1 +
 .../smokey/psostests}/tm-5.c                  |   1 +
 .../smokey/psostests}/tm-6.c                  |   1 +
 .../smokey/psostests}/tm-7.c                  |   1 +
 30 files changed, 269 insertions(+), 55 deletions(-)
 delete mode 100644 lib/psos/testsuite/Makefile
 create mode 100644 testsuite/smokey/psostests/Makefile.am
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/mq-1.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/mq-2.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/mq-3.c (98%)
 create mode 100644 testsuite/smokey/psostests/psostests.c
 create mode 100644 testsuite/smokey/psostests/psostests_driver.c
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/pt-1.c (96%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/rn-1.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/sem-1.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/sem-2.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-1.c (95%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-2.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-3.c (96%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-4.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-5.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-6.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-7.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-8.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-9.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-1.c (95%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-2.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-3.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-4.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-5.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-6.c (95%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-7.c (95%)

diff --git a/configure.ac b/configure.ac
index fe59333ed..9db5438eb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1044,9 +1044,9 @@ AC_CONFIG_FILES([ \
 	testsuite/smokey/can/Makefile \
 	testsuite/smokey/x86io/Makefile \
 	testsuite/smokey/alchemytests/Makefile \
+	testsuite/smokey/psostests/Makefile \
 	testsuite/clocktest/Makefile \
 	testsuite/xeno-test/Makefile \
-	testsuite/psostests/Makefile \
 	testsuite/vxworkstests/Makefile \
 	utils/Makefile \
 	utils/hdb/Makefile \
diff --git a/lib/psos/testsuite/Makefile b/lib/psos/testsuite/Makefile
deleted file mode 100644
index 3330a617c..000000000
--- a/lib/psos/testsuite/Makefile
+++ /dev/null
@@ -1,49 +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)
-
-ifeq ($(prefix),)
-$(error Please add <xenomai-install-path>/bin to your PATH variable or specify DESTDIR)
-endif
-
-TESTS := \
-	task-1 task-2 task-3 task-4 task-5 task-6 task-7 task-8 task-9 \
-	tm-1 tm-2 tm-3 tm-4 tm-5 tm-6 tm-7 \
-	mq-1 mq-2 mq-3 \
-	sem-1 sem-2 \
-	pt-1 \
-	rn-1
-
-CFLAGS := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --skin=psos --cflags) -g
-LDFLAGS := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --skin=psos --ldflags)
-CC = $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --cc)
-
-all: $(TESTS)
-
-%: %.c
-	$(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
-
-install: all
-	install -d $(prefix)/testsuite/psos
-	install -t $(prefix)/testsuite/psos $(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
diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
index 1be7eaba4..bb94f6ba6 100644
--- a/testsuite/Makefile.am
+++ b/testsuite/Makefile.am
@@ -8,7 +8,6 @@ SUBDIRS += 		\
 	spitest		\
 	switchtest	\
 	xeno-test	\
-	psostests	\
 	vxworkstests
 endif
 
@@ -21,5 +20,4 @@ DIST_SUBDIRS =		\
 	spitest		\
 	switchtest	\
 	xeno-test	\
-	psostests \
 	vxworkstests
diff --git a/testsuite/smokey/Makefile.am b/testsuite/smokey/Makefile.am
index 633a87387..457e22a84 100644
--- a/testsuite/smokey/Makefile.am
+++ b/testsuite/smokey/Makefile.am
@@ -41,13 +41,15 @@ COBALT_SUBDIRS = 	\
 	vdso-access 	\
 	xddp		\
 	y2038 \
-	alchemytests
+	alchemytests \
+	psostests
 
 MERCURY_SUBDIRS =	\
 	memory-heapmem	\
 	memory-tlsf	\
 	memcheck \
-	alchemytests
+	alchemytests \
+	psostests
 
 DIST_SUBDIRS = 		\
 	arith 		\
@@ -83,7 +85,8 @@ DIST_SUBDIRS = 		\
 	vdso-access 	\
 	xddp		\
 	y2038 \
-	alchemytests
+	alchemytests \
+	psostests
 
 if XENO_X86
 DIST_SUBDIRS += x86io
diff --git a/testsuite/smokey/psostests/Makefile.am b/testsuite/smokey/psostests/Makefile.am
new file mode 100644
index 000000000..bd6abc74c
--- /dev/null
+++ b/testsuite/smokey/psostests/Makefile.am
@@ -0,0 +1,148 @@
+testdir = @XENO_TEST_DIR@
+noinst_LIBRARIES = libpsostests.a
+
+libpsostests_a_SOURCES = psostests.c
+libpsostests_a_CPPFLAGS = 		\
+	@XENO_USER_CFLAGS@	\
+	-I$(top_srcdir)		\
+	-I$(top_srcdir)/include \
+	-DXENO_TEST_DIR='"$(XENO_TEST_DIR)"'
+
+CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
+
+test_PROGRAMS = \
+		psostests       \
+		psostests_mq1	\
+		psostests_mq2	\
+		psostests_mq3	\
+		psostests_pt1	\
+		psostests_rn1	\
+		psostests_sem1	\
+		psostests_sem2	\
+		psostests_tm1	\
+		psostests_tm2	\
+		psostests_tm3	\
+		psostests_tm4	\
+		psostests_tm5	\
+		psostests_tm6	\
+		psostests_tm7	\
+		psostests_task1	\
+		psostests_task2	\
+		psostests_task3	\
+		psostests_task4	\
+		psostests_task5	\
+		psostests_task6	\
+		psostests_task7	\
+		psostests_task8	\
+		psostests_task9
+
+psoscppflags = 				\
+	$(XENO_USER_CFLAGS)		\
+	-I$(top_srcdir)		\
+	-I$(top_srcdir)/include
+
+psosldadd = 					\
+	../../../lib/psos/libpsos@CORE@.la		\
+	../../../lib/copperplate/libcopperplate@CORE@.la	\
+	@XENO_CORE_LDADD@ 			\
+	@XENO_USER_LDADD@			\
+	-lpthread -lrt -lm
+
+psostests_SOURCES = psostests_driver.c
+psostests_CPPFLAGS = $(psoscppflags)
+psostests_LDADD = ../../../lib/smokey/libsmokey@CORE@.la -lpthread -lrt
+psostests_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+psostests_mq1_SOURCES = mq-1.c
+psostests_mq1_CPPFLAGS = $(psoscppflags)
+psostests_mq1_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_mq1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_mq2_SOURCES = mq-2.c
+psostests_mq2_CPPFLAGS = $(psoscppflags)
+psostests_mq2_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_mq2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_mq3_SOURCES = mq-3.c
+psostests_mq3_CPPFLAGS = $(psoscppflags)
+psostests_mq3_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_mq3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_pt1_SOURCES = pt-1.c
+psostests_pt1_CPPFLAGS = $(psoscppflags)
+psostests_pt1_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_pt1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_rn1_SOURCES = rn-1.c
+psostests_rn1_CPPFLAGS = $(psoscppflags)
+psostests_rn1_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_rn1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_sem1_SOURCES = sem-1.c
+psostests_sem1_CPPFLAGS = $(psoscppflags)
+psostests_sem1_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_sem1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_sem2_SOURCES = sem-2.c
+psostests_sem2_CPPFLAGS = $(psoscppflags)
+psostests_sem2_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_sem2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_tm1_SOURCES = tm-1.c
+psostests_tm1_CPPFLAGS = $(psoscppflags)
+psostests_tm1_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_tm1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_tm2_SOURCES = tm-2.c
+psostests_tm2_CPPFLAGS = $(psoscppflags)
+psostests_tm2_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_tm2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_tm3_SOURCES = tm-3.c
+psostests_tm3_CPPFLAGS = $(psoscppflags)
+psostests_tm3_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_tm3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_tm4_SOURCES = tm-4.c
+psostests_tm4_CPPFLAGS = $(psoscppflags)
+psostests_tm4_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_tm4_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_tm5_SOURCES = tm-5.c
+psostests_tm5_CPPFLAGS = $(psoscppflags)
+psostests_tm5_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_tm5_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_tm6_SOURCES = tm-6.c
+psostests_tm6_CPPFLAGS = $(psoscppflags)
+psostests_tm6_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_tm6_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_tm7_SOURCES = tm-7.c
+psostests_tm7_CPPFLAGS = $(psoscppflags)
+psostests_tm7_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_tm7_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task1_SOURCES = task-1.c
+psostests_task1_CPPFLAGS = $(psoscppflags)
+psostests_task1_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_task1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task2_SOURCES = task-2.c
+psostests_task2_CPPFLAGS = $(psoscppflags)
+psostests_task2_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_task2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task3_SOURCES = task-3.c
+psostests_task3_CPPFLAGS = $(psoscppflags)
+psostests_task3_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_task3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task4_SOURCES = task-4.c
+psostests_task4_CPPFLAGS = $(psoscppflags)
+psostests_task4_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_task4_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task5_SOURCES = task-5.c
+psostests_task5_CPPFLAGS = $(psoscppflags)
+psostests_task5_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_task5_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task6_SOURCES = task-6.c
+psostests_task6_CPPFLAGS = $(psoscppflags)
+psostests_task6_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_task6_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task7_SOURCES = task-7.c
+psostests_task7_CPPFLAGS = $(psoscppflags)
+psostests_task7_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_task7_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task8_SOURCES = task-8.c
+psostests_task8_CPPFLAGS = $(psoscppflags)
+psostests_task8_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_task8_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task9_SOURCES = task-9.c
+psostests_task9_CPPFLAGS = $(psoscppflags)
+psostests_task9_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_task9_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
diff --git a/lib/psos/testsuite/mq-1.c b/testsuite/smokey/psostests/mq-1.c
similarity index 97%
rename from lib/psos/testsuite/mq-1.c
rename to testsuite/smokey/psostests/mq-1.c
index 00f424898..83a24028e 100644
--- a/lib/psos/testsuite/mq-1.c
+++ b/testsuite/smokey/psostests/mq-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/mq-2.c b/testsuite/smokey/psostests/mq-2.c
similarity index 98%
rename from lib/psos/testsuite/mq-2.c
rename to testsuite/smokey/psostests/mq-2.c
index 48b4e611c..8af8b42d6 100644
--- a/lib/psos/testsuite/mq-2.c
+++ b/testsuite/smokey/psostests/mq-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/mq-3.c b/testsuite/smokey/psostests/mq-3.c
similarity index 98%
rename from lib/psos/testsuite/mq-3.c
rename to testsuite/smokey/psostests/mq-3.c
index 942b1a325..1171a7054 100644
--- a/lib/psos/testsuite/mq-3.c
+++ b/testsuite/smokey/psostests/mq-3.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/testsuite/smokey/psostests/psostests.c b/testsuite/smokey/psostests/psostests.c
new file mode 100644
index 000000000..254a1515c
--- /dev/null
+++ b/testsuite/smokey/psostests/psostests.c
@@ -0,0 +1,57 @@
+// SPDX-License-Identifier: GPL-2.0
+#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>
+
+#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", XENO_TEST_DIR, t->name);
+	if (ret == -1)
+		return -ENOMEM;
+
+	ret = system(tst_path);
+	free(tst_path);
+
+	return ret;
+}
+
+TEST(psostests)
+TEST(psostests_mq1)
+TEST(psostests_mq2)
+TEST(psostests_mq3)
+TEST(psostests_pt1)
+TEST(psostests_rn1)
+TEST(psostests_sem1)
+TEST(psostests_sem2)
+TEST(psostests_task1)
+TEST(psostests_task2)
+TEST(psostests_task3)
+TEST(psostests_task4)
+TEST(psostests_task5)
+TEST(psostests_task6)
+TEST(psostests_task7)
+TEST(psostests_task8)
+TEST(psostests_task9)
+TEST(psostests_tm1)
+TEST(psostests_tm2)
+TEST(psostests_tm3)
+TEST(psostests_tm4)
+TEST(psostests_tm5)
+TEST(psostests_tm6)
+TEST(psostests_tm7)
+
diff --git a/testsuite/smokey/psostests/psostests_driver.c b/testsuite/smokey/psostests/psostests_driver.c
new file mode 100644
index 000000000..dd9eafc42
--- /dev/null
+++ b/testsuite/smokey/psostests/psostests_driver.c
@@ -0,0 +1,34 @@
+// SPDX-License-Identifier: GPL-2.0
+#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>
+
+int main(int argc, char *const argv[])
+{
+       struct smokey_test *t;
+       int ret, fails = 0;
+
+       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;
+}
+
diff --git a/lib/psos/testsuite/pt-1.c b/testsuite/smokey/psostests/pt-1.c
similarity index 96%
rename from lib/psos/testsuite/pt-1.c
rename to testsuite/smokey/psostests/pt-1.c
index 99f93ca1a..48f9799f7 100644
--- a/lib/psos/testsuite/pt-1.c
+++ b/testsuite/smokey/psostests/pt-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <memory.h>
diff --git a/lib/psos/testsuite/rn-1.c b/testsuite/smokey/psostests/rn-1.c
similarity index 97%
rename from lib/psos/testsuite/rn-1.c
rename to testsuite/smokey/psostests/rn-1.c
index da136f381..42f86a7ea 100644
--- a/lib/psos/testsuite/rn-1.c
+++ b/testsuite/smokey/psostests/rn-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <memory.h>
diff --git a/lib/psos/testsuite/sem-1.c b/testsuite/smokey/psostests/sem-1.c
similarity index 98%
rename from lib/psos/testsuite/sem-1.c
rename to testsuite/smokey/psostests/sem-1.c
index 61fa4b605..d32334c02 100644
--- a/lib/psos/testsuite/sem-1.c
+++ b/testsuite/smokey/psostests/sem-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/sem-2.c b/testsuite/smokey/psostests/sem-2.c
similarity index 97%
rename from lib/psos/testsuite/sem-2.c
rename to testsuite/smokey/psostests/sem-2.c
index a15bc388f..8223434f5 100644
--- a/lib/psos/testsuite/sem-2.c
+++ b/testsuite/smokey/psostests/sem-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/task-1.c b/testsuite/smokey/psostests/task-1.c
similarity index 95%
rename from lib/psos/testsuite/task-1.c
rename to testsuite/smokey/psostests/task-1.c
index f4bb71b7e..a0e6efa97 100644
--- a/lib/psos/testsuite/task-1.c
+++ b/testsuite/smokey/psostests/task-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/task-2.c b/testsuite/smokey/psostests/task-2.c
similarity index 98%
rename from lib/psos/testsuite/task-2.c
rename to testsuite/smokey/psostests/task-2.c
index d7f9fa06f..d24c13465 100644
--- a/lib/psos/testsuite/task-2.c
+++ b/testsuite/smokey/psostests/task-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/task-3.c b/testsuite/smokey/psostests/task-3.c
similarity index 96%
rename from lib/psos/testsuite/task-3.c
rename to testsuite/smokey/psostests/task-3.c
index d775f2823..d13e30423 100644
--- a/lib/psos/testsuite/task-3.c
+++ b/testsuite/smokey/psostests/task-3.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/task-4.c b/testsuite/smokey/psostests/task-4.c
similarity index 97%
rename from lib/psos/testsuite/task-4.c
rename to testsuite/smokey/psostests/task-4.c
index 3bca00271..ec6a99609 100644
--- a/lib/psos/testsuite/task-4.c
+++ b/testsuite/smokey/psostests/task-4.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/task-5.c b/testsuite/smokey/psostests/task-5.c
similarity index 98%
rename from lib/psos/testsuite/task-5.c
rename to testsuite/smokey/psostests/task-5.c
index e0124c12b..dcb8ec6ea 100644
--- a/lib/psos/testsuite/task-5.c
+++ b/testsuite/smokey/psostests/task-5.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/task-6.c b/testsuite/smokey/psostests/task-6.c
similarity index 98%
rename from lib/psos/testsuite/task-6.c
rename to testsuite/smokey/psostests/task-6.c
index 13c618c57..9cc46e633 100644
--- a/lib/psos/testsuite/task-6.c
+++ b/testsuite/smokey/psostests/task-6.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/task-7.c b/testsuite/smokey/psostests/task-7.c
similarity index 97%
rename from lib/psos/testsuite/task-7.c
rename to testsuite/smokey/psostests/task-7.c
index 8f5441afa..9177dbbf4 100644
--- a/lib/psos/testsuite/task-7.c
+++ b/testsuite/smokey/psostests/task-7.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/task-8.c b/testsuite/smokey/psostests/task-8.c
similarity index 98%
rename from lib/psos/testsuite/task-8.c
rename to testsuite/smokey/psostests/task-8.c
index d7c8fb33d..4543a04fa 100644
--- a/lib/psos/testsuite/task-8.c
+++ b/testsuite/smokey/psostests/task-8.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <xeno_config.h>
diff --git a/lib/psos/testsuite/task-9.c b/testsuite/smokey/psostests/task-9.c
similarity index 98%
rename from lib/psos/testsuite/task-9.c
rename to testsuite/smokey/psostests/task-9.c
index 1ae992999..f37d6736e 100644
--- a/lib/psos/testsuite/task-9.c
+++ b/testsuite/smokey/psostests/task-9.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/tm-1.c b/testsuite/smokey/psostests/tm-1.c
similarity index 95%
rename from lib/psos/testsuite/tm-1.c
rename to testsuite/smokey/psostests/tm-1.c
index b2f38f298..64605d8b9 100644
--- a/lib/psos/testsuite/tm-1.c
+++ b/testsuite/smokey/psostests/tm-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/tm-2.c b/testsuite/smokey/psostests/tm-2.c
similarity index 97%
rename from lib/psos/testsuite/tm-2.c
rename to testsuite/smokey/psostests/tm-2.c
index 44340f5dd..18ddff4b6 100644
--- a/lib/psos/testsuite/tm-2.c
+++ b/testsuite/smokey/psostests/tm-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/tm-3.c b/testsuite/smokey/psostests/tm-3.c
similarity index 97%
rename from lib/psos/testsuite/tm-3.c
rename to testsuite/smokey/psostests/tm-3.c
index 260a1314e..f5a947f46 100644
--- a/lib/psos/testsuite/tm-3.c
+++ b/testsuite/smokey/psostests/tm-3.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/tm-4.c b/testsuite/smokey/psostests/tm-4.c
similarity index 97%
rename from lib/psos/testsuite/tm-4.c
rename to testsuite/smokey/psostests/tm-4.c
index 26697c2fb..2c8c7a318 100644
--- a/lib/psos/testsuite/tm-4.c
+++ b/testsuite/smokey/psostests/tm-4.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/tm-5.c b/testsuite/smokey/psostests/tm-5.c
similarity index 97%
rename from lib/psos/testsuite/tm-5.c
rename to testsuite/smokey/psostests/tm-5.c
index 0fca7d023..d13613398 100644
--- a/lib/psos/testsuite/tm-5.c
+++ b/testsuite/smokey/psostests/tm-5.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/tm-6.c b/testsuite/smokey/psostests/tm-6.c
similarity index 95%
rename from lib/psos/testsuite/tm-6.c
rename to testsuite/smokey/psostests/tm-6.c
index 9debc498c..ba92c3071 100644
--- a/lib/psos/testsuite/tm-6.c
+++ b/testsuite/smokey/psostests/tm-6.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/tm-7.c b/testsuite/smokey/psostests/tm-7.c
similarity index 95%
rename from lib/psos/testsuite/tm-7.c
rename to testsuite/smokey/psostests/tm-7.c
index 202985daa..367650278 100644
--- a/lib/psos/testsuite/tm-7.c
+++ b/testsuite/smokey/psostests/tm-7.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
-- 
2.35.3


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

* [PATCH 03/10] testsuite: Fully integrate vwworkstests into smokey
  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-07-24 13:52       ` [PATCH 02/10] testsuite: Fully integrate psostests " Aaron Marcher
@ 2023-07-24 13:52       ` Aaron Marcher
  2023-07-24 13:52       ` [PATCH 04/10] testsuite: Remove old alchemytests Makefile Aaron Marcher
                         ` (6 subsequent siblings)
  9 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-07-24 13:52 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

Same as for alchemytests and psostests.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 configure.ac                                  |  2 +-
 lib/vxworks/testsuite/Makefile                | 43 ---------
 testsuite/Makefile.am                         |  6 +-
 testsuite/smokey/Makefile.am                  |  3 +
 testsuite/smokey/vxworkstests/Makefile.am     | 94 +++++++++++++++++++
 .../smokey/vxworkstests}/lst-1.c              |  1 +
 .../smokey/vxworkstests}/msgQ-1.c             |  1 +
 .../smokey/vxworkstests}/msgQ-2.c             |  1 +
 .../smokey/vxworkstests}/msgQ-3.c             |  1 +
 .../smokey/vxworkstests}/rng-1.c              |  1 +
 .../smokey/vxworkstests}/sem-1.c              |  1 +
 .../smokey/vxworkstests}/sem-2.c              |  1 +
 .../smokey/vxworkstests}/sem-3.c              |  1 +
 .../smokey/vxworkstests}/sem-4.c              |  1 +
 .../smokey/vxworkstests}/task-1.c             |  1 +
 .../smokey/vxworkstests}/task-2.c             |  1 +
 testsuite/smokey/vxworkstests/vxworkstests.c  | 46 +++++++++
 .../smokey/vxworkstests/vxworkstests_driver.c | 33 +++++++
 .../smokey/vxworkstests}/wd-1.c               |  1 +
 19 files changed, 191 insertions(+), 48 deletions(-)
 delete mode 100644 lib/vxworks/testsuite/Makefile
 create mode 100644 testsuite/smokey/vxworkstests/Makefile.am
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/lst-1.c (99%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-1.c (98%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-2.c (98%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-3.c (98%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/rng-1.c (99%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-1.c (98%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-2.c (98%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-3.c (97%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-4.c (98%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/task-1.c (96%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/task-2.c (98%)
 create mode 100644 testsuite/smokey/vxworkstests/vxworkstests.c
 create mode 100644 testsuite/smokey/vxworkstests/vxworkstests_driver.c
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/wd-1.c (97%)

diff --git a/configure.ac b/configure.ac
index 9db5438eb..a601f94cd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1045,9 +1045,9 @@ AC_CONFIG_FILES([ \
 	testsuite/smokey/x86io/Makefile \
 	testsuite/smokey/alchemytests/Makefile \
 	testsuite/smokey/psostests/Makefile \
+	testsuite/smokey/vxworkstests/Makefile \
 	testsuite/clocktest/Makefile \
 	testsuite/xeno-test/Makefile \
-	testsuite/vxworkstests/Makefile \
 	utils/Makefile \
 	utils/hdb/Makefile \
 	utils/can/Makefile \
diff --git a/lib/vxworks/testsuite/Makefile b/lib/vxworks/testsuite/Makefile
deleted file mode 100644
index 648c9be90..000000000
--- a/lib/vxworks/testsuite/Makefile
+++ /dev/null
@@ -1,43 +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)
-
-ifeq ($(prefix),)
-$(error Please add <xenomai-install-path>/bin to your PATH variable or specify DESTDIR)
-endif
-
-TESTS := task-1 task-2 msgQ-1 msgQ-2 msgQ-3 wd-1 sem-1 sem-2 sem-3 sem-4 lst-1 rng-1
-
-CFLAGS := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --skin=vxworks --cflags) -g
-LDFLAGS := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --skin=vxworks --ldflags)
-CC = $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --cc)
-
-all: $(TESTS)
-
-%: %.c
-	$(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
-
-install: all
-	install -d $(prefix)/testsuite/vxworks
-	install -t $(prefix)/testsuite/vxworks $(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
diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
index bb94f6ba6..4932f6d33 100644
--- a/testsuite/Makefile.am
+++ b/testsuite/Makefile.am
@@ -7,8 +7,7 @@ SUBDIRS += 		\
 	gpiotest	\
 	spitest		\
 	switchtest	\
-	xeno-test	\
-	vxworkstests
+	xeno-test
 endif
 
 DIST_SUBDIRS =		\
@@ -19,5 +18,4 @@ DIST_SUBDIRS =		\
 	smokey		\
 	spitest		\
 	switchtest	\
-	xeno-test	\
-	vxworkstests
+	xeno-test
diff --git a/testsuite/smokey/Makefile.am b/testsuite/smokey/Makefile.am
index 457e22a84..888e83b1c 100644
--- a/testsuite/smokey/Makefile.am
+++ b/testsuite/smokey/Makefile.am
@@ -42,6 +42,7 @@ COBALT_SUBDIRS = 	\
 	xddp		\
 	y2038 \
 	alchemytests \
+	vxworkstests \
 	psostests
 
 MERCURY_SUBDIRS =	\
@@ -49,6 +50,7 @@ MERCURY_SUBDIRS =	\
 	memory-tlsf	\
 	memcheck \
 	alchemytests \
+	vxworkstests \
 	psostests
 
 DIST_SUBDIRS = 		\
@@ -86,6 +88,7 @@ DIST_SUBDIRS = 		\
 	xddp		\
 	y2038 \
 	alchemytests \
+	vxworkstests \
 	psostests
 
 if XENO_X86
diff --git a/testsuite/smokey/vxworkstests/Makefile.am b/testsuite/smokey/vxworkstests/Makefile.am
new file mode 100644
index 000000000..ba942c455
--- /dev/null
+++ b/testsuite/smokey/vxworkstests/Makefile.am
@@ -0,0 +1,94 @@
+testdir = @XENO_TEST_DIR@
+noinst_LIBRARIES = libvxworkstests.a
+
+libvxworkstests_a_SOURCES = vxworkstests.c
+libvxworkstests_a_CPPFLAGS = 		\
+	@XENO_USER_CFLAGS@	\
+	-I$(top_srcdir)		\
+	-I$(top_srcdir)/include \
+	-DXENO_TEST_DIR='"$(XENO_TEST_DIR)"'
+
+CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
+
+test_PROGRAMS = \
+		vxworkstests \
+		vxworkstests_lst1	\
+		vxworkstests_msgQ1	\
+		vxworkstests_msgQ2	\
+		vxworkstests_msgQ3	\
+		vxworkstests_rng1	\
+		vxworkstests_sem1	\
+		vxworkstests_sem2	\
+		vxworkstests_sem3	\
+		vxworkstests_sem4	\
+		vxworkstests_wd1	\
+		vxworkstests_task1	\
+		vxworkstests_task2
+
+vxworkscppflags = 				\
+	$(XENO_USER_CFLAGS)		\
+	-I$(top_srcdir)/include
+
+vxworksldadd = 					\
+	../../../lib/vxworks/libvxworks@CORE@.la		\
+	../../../lib/copperplate/libcopperplate@CORE@.la	\
+	@XENO_CORE_LDADD@ 			\
+	@XENO_USER_LDADD@			\
+	-lpthread -lrt -lm
+
+vxworkstests_SOURCES = vxworkstests_driver.c
+vxworkstests_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_LDADD =			\
+	../../../lib/smokey/libsmokey@CORE@.la	\
+	-lpthread -lrt
+
+vxworkstests_lst1_SOURCES = lst-1.c
+vxworkstests_lst1_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_lst1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_lst1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_task1_SOURCES = task-1.c
+vxworkstests_task1_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_task1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_task1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_task2_SOURCES = task-2.c
+vxworkstests_task2_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_task2_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_task2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_msgQ1_SOURCES = msgQ-1.c
+vxworkstests_msgQ1_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_msgQ1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_msgQ1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_msgQ2_SOURCES = msgQ-2.c
+vxworkstests_msgQ2_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_msgQ2_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_msgQ2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_msgQ3_SOURCES = msgQ-3.c
+vxworkstests_msgQ3_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_msgQ3_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_msgQ3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_rng1_SOURCES = rng-1.c
+vxworkstests_rng1_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_rng1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_rng1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_sem1_SOURCES = sem-1.c
+vxworkstests_sem1_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_sem1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_sem1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_sem2_SOURCES = sem-2.c
+vxworkstests_sem2_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_sem2_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_sem2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_sem3_SOURCES = sem-3.c
+vxworkstests_sem3_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_sem3_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_sem3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_sem4_SOURCES = sem-4.c
+vxworkstests_sem4_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_sem4_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_sem4_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_wd1_SOURCES = wd-1.c
+vxworkstests_wd1_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_wd1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_wd1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
diff --git a/lib/vxworks/testsuite/lst-1.c b/testsuite/smokey/vxworkstests/lst-1.c
similarity index 99%
rename from lib/vxworks/testsuite/lst-1.c
rename to testsuite/smokey/vxworkstests/lst-1.c
index 03dec367d..878f32c90 100644
--- a/lib/vxworks/testsuite/lst-1.c
+++ b/testsuite/smokey/vxworkstests/lst-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/vxworks/testsuite/msgQ-1.c b/testsuite/smokey/vxworkstests/msgQ-1.c
similarity index 98%
rename from lib/vxworks/testsuite/msgQ-1.c
rename to testsuite/smokey/vxworkstests/msgQ-1.c
index fd15e1ddd..71eedd44f 100644
--- a/lib/vxworks/testsuite/msgQ-1.c
+++ b/testsuite/smokey/vxworkstests/msgQ-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/vxworks/testsuite/msgQ-2.c b/testsuite/smokey/vxworkstests/msgQ-2.c
similarity index 98%
rename from lib/vxworks/testsuite/msgQ-2.c
rename to testsuite/smokey/vxworkstests/msgQ-2.c
index 58f11e3a1..d3ee1397c 100644
--- a/lib/vxworks/testsuite/msgQ-2.c
+++ b/testsuite/smokey/vxworkstests/msgQ-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/vxworks/testsuite/msgQ-3.c b/testsuite/smokey/vxworkstests/msgQ-3.c
similarity index 98%
rename from lib/vxworks/testsuite/msgQ-3.c
rename to testsuite/smokey/vxworkstests/msgQ-3.c
index 1a4e20d26..a23d5c3d0 100644
--- a/lib/vxworks/testsuite/msgQ-3.c
+++ b/testsuite/smokey/vxworkstests/msgQ-3.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/vxworks/testsuite/rng-1.c b/testsuite/smokey/vxworkstests/rng-1.c
similarity index 99%
rename from lib/vxworks/testsuite/rng-1.c
rename to testsuite/smokey/vxworkstests/rng-1.c
index dd944a58a..1e179c6f6 100644
--- a/lib/vxworks/testsuite/rng-1.c
+++ b/testsuite/smokey/vxworkstests/rng-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
diff --git a/lib/vxworks/testsuite/sem-1.c b/testsuite/smokey/vxworkstests/sem-1.c
similarity index 98%
rename from lib/vxworks/testsuite/sem-1.c
rename to testsuite/smokey/vxworkstests/sem-1.c
index 245eb5c48..b64aba3b8 100644
--- a/lib/vxworks/testsuite/sem-1.c
+++ b/testsuite/smokey/vxworkstests/sem-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/vxworks/testsuite/sem-2.c b/testsuite/smokey/vxworkstests/sem-2.c
similarity index 98%
rename from lib/vxworks/testsuite/sem-2.c
rename to testsuite/smokey/vxworkstests/sem-2.c
index c9befc4d9..67caf2924 100644
--- a/lib/vxworks/testsuite/sem-2.c
+++ b/testsuite/smokey/vxworkstests/sem-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/vxworks/testsuite/sem-3.c b/testsuite/smokey/vxworkstests/sem-3.c
similarity index 97%
rename from lib/vxworks/testsuite/sem-3.c
rename to testsuite/smokey/vxworkstests/sem-3.c
index 1041d25b0..1f4252e3d 100644
--- a/lib/vxworks/testsuite/sem-3.c
+++ b/testsuite/smokey/vxworkstests/sem-3.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/vxworks/testsuite/sem-4.c b/testsuite/smokey/vxworkstests/sem-4.c
similarity index 98%
rename from lib/vxworks/testsuite/sem-4.c
rename to testsuite/smokey/vxworkstests/sem-4.c
index 5c82169e1..0a8daedb1 100644
--- a/lib/vxworks/testsuite/sem-4.c
+++ b/testsuite/smokey/vxworkstests/sem-4.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/vxworks/testsuite/task-1.c b/testsuite/smokey/vxworkstests/task-1.c
similarity index 96%
rename from lib/vxworks/testsuite/task-1.c
rename to testsuite/smokey/vxworkstests/task-1.c
index 3cf5f3806..a07d643c3 100644
--- a/lib/vxworks/testsuite/task-1.c
+++ b/testsuite/smokey/vxworkstests/task-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/vxworks/testsuite/task-2.c b/testsuite/smokey/vxworkstests/task-2.c
similarity index 98%
rename from lib/vxworks/testsuite/task-2.c
rename to testsuite/smokey/vxworkstests/task-2.c
index 46d99a266..7f9f0f002 100644
--- a/lib/vxworks/testsuite/task-2.c
+++ b/testsuite/smokey/vxworkstests/task-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/testsuite/smokey/vxworkstests/vxworkstests.c b/testsuite/smokey/vxworkstests/vxworkstests.c
new file mode 100644
index 000000000..e244c4d98
--- /dev/null
+++ b/testsuite/smokey/vxworkstests/vxworkstests.c
@@ -0,0 +1,46 @@
+// SPDX-License-Identifier: GPL-2.0
+#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>
+
+#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", XENO_TEST_DIR, t->name);
+	if (ret == -1)
+		return -ENOMEM;
+
+	ret = system(tst_path);
+	free(tst_path);
+
+	return ret;
+}
+
+TEST(vxworkstests)
+TEST(vxworkstests_lst1)
+TEST(vxworkstests_msgQ1)
+TEST(vxworkstests_msgQ2)
+TEST(vxworkstests_msgQ3)
+TEST(vxworkstests_rng1)
+TEST(vxworkstests_sem1)
+TEST(vxworkstests_sem2)
+TEST(vxworkstests_sem3)
+TEST(vxworkstests_sem4)
+TEST(vxworkstests_wd1)
+TEST(vxworkstests_task1)
+TEST(vxworkstests_task2)
+
diff --git a/testsuite/smokey/vxworkstests/vxworkstests_driver.c b/testsuite/smokey/vxworkstests/vxworkstests_driver.c
new file mode 100644
index 000000000..7cacbb399
--- /dev/null
+++ b/testsuite/smokey/vxworkstests/vxworkstests_driver.c
@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: GPL-2.0
+#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>
+
+int main(int argc, char *const argv[])
+{
+	struct smokey_test *t;
+	int ret, fails = 0;
+
+	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;
+}
diff --git a/lib/vxworks/testsuite/wd-1.c b/testsuite/smokey/vxworkstests/wd-1.c
similarity index 97%
rename from lib/vxworks/testsuite/wd-1.c
rename to testsuite/smokey/vxworkstests/wd-1.c
index b557545e8..7da5d4dcb 100644
--- a/lib/vxworks/testsuite/wd-1.c
+++ b/testsuite/smokey/vxworkstests/wd-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
-- 
2.35.3


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

* [PATCH 04/10] testsuite: Remove old alchemytests Makefile
  2023-07-24 13:52     ` [PATCH v5 " Aaron Marcher
                         ` (2 preceding siblings ...)
  2023-07-24 13:52       ` [PATCH 03/10] testsuite: Fully integrate vwworkstests " Aaron Marcher
@ 2023-07-24 13:52       ` Aaron Marcher
  2023-07-24 13:52       ` [PATCH 05/10] alchemytests: Fix gcc warning in buffer-1 Aaron Marcher
                         ` (5 subsequent siblings)
  9 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-07-24 13:52 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

From: Richard Weinberger <richard@nod.at>

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Aaron Marcher <aaron@sigma-star.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.35.3


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

* [PATCH 05/10] alchemytests: Fix gcc warning in buffer-1
  2023-07-24 13:52     ` [PATCH v5 " Aaron Marcher
                         ` (3 preceding siblings ...)
  2023-07-24 13:52       ` [PATCH 04/10] testsuite: Remove old alchemytests Makefile Aaron Marcher
@ 2023-07-24 13:52       ` Aaron Marcher
  2023-07-24 13:52       ` [PATCH 06/10] alchemytests: Fix gcc warning in task-9 Aaron Marcher
                         ` (4 subsequent siblings)
  9 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-07-24 13:52 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

From: Richard Weinberger <richard@nod.at>

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>
Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 testsuite/smokey/alchemytests/buffer-1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testsuite/smokey/alchemytests/buffer-1.c b/testsuite/smokey/alchemytests/buffer-1.c
index fdcb5e8d7..008797827 100644
--- a/testsuite/smokey/alchemytests/buffer-1.c
+++ b/testsuite/smokey/alchemytests/buffer-1.c
@@ -50,7 +50,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.35.3


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

* [PATCH 06/10] alchemytests: Fix gcc warning in task-9
  2023-07-24 13:52     ` [PATCH v5 " Aaron Marcher
                         ` (4 preceding siblings ...)
  2023-07-24 13:52       ` [PATCH 05/10] alchemytests: Fix gcc warning in buffer-1 Aaron Marcher
@ 2023-07-24 13:52       ` Aaron Marcher
  2023-07-24 13:52       ` [PATCH 07/10] alchemytests: Check pipe-1 asprintf ret value Aaron Marcher
                         ` (3 subsequent siblings)
  9 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-07-24 13:52 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

From: Richard Weinberger <richard@nod.at>

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>
Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 testsuite/smokey/alchemytests/task-9.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testsuite/smokey/alchemytests/task-9.c b/testsuite/smokey/alchemytests/task-9.c
index 56cc7bfeb..9bb43efbd 100644
--- a/testsuite/smokey/alchemytests/task-9.c
+++ b/testsuite/smokey/alchemytests/task-9.c
@@ -11,7 +11,7 @@ static RT_TASK t_test;
 
 #define ONE_SECOND  1000000000ULL
 
-void sighandler(int sig)
+static void sighandler(int sig)
 {
 	/* nop */
 }
-- 
2.35.3


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

* [PATCH 07/10] alchemytests: Check pipe-1 asprintf ret value
  2023-07-24 13:52     ` [PATCH v5 " Aaron Marcher
                         ` (5 preceding siblings ...)
  2023-07-24 13:52       ` [PATCH 06/10] alchemytests: Fix gcc warning in task-9 Aaron Marcher
@ 2023-07-24 13:52       ` Aaron Marcher
  2023-07-24 13:52       ` [PATCH 08/10] alchemytests: Fix task-2 Aaron Marcher
                         ` (2 subsequent siblings)
  9 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-07-24 13:52 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 testsuite/smokey/alchemytests/pipe-1.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/testsuite/smokey/alchemytests/pipe-1.c b/testsuite/smokey/alchemytests/pipe-1.c
index 4011f9c8a..488c0ee3b 100644
--- a/testsuite/smokey/alchemytests/pipe-1.c
+++ b/testsuite/smokey/alchemytests/pipe-1.c
@@ -49,11 +49,13 @@ static void realtime_task(void *arg)
 static void *regular_thread(void *arg)
 {
 	struct pipe_message m;
-	int fd, seq = 0;
+	int fd, res, seq = 0;
 	ssize_t ret;
 	char *rtp;
 
-	asprintf(&rtp, "/dev/rtp%d", minor);
+	res = asprintf(&rtp, "/dev/rtp%d", minor);
+	if (res < 0)
+		return NULL;
 
 	fd = open(rtp, O_RDWR);
 	free(rtp);
-- 
2.35.3


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

* [PATCH 08/10] alchemytests: Fix task-2
  2023-07-24 13:52     ` [PATCH v5 " Aaron Marcher
                         ` (6 preceding siblings ...)
  2023-07-24 13:52       ` [PATCH 07/10] alchemytests: Check pipe-1 asprintf ret value Aaron Marcher
@ 2023-07-24 13:52       ` Aaron Marcher
  2023-07-24 14:39         ` Richard Weinberger
  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
  9 siblings, 1 reply; 112+ messages in thread
From: Aaron Marcher @ 2023-07-24 13:52 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

https://lore.kernel.org/xenomai/2065449276.254073.1649941119506.JavaMail.zimbra@nod.at/

Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 testsuite/smokey/alchemytests/task-2.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/testsuite/smokey/alchemytests/task-2.c b/testsuite/smokey/alchemytests/task-2.c
index 592f2ed20..1284a8b61 100644
--- a/testsuite/smokey/alchemytests/task-2.c
+++ b/testsuite/smokey/alchemytests/task-2.c
@@ -29,8 +29,10 @@ static void background_task(void *arg)
 
 	traceobj_mark(&trobj, 2);
 
-	while (--safety > 0)
+	while (--safety > 0) {
+		compiler_barrier();
 		count++;
+	}
 
 	traceobj_exit(&trobj);
 }
-- 
2.35.3


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

* [PATCH 09/10] alchemytests: Fix task-5 logic
  2023-07-24 13:52     ` [PATCH v5 " Aaron Marcher
                         ` (7 preceding siblings ...)
  2023-07-24 13:52       ` [PATCH 08/10] alchemytests: Fix task-2 Aaron Marcher
@ 2023-07-24 13:52       ` Aaron Marcher
  2023-07-24 13:52       ` [PATCH 10/10] testsuite: disable broken tests Aaron Marcher
  9 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-07-24 13:52 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

Semaphore call in wrong logical order, so that on the second
rt_task_set_priority call the task doesn't exist anymore and thus the
call fails with EINVAL.

This commit fixes the order so that the test passes again.

Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 testsuite/smokey/alchemytests/task-5.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/testsuite/smokey/alchemytests/task-5.c b/testsuite/smokey/alchemytests/task-5.c
index b9075945d..2aecd8125 100644
--- a/testsuite/smokey/alchemytests/task-5.c
+++ b/testsuite/smokey/alchemytests/task-5.c
@@ -45,17 +45,17 @@ static void foreground_task(void *arg)
 
 	traceobj_mark(&trobj, 4);
 
-	ret = rt_sem_v(&sem);
-	traceobj_check(&trobj, ret, 0);
+	ret = rt_task_inquire(NULL, &info);
+	traceobj_assert(&trobj, ret == 0 && info.prio == 21);
 
 	traceobj_mark(&trobj, 5);
 
-	ret = rt_task_inquire(NULL, &info);
-	traceobj_assert(&trobj, ret == 0 && info.prio == 21);
+	ret = rt_task_set_priority(&t_bgnd, info.prio);
+	traceobj_check(&trobj, ret, 0);
 
 	traceobj_mark(&trobj, 6);
 
-	ret = rt_task_set_priority(&t_bgnd, info.prio);
+	ret = rt_sem_v(&sem);
 	traceobj_check(&trobj, ret, 0);
 
 	traceobj_mark(&trobj, 7);
-- 
2.35.3


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

* [PATCH 10/10] testsuite: disable broken tests
  2023-07-24 13:52     ` [PATCH v5 " Aaron Marcher
                         ` (8 preceding siblings ...)
  2023-07-24 13:52       ` [PATCH 09/10] alchemytests: Fix task-5 logic Aaron Marcher
@ 2023-07-24 13:52       ` Aaron Marcher
  9 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-07-24 13:52 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

as discussed on the mailing list, disable broken tests (for now)

Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 testsuite/smokey/psostests/psostests.c | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/testsuite/smokey/psostests/psostests.c b/testsuite/smokey/psostests/psostests.c
index 254a1515c..f315c1d55 100644
--- a/testsuite/smokey/psostests/psostests.c
+++ b/testsuite/smokey/psostests/psostests.c
@@ -35,18 +35,30 @@ TEST(psostests_mq1)
 TEST(psostests_mq2)
 TEST(psostests_mq3)
 TEST(psostests_pt1)
-TEST(psostests_rn1)
+// 0"000.679| BUG in __traceobj_assert_failed(): [rn1] trace assertion failed:
+//            testsuite/psostests/rn-1.c:46
+// => "ret == 0"
+//TEST(psostests_rn1)
 TEST(psostests_sem1)
 TEST(psostests_sem2)
 TEST(psostests_task1)
-TEST(psostests_task2)
+// 0"014.452| BUG in __traceobj_assert_failed(): [FGND] trace assertion failed:
+//            ../../../../../../../../../workspace/sources/xenomai/testsuite/smokey/psostests/task-2.c:56 => "ret == 0"
+//TEST(psostests_task2)
 TEST(psostests_task3)
 TEST(psostests_task4)
 TEST(psostests_task5)
-TEST(psostests_task6)
+// 0"011.370| BUG in __traceobj_assert_failed(): [FGND] trace assertion failed:
+//            testsuite/psostests/task-6.c:62
+// => "ret == 0 && oldprio == myprio"
+// TEST(psostests_task6)
 TEST(psostests_task7)
-TEST(psostests_task8)
-TEST(psostests_task9)
+// runs forever (100% CPU)
+//TEST(psostests_task8)
+// 0"002.198| WARNING: [main] lack of resources for core thread, EBUSY
+// 0"003.421| BUG in __traceobj_assert_failed(): [root] trace assertion failed:
+//           ../../../../../../../../../workspace/sources/xenomai/testsuite/smokey/psostests/task-9.c:29 => "ret == 0"
+//TEST(psostests_task9)
 TEST(psostests_tm1)
 TEST(psostests_tm2)
 TEST(psostests_tm3)
-- 
2.35.3


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

* Re: [PATCH 08/10] alchemytests: Fix task-2
  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
  0 siblings, 1 reply; 112+ messages in thread
From: Richard Weinberger @ 2023-07-24 14:39 UTC (permalink / raw)
  To: aaron; +Cc: xenomai, Jan Kiszka

----- Ursprüngliche Mail -----
> Von: "aaron" <aaron@sigma-star.at>
> An: "xenomai" <xenomai@lists.linux.dev>
> CC: "richard" <richard@nod.at>, "Jan Kiszka" <jan.kiszka@siemens.com>, "aaron" <aaron@sigma-star.at>
> Gesendet: Montag, 24. Juli 2023 15:52:37
> Betreff: [PATCH 08/10] alchemytests: Fix task-2

> https://lore.kernel.org/xenomai/2065449276.254073.1649941119506.JavaMail.zimbra@nod.at/
> 
> Signed-off-by: Aaron Marcher <aaron@sigma-star.at>

I think this changelog can be improved.

Thanks,
//richard

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

* [PATCH v6 00/10] Revive alchemy, pSOS and VxWorks tests
  2023-07-24 14:39         ` Richard Weinberger
@ 2023-07-25  8:29           ` Aaron Marcher
  2023-07-25  8:29             ` [PATCH 01/10] testsuite: Fully integrate alchemytests into smokey Aaron Marcher
                               ` (12 more replies)
  0 siblings, 13 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-07-25  8:29 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

This patch series fully integrates the currently abandoned alchemy, pSOS
and VxWorks tests into Xenomai's testsuite.
For each test, a Smokey testcase is hooked up.

Changes since v5:
- Improved task-2 fix commit message

Aaron Marcher (7):
  testsuite: Fully integrate alchemytests into smokey
  testsuite: Fully integrate psostests into smokey
  testsuite: Fully integrate vwworkstests into smokey
  alchemytests: Check pipe-1 asprintf ret value
  alchemytests: Fix task-2
  alchemytests: Fix task-5 logic
  testsuite: disable broken tests

Richard Weinberger (3):
  testsuite: Remove old alchemytests Makefile
  alchemytests: Fix gcc warning in buffer-1
  alchemytests: Fix gcc warning in task-9

 configure.ac                                  |   7 +-
 lib/alchemy/testsuite/Makefile                |  70 ---------
 lib/psos/testsuite/Makefile                   |  49 ------
 lib/vxworks/testsuite/Makefile                |  43 -----
 testsuite/smokey/Makefile.am                  |  15 +-
 testsuite/smokey/alchemytests/Makefile.am     | 148 ++++++++++++++++++
 .../smokey/alchemytests}/alarm-1.c            |   1 +
 testsuite/smokey/alchemytests/alchemytests.c  |  56 +++++++
 .../smokey/alchemytests/alchemytests_driver.c |  33 ++++
 .../smokey/alchemytests}/buffer-1.c           |   3 +-
 .../smokey/alchemytests}/event-1.c            |   1 +
 .../smokey/alchemytests}/heap-1.c             |   1 +
 .../smokey/alchemytests}/heap-2.c             |   1 +
 .../smokey/alchemytests}/mq-1.c               |   1 +
 .../smokey/alchemytests}/mq-2.c               |   1 +
 .../smokey/alchemytests}/mq-3.c               |   1 +
 .../smokey/alchemytests}/mutex-1.c            |   1 +
 .../smokey/alchemytests}/pipe-1.c             |   7 +-
 .../smokey/alchemytests}/sem-1.c              |   1 +
 .../smokey/alchemytests}/sem-2.c              |   1 +
 .../smokey/alchemytests}/task-1.c             |   1 +
 .../smokey/alchemytests}/task-10.c            |   1 +
 .../smokey/alchemytests}/task-2.c             |   5 +-
 .../smokey/alchemytests}/task-3.c             |   1 +
 .../smokey/alchemytests}/task-4.c             |   1 +
 .../smokey/alchemytests}/task-5.c             |  11 +-
 .../smokey/alchemytests}/task-6.c             |   1 +
 .../smokey/alchemytests}/task-7.c             |   1 +
 .../smokey/alchemytests}/task-8.c             |   1 +
 .../smokey/alchemytests}/task-9.c             |   3 +-
 testsuite/smokey/psostests/Makefile.am        | 148 ++++++++++++++++++
 .../smokey/psostests}/mq-1.c                  |   1 +
 .../smokey/psostests}/mq-2.c                  |   1 +
 .../smokey/psostests}/mq-3.c                  |   1 +
 testsuite/smokey/psostests/psostests.c        |  69 ++++++++
 testsuite/smokey/psostests/psostests_driver.c |  34 ++++
 .../smokey/psostests}/pt-1.c                  |   1 +
 .../smokey/psostests}/rn-1.c                  |   1 +
 .../smokey/psostests}/sem-1.c                 |   1 +
 .../smokey/psostests}/sem-2.c                 |   1 +
 .../smokey/psostests}/task-1.c                |   1 +
 .../smokey/psostests}/task-2.c                |   1 +
 .../smokey/psostests}/task-3.c                |   1 +
 .../smokey/psostests}/task-4.c                |   1 +
 .../smokey/psostests}/task-5.c                |   1 +
 .../smokey/psostests}/task-6.c                |   1 +
 .../smokey/psostests}/task-7.c                |   1 +
 .../smokey/psostests}/task-8.c                |   1 +
 .../smokey/psostests}/task-9.c                |   1 +
 .../smokey/psostests}/tm-1.c                  |   1 +
 .../smokey/psostests}/tm-2.c                  |   1 +
 .../smokey/psostests}/tm-3.c                  |   1 +
 .../smokey/psostests}/tm-4.c                  |   1 +
 .../smokey/psostests}/tm-5.c                  |   1 +
 .../smokey/psostests}/tm-6.c                  |   1 +
 .../smokey/psostests}/tm-7.c                  |   1 +
 testsuite/smokey/vxworkstests/Makefile.am     |  94 +++++++++++
 .../smokey/vxworkstests}/lst-1.c              |   1 +
 .../smokey/vxworkstests}/msgQ-1.c             |   1 +
 .../smokey/vxworkstests}/msgQ-2.c             |   1 +
 .../smokey/vxworkstests}/msgQ-3.c             |   1 +
 .../smokey/vxworkstests}/rng-1.c              |   1 +
 .../smokey/vxworkstests}/sem-1.c              |   1 +
 .../smokey/vxworkstests}/sem-2.c              |   1 +
 .../smokey/vxworkstests}/sem-3.c              |   1 +
 .../smokey/vxworkstests}/sem-4.c              |   1 +
 .../smokey/vxworkstests}/task-1.c             |   1 +
 .../smokey/vxworkstests}/task-2.c             |   1 +
 testsuite/smokey/vxworkstests/vxworkstests.c  |  46 ++++++
 .../smokey/vxworkstests/vxworkstests_driver.c |  33 ++++
 .../smokey/vxworkstests}/wd-1.c               |   1 +
 71 files changed, 749 insertions(+), 177 deletions(-)
 delete mode 100644 lib/alchemy/testsuite/Makefile
 delete mode 100644 lib/psos/testsuite/Makefile
 delete mode 100644 lib/vxworks/testsuite/Makefile
 create mode 100644 testsuite/smokey/alchemytests/Makefile.am
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/alarm-1.c (97%)
 create mode 100644 testsuite/smokey/alchemytests/alchemytests.c
 create mode 100644 testsuite/smokey/alchemytests/alchemytests_driver.c
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/buffer-1.c (97%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/event-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/heap-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/heap-2.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-2.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-3.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mutex-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/pipe-1.c (96%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/sem-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/sem-2.c (97%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-1.c (94%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-10.c (97%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-2.c (95%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-3.c (97%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-4.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-5.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-6.c (97%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-7.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-8.c (97%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-9.c (94%)
 create mode 100644 testsuite/smokey/psostests/Makefile.am
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/mq-1.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/mq-2.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/mq-3.c (98%)
 create mode 100644 testsuite/smokey/psostests/psostests.c
 create mode 100644 testsuite/smokey/psostests/psostests_driver.c
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/pt-1.c (96%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/rn-1.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/sem-1.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/sem-2.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-1.c (95%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-2.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-3.c (96%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-4.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-5.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-6.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-7.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-8.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-9.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-1.c (95%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-2.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-3.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-4.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-5.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-6.c (95%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-7.c (95%)
 create mode 100644 testsuite/smokey/vxworkstests/Makefile.am
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/lst-1.c (99%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-1.c (98%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-2.c (98%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-3.c (98%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/rng-1.c (99%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-1.c (98%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-2.c (98%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-3.c (97%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-4.c (98%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/task-1.c (96%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/task-2.c (98%)
 create mode 100644 testsuite/smokey/vxworkstests/vxworkstests.c
 create mode 100644 testsuite/smokey/vxworkstests/vxworkstests_driver.c
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/wd-1.c (97%)

-- 
2.35.3


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

* [PATCH 01/10] testsuite: Fully integrate alchemytests into smokey
  2023-07-25  8:29           ` [PATCH v6 00/10] Revive alchemy, pSOS and VxWorks tests Aaron Marcher
@ 2023-07-25  8:29             ` 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
                               ` (11 subsequent siblings)
  12 siblings, 2 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-07-25  8:29 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

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

Build them using Xenomai's build system and hook them up using
Smokey. Every test binary has it's own respective testcase in the
testsuite.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 configure.ac                                  |   7 +-
 testsuite/Makefile.am                         |   8 +-
 testsuite/smokey/Makefile.am                  |   9 +-
 testsuite/smokey/alchemytests/Makefile.am     | 148 ++++++++++++++++++
 .../smokey/alchemytests}/alarm-1.c            |   1 +
 testsuite/smokey/alchemytests/alchemytests.c  |  56 +++++++
 .../smokey/alchemytests/alchemytests_driver.c |  33 ++++
 .../smokey/alchemytests}/buffer-1.c           |   1 +
 .../smokey/alchemytests}/event-1.c            |   1 +
 .../smokey/alchemytests}/heap-1.c             |   1 +
 .../smokey/alchemytests}/heap-2.c             |   1 +
 .../smokey/alchemytests}/mq-1.c               |   1 +
 .../smokey/alchemytests}/mq-2.c               |   1 +
 .../smokey/alchemytests}/mq-3.c               |   1 +
 .../smokey/alchemytests}/mutex-1.c            |   1 +
 .../smokey/alchemytests}/pipe-1.c             |   1 +
 .../smokey/alchemytests}/sem-1.c              |   1 +
 .../smokey/alchemytests}/sem-2.c              |   1 +
 .../smokey/alchemytests}/task-1.c             |   1 +
 .../smokey/alchemytests}/task-10.c            |   1 +
 .../smokey/alchemytests}/task-2.c             |   1 +
 .../smokey/alchemytests}/task-3.c             |   1 +
 .../smokey/alchemytests}/task-4.c             |   1 +
 .../smokey/alchemytests}/task-5.c             |   1 +
 .../smokey/alchemytests}/task-6.c             |   1 +
 .../smokey/alchemytests}/task-7.c             |   1 +
 .../smokey/alchemytests}/task-8.c             |   1 +
 .../smokey/alchemytests}/task-9.c             |   1 +
 28 files changed, 276 insertions(+), 7 deletions(-)
 create mode 100644 testsuite/smokey/alchemytests/Makefile.am
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/alarm-1.c (97%)
 create mode 100644 testsuite/smokey/alchemytests/alchemytests.c
 create mode 100644 testsuite/smokey/alchemytests/alchemytests_driver.c
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/buffer-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/event-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/heap-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/heap-2.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-2.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-3.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mutex-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/pipe-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/sem-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/sem-2.c (97%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-1.c (94%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-10.c (97%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-2.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-3.c (97%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-4.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-5.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-6.c (97%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-7.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-8.c (97%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-9.c (97%)

diff --git a/configure.ac b/configure.ac
index 3ce34048e..fe59333ed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1041,10 +1041,13 @@ AC_CONFIG_FILES([ \
 	testsuite/smokey/cpu-affinity/Makefile \
 	testsuite/smokey/gdb/Makefile \
 	testsuite/smokey/y2038/Makefile \
-	testsuite/smokey/can/Makefile
-	testsuite/smokey/x86io/Makefile
+	testsuite/smokey/can/Makefile \
+	testsuite/smokey/x86io/Makefile \
+	testsuite/smokey/alchemytests/Makefile \
 	testsuite/clocktest/Makefile \
 	testsuite/xeno-test/Makefile \
+	testsuite/psostests/Makefile \
+	testsuite/vxworkstests/Makefile \
 	utils/Makefile \
 	utils/hdb/Makefile \
 	utils/can/Makefile \
diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
index 4932f6d33..1be7eaba4 100644
--- a/testsuite/Makefile.am
+++ b/testsuite/Makefile.am
@@ -7,7 +7,9 @@ SUBDIRS += 		\
 	gpiotest	\
 	spitest		\
 	switchtest	\
-	xeno-test
+	xeno-test	\
+	psostests	\
+	vxworkstests
 endif
 
 DIST_SUBDIRS =		\
@@ -18,4 +20,6 @@ DIST_SUBDIRS =		\
 	smokey		\
 	spitest		\
 	switchtest	\
-	xeno-test
+	xeno-test	\
+	psostests \
+	vxworkstests
diff --git a/testsuite/smokey/Makefile.am b/testsuite/smokey/Makefile.am
index 79dc61e9f..633a87387 100644
--- a/testsuite/smokey/Makefile.am
+++ b/testsuite/smokey/Makefile.am
@@ -40,12 +40,14 @@ COBALT_SUBDIRS = 	\
 	tsc		\
 	vdso-access 	\
 	xddp		\
-	y2038
+	y2038 \
+	alchemytests
 
 MERCURY_SUBDIRS =	\
 	memory-heapmem	\
 	memory-tlsf	\
-	memcheck
+	memcheck \
+	alchemytests
 
 DIST_SUBDIRS = 		\
 	arith 		\
@@ -80,7 +82,8 @@ DIST_SUBDIRS = 		\
 	tsc		\
 	vdso-access 	\
 	xddp		\
-	y2038
+	y2038 \
+	alchemytests
 
 if XENO_X86
 DIST_SUBDIRS += x86io
diff --git a/testsuite/smokey/alchemytests/Makefile.am b/testsuite/smokey/alchemytests/Makefile.am
new file mode 100644
index 000000000..9da3a98f3
--- /dev/null
+++ b/testsuite/smokey/alchemytests/Makefile.am
@@ -0,0 +1,148 @@
+testdir = @XENO_TEST_DIR@
+noinst_LIBRARIES = libalchemytests.a
+
+libalchemytests_a_SOURCES = alchemytests.c
+libalchemytests_a_CPPFLAGS = 		\
+	@XENO_USER_CFLAGS@	\
+	-I$(top_srcdir)		\
+	-I$(top_srcdir)/include \
+	-DXENO_TEST_DIR='"$(XENO_TEST_DIR)"'
+
+CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
+
+test_PROGRAMS = \
+		alchemytests \
+		alchemytests_alarm1		   \
+		alchemytests_buffer1		   \
+		alchemytests_event1		   \
+		alchemytests_heap1		   \
+		alchemytests_heap2		   \
+		alchemytests_mq1		   \
+		alchemytests_mq2		   \
+		alchemytests_mq3		   \
+		alchemytests_mutex1		   \
+		alchemytests_pipe1		   \
+		alchemytests_sem1		   \
+		alchemytests_sem2		   \
+		alchemytests_task1		   \
+		alchemytests_task2		   \
+		alchemytests_task3		   \
+		alchemytests_task4		   \
+		alchemytests_task5		   \
+		alchemytests_task6		   \
+		alchemytests_task7		   \
+		alchemytests_task8		   \
+		alchemytests_task9		   \
+		alchemytests_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
+
+alchemytests_SOURCES = alchemytests_driver.c
+alchemytests_CPPFLAGS =			\
+	$(XENO_USER_CFLAGS)			\
+	-I$(top_srcdir)/include
+alchemytests_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_LDADD =			\
+	../../../lib/smokey/libsmokey@CORE@.la	\
+	@XENO_CORE_LDADD@		\
+	@XENO_USER_LDADD@		\
+	-lpthread -lrt
+
+alchemytests_alarm1_SOURCES = alarm-1.c
+alchemytests_alarm1_CPPFLAGS = $(alchemycppflags)
+alchemytests_alarm1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_alarm1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_event1_SOURCES = event-1.c
+alchemytests_event1_CPPFLAGS = $(alchemycppflags)
+alchemytests_event1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_event1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_heap1_SOURCES = heap-1.c
+alchemytests_heap1_CPPFLAGS = $(alchemycppflags)
+alchemytests_heap1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_heap1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_heap2_SOURCES = heap-2.c
+alchemytests_heap2_CPPFLAGS = $(alchemycppflags)
+alchemytests_heap2_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_heap2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_buffer1_SOURCES = buffer-1.c
+alchemytests_buffer1_CPPFLAGS = $(alchemycppflags)
+alchemytests_buffer1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_buffer1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_mutex1_SOURCES = mutex-1.c
+alchemytests_mutex1_CPPFLAGS = $(alchemycppflags)
+alchemytests_mutex1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_mutex1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_pipe1_SOURCES = pipe-1.c
+alchemytests_pipe1_CPPFLAGS = $(alchemycppflags)
+alchemytests_pipe1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_pipe1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_mq1_SOURCES = mq-1.c
+alchemytests_mq1_CPPFLAGS = $(alchemycppflags)
+alchemytests_mq1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_mq1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_mq2_SOURCES = mq-2.c
+alchemytests_mq2_CPPFLAGS = $(alchemycppflags)
+alchemytests_mq2_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_mq2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_mq3_SOURCES = mq-3.c
+alchemytests_mq3_CPPFLAGS = $(alchemycppflags)
+alchemytests_mq3_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_mq3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_sem1_SOURCES = sem-1.c
+alchemytests_sem1_CPPFLAGS = $(alchemycppflags)
+alchemytests_sem1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_sem1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_sem2_SOURCES = sem-2.c
+alchemytests_sem2_CPPFLAGS = $(alchemycppflags)
+alchemytests_sem2_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_sem2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task1_SOURCES = task-1.c
+alchemytests_task1_CPPFLAGS = $(alchemycppflags)
+alchemytests_task1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_task1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task2_SOURCES = task-2.c
+alchemytests_task2_CPPFLAGS = $(alchemycppflags)
+alchemytests_task2_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_task2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task3_SOURCES = task-3.c
+alchemytests_task3_CPPFLAGS = $(alchemycppflags)
+alchemytests_task3_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_task3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task4_SOURCES = task-4.c
+alchemytests_task4_CPPFLAGS = $(alchemycppflags)
+alchemytests_task4_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_task4_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task5_SOURCES = task-5.c
+alchemytests_task5_CPPFLAGS = $(alchemycppflags)
+alchemytests_task5_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_task5_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task6_SOURCES = task-6.c
+alchemytests_task6_CPPFLAGS = $(alchemycppflags)
+alchemytests_task6_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_task6_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task7_SOURCES = task-7.c
+alchemytests_task7_CPPFLAGS = $(alchemycppflags)
+alchemytests_task7_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_task7_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task8_SOURCES = task-8.c
+alchemytests_task8_CPPFLAGS = $(alchemycppflags)
+alchemytests_task8_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_task8_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task9_SOURCES = task-9.c
+alchemytests_task9_CPPFLAGS = $(alchemycppflags)
+alchemytests_task9_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_task9_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task10_SOURCES = task-10.c
+alchemytests_task10_CPPFLAGS = $(alchemycppflags)
+alchemytests_task10_LDADD = $(alchemyldadd) -lpthread -lrt -lm
+alchemytests_task10_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
diff --git a/lib/alchemy/testsuite/alarm-1.c b/testsuite/smokey/alchemytests/alarm-1.c
similarity index 97%
rename from lib/alchemy/testsuite/alarm-1.c
rename to testsuite/smokey/alchemytests/alarm-1.c
index 29b3bbe74..eb6c5310a 100644
--- a/lib/alchemy/testsuite/alarm-1.c
+++ b/testsuite/smokey/alchemytests/alarm-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/testsuite/smokey/alchemytests/alchemytests.c b/testsuite/smokey/alchemytests/alchemytests.c
new file mode 100644
index 000000000..ee8d1703b
--- /dev/null
+++ b/testsuite/smokey/alchemytests/alchemytests.c
@@ -0,0 +1,56 @@
+// SPDX-License-Identifier: GPL-2.0
+#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>
+
+#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", XENO_TEST_DIR, t->name);
+	if (ret == -1)
+		return -ENOMEM;
+
+	ret = system(tst_path);
+	free(tst_path);
+
+	return ret;
+}
+
+TEST(alchemytests)
+TEST(alchemytests_alarm1)
+TEST(alchemytests_buffer1)
+TEST(alchemytests_event1)
+TEST(alchemytests_heap1)
+TEST(alchemytests_heap2)
+TEST(alchemytests_mq1)
+TEST(alchemytests_mq2)
+TEST(alchemytests_mq3)
+TEST(alchemytests_mutex1)
+TEST(alchemytests_pipe1)
+TEST(alchemytests_sem1)
+TEST(alchemytests_sem2)
+TEST(alchemytests_task1)
+TEST(alchemytests_task2)
+TEST(alchemytests_task3)
+TEST(alchemytests_task4)
+TEST(alchemytests_task5)
+TEST(alchemytests_task6)
+TEST(alchemytests_task7)
+TEST(alchemytests_task8)
+TEST(alchemytests_task9)
+TEST(alchemytests_task10)
+
diff --git a/testsuite/smokey/alchemytests/alchemytests_driver.c b/testsuite/smokey/alchemytests/alchemytests_driver.c
new file mode 100644
index 000000000..7cacbb399
--- /dev/null
+++ b/testsuite/smokey/alchemytests/alchemytests_driver.c
@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: GPL-2.0
+#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>
+
+int main(int argc, char *const argv[])
+{
+	struct smokey_test *t;
+	int ret, fails = 0;
+
+	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;
+}
diff --git a/lib/alchemy/testsuite/buffer-1.c b/testsuite/smokey/alchemytests/buffer-1.c
similarity index 98%
rename from lib/alchemy/testsuite/buffer-1.c
rename to testsuite/smokey/alchemytests/buffer-1.c
index d6d1d9ad7..fdcb5e8d7 100644
--- a/lib/alchemy/testsuite/buffer-1.c
+++ b/testsuite/smokey/alchemytests/buffer-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <memory.h>
diff --git a/lib/alchemy/testsuite/event-1.c b/testsuite/smokey/alchemytests/event-1.c
similarity index 98%
rename from lib/alchemy/testsuite/event-1.c
rename to testsuite/smokey/alchemytests/event-1.c
index 0893df36d..9ce679c71 100644
--- a/lib/alchemy/testsuite/event-1.c
+++ b/testsuite/smokey/alchemytests/event-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/heap-1.c b/testsuite/smokey/alchemytests/heap-1.c
similarity index 98%
rename from lib/alchemy/testsuite/heap-1.c
rename to testsuite/smokey/alchemytests/heap-1.c
index 48bc4a56e..f0904439f 100644
--- a/lib/alchemy/testsuite/heap-1.c
+++ b/testsuite/smokey/alchemytests/heap-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/heap-2.c b/testsuite/smokey/alchemytests/heap-2.c
similarity index 98%
rename from lib/alchemy/testsuite/heap-2.c
rename to testsuite/smokey/alchemytests/heap-2.c
index ad67afb2f..1f80db80c 100644
--- a/lib/alchemy/testsuite/heap-2.c
+++ b/testsuite/smokey/alchemytests/heap-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/mq-1.c b/testsuite/smokey/alchemytests/mq-1.c
similarity index 98%
rename from lib/alchemy/testsuite/mq-1.c
rename to testsuite/smokey/alchemytests/mq-1.c
index ac9801e72..952ff6448 100644
--- a/lib/alchemy/testsuite/mq-1.c
+++ b/testsuite/smokey/alchemytests/mq-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/mq-2.c b/testsuite/smokey/alchemytests/mq-2.c
similarity index 98%
rename from lib/alchemy/testsuite/mq-2.c
rename to testsuite/smokey/alchemytests/mq-2.c
index 9fea471b7..acc6ec051 100644
--- a/lib/alchemy/testsuite/mq-2.c
+++ b/testsuite/smokey/alchemytests/mq-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/mq-3.c b/testsuite/smokey/alchemytests/mq-3.c
similarity index 98%
rename from lib/alchemy/testsuite/mq-3.c
rename to testsuite/smokey/alchemytests/mq-3.c
index 7fcae020a..cb4c77d43 100644
--- a/lib/alchemy/testsuite/mq-3.c
+++ b/testsuite/smokey/alchemytests/mq-3.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/mutex-1.c b/testsuite/smokey/alchemytests/mutex-1.c
similarity index 98%
rename from lib/alchemy/testsuite/mutex-1.c
rename to testsuite/smokey/alchemytests/mutex-1.c
index ef58a2c86..f08665254 100644
--- a/lib/alchemy/testsuite/mutex-1.c
+++ b/testsuite/smokey/alchemytests/mutex-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/pipe-1.c b/testsuite/smokey/alchemytests/pipe-1.c
similarity index 98%
rename from lib/alchemy/testsuite/pipe-1.c
rename to testsuite/smokey/alchemytests/pipe-1.c
index 4202be2ba..4011f9c8a 100644
--- a/lib/alchemy/testsuite/pipe-1.c
+++ b/testsuite/smokey/alchemytests/pipe-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <fcntl.h>
diff --git a/lib/alchemy/testsuite/sem-1.c b/testsuite/smokey/alchemytests/sem-1.c
similarity index 98%
rename from lib/alchemy/testsuite/sem-1.c
rename to testsuite/smokey/alchemytests/sem-1.c
index 3e526eddf..080bcea9a 100644
--- a/lib/alchemy/testsuite/sem-1.c
+++ b/testsuite/smokey/alchemytests/sem-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/sem-2.c b/testsuite/smokey/alchemytests/sem-2.c
similarity index 97%
rename from lib/alchemy/testsuite/sem-2.c
rename to testsuite/smokey/alchemytests/sem-2.c
index c01f6a431..74cce2b7d 100644
--- a/lib/alchemy/testsuite/sem-2.c
+++ b/testsuite/smokey/alchemytests/sem-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/task-1.c b/testsuite/smokey/alchemytests/task-1.c
similarity index 94%
rename from lib/alchemy/testsuite/task-1.c
rename to testsuite/smokey/alchemytests/task-1.c
index 34a6c22fd..d3d9a6f7f 100644
--- a/lib/alchemy/testsuite/task-1.c
+++ b/testsuite/smokey/alchemytests/task-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/task-10.c b/testsuite/smokey/alchemytests/task-10.c
similarity index 97%
rename from lib/alchemy/testsuite/task-10.c
rename to testsuite/smokey/alchemytests/task-10.c
index 58f4cb035..c4a29ae76 100644
--- a/lib/alchemy/testsuite/task-10.c
+++ b/testsuite/smokey/alchemytests/task-10.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/task-2.c b/testsuite/smokey/alchemytests/task-2.c
similarity index 98%
rename from lib/alchemy/testsuite/task-2.c
rename to testsuite/smokey/alchemytests/task-2.c
index e751ddd34..592f2ed20 100644
--- a/lib/alchemy/testsuite/task-2.c
+++ b/testsuite/smokey/alchemytests/task-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/task-3.c b/testsuite/smokey/alchemytests/task-3.c
similarity index 97%
rename from lib/alchemy/testsuite/task-3.c
rename to testsuite/smokey/alchemytests/task-3.c
index 06f235af9..eb24935a4 100644
--- a/lib/alchemy/testsuite/task-3.c
+++ b/testsuite/smokey/alchemytests/task-3.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/task-4.c b/testsuite/smokey/alchemytests/task-4.c
similarity index 98%
rename from lib/alchemy/testsuite/task-4.c
rename to testsuite/smokey/alchemytests/task-4.c
index eba7fbb86..90e0236be 100644
--- a/lib/alchemy/testsuite/task-4.c
+++ b/testsuite/smokey/alchemytests/task-4.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/task-5.c b/testsuite/smokey/alchemytests/task-5.c
similarity index 98%
rename from lib/alchemy/testsuite/task-5.c
rename to testsuite/smokey/alchemytests/task-5.c
index 3c0fa427c..b9075945d 100644
--- a/lib/alchemy/testsuite/task-5.c
+++ b/testsuite/smokey/alchemytests/task-5.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/task-6.c b/testsuite/smokey/alchemytests/task-6.c
similarity index 97%
rename from lib/alchemy/testsuite/task-6.c
rename to testsuite/smokey/alchemytests/task-6.c
index 7c88fde9c..fa58d0fdc 100644
--- a/lib/alchemy/testsuite/task-6.c
+++ b/testsuite/smokey/alchemytests/task-6.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/task-7.c b/testsuite/smokey/alchemytests/task-7.c
similarity index 98%
rename from lib/alchemy/testsuite/task-7.c
rename to testsuite/smokey/alchemytests/task-7.c
index 1350bb39c..d118abf42 100644
--- a/lib/alchemy/testsuite/task-7.c
+++ b/testsuite/smokey/alchemytests/task-7.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/task-8.c b/testsuite/smokey/alchemytests/task-8.c
similarity index 97%
rename from lib/alchemy/testsuite/task-8.c
rename to testsuite/smokey/alchemytests/task-8.c
index bb6dfff06..959b3d3c4 100644
--- a/lib/alchemy/testsuite/task-8.c
+++ b/testsuite/smokey/alchemytests/task-8.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/task-9.c b/testsuite/smokey/alchemytests/task-9.c
similarity index 97%
rename from lib/alchemy/testsuite/task-9.c
rename to testsuite/smokey/alchemytests/task-9.c
index e358154c5..56cc7bfeb 100644
--- a/lib/alchemy/testsuite/task-9.c
+++ b/testsuite/smokey/alchemytests/task-9.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <signal.h>
-- 
2.35.3


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

* [PATCH 02/10] testsuite: Fully integrate psostests into smokey
  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-07-25  8:29             ` 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
                               ` (10 subsequent siblings)
  12 siblings, 1 reply; 112+ messages in thread
From: Aaron Marcher @ 2023-07-25  8:29 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

Just like for alchemytests, integrate them into our testsuite.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 configure.ac                                  |   2 +-
 lib/psos/testsuite/Makefile                   |  49 ------
 testsuite/Makefile.am                         |   2 -
 testsuite/smokey/Makefile.am                  |   9 +-
 testsuite/smokey/psostests/Makefile.am        | 148 ++++++++++++++++++
 .../smokey/psostests}/mq-1.c                  |   1 +
 .../smokey/psostests}/mq-2.c                  |   1 +
 .../smokey/psostests}/mq-3.c                  |   1 +
 testsuite/smokey/psostests/psostests.c        |  57 +++++++
 testsuite/smokey/psostests/psostests_driver.c |  34 ++++
 .../smokey/psostests}/pt-1.c                  |   1 +
 .../smokey/psostests}/rn-1.c                  |   1 +
 .../smokey/psostests}/sem-1.c                 |   1 +
 .../smokey/psostests}/sem-2.c                 |   1 +
 .../smokey/psostests}/task-1.c                |   1 +
 .../smokey/psostests}/task-2.c                |   1 +
 .../smokey/psostests}/task-3.c                |   1 +
 .../smokey/psostests}/task-4.c                |   1 +
 .../smokey/psostests}/task-5.c                |   1 +
 .../smokey/psostests}/task-6.c                |   1 +
 .../smokey/psostests}/task-7.c                |   1 +
 .../smokey/psostests}/task-8.c                |   1 +
 .../smokey/psostests}/task-9.c                |   1 +
 .../smokey/psostests}/tm-1.c                  |   1 +
 .../smokey/psostests}/tm-2.c                  |   1 +
 .../smokey/psostests}/tm-3.c                  |   1 +
 .../smokey/psostests}/tm-4.c                  |   1 +
 .../smokey/psostests}/tm-5.c                  |   1 +
 .../smokey/psostests}/tm-6.c                  |   1 +
 .../smokey/psostests}/tm-7.c                  |   1 +
 30 files changed, 269 insertions(+), 55 deletions(-)
 delete mode 100644 lib/psos/testsuite/Makefile
 create mode 100644 testsuite/smokey/psostests/Makefile.am
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/mq-1.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/mq-2.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/mq-3.c (98%)
 create mode 100644 testsuite/smokey/psostests/psostests.c
 create mode 100644 testsuite/smokey/psostests/psostests_driver.c
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/pt-1.c (96%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/rn-1.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/sem-1.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/sem-2.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-1.c (95%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-2.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-3.c (96%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-4.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-5.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-6.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-7.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-8.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-9.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-1.c (95%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-2.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-3.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-4.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-5.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-6.c (95%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-7.c (95%)

diff --git a/configure.ac b/configure.ac
index fe59333ed..9db5438eb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1044,9 +1044,9 @@ AC_CONFIG_FILES([ \
 	testsuite/smokey/can/Makefile \
 	testsuite/smokey/x86io/Makefile \
 	testsuite/smokey/alchemytests/Makefile \
+	testsuite/smokey/psostests/Makefile \
 	testsuite/clocktest/Makefile \
 	testsuite/xeno-test/Makefile \
-	testsuite/psostests/Makefile \
 	testsuite/vxworkstests/Makefile \
 	utils/Makefile \
 	utils/hdb/Makefile \
diff --git a/lib/psos/testsuite/Makefile b/lib/psos/testsuite/Makefile
deleted file mode 100644
index 3330a617c..000000000
--- a/lib/psos/testsuite/Makefile
+++ /dev/null
@@ -1,49 +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)
-
-ifeq ($(prefix),)
-$(error Please add <xenomai-install-path>/bin to your PATH variable or specify DESTDIR)
-endif
-
-TESTS := \
-	task-1 task-2 task-3 task-4 task-5 task-6 task-7 task-8 task-9 \
-	tm-1 tm-2 tm-3 tm-4 tm-5 tm-6 tm-7 \
-	mq-1 mq-2 mq-3 \
-	sem-1 sem-2 \
-	pt-1 \
-	rn-1
-
-CFLAGS := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --skin=psos --cflags) -g
-LDFLAGS := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --skin=psos --ldflags)
-CC = $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --cc)
-
-all: $(TESTS)
-
-%: %.c
-	$(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
-
-install: all
-	install -d $(prefix)/testsuite/psos
-	install -t $(prefix)/testsuite/psos $(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
diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
index 1be7eaba4..bb94f6ba6 100644
--- a/testsuite/Makefile.am
+++ b/testsuite/Makefile.am
@@ -8,7 +8,6 @@ SUBDIRS += 		\
 	spitest		\
 	switchtest	\
 	xeno-test	\
-	psostests	\
 	vxworkstests
 endif
 
@@ -21,5 +20,4 @@ DIST_SUBDIRS =		\
 	spitest		\
 	switchtest	\
 	xeno-test	\
-	psostests \
 	vxworkstests
diff --git a/testsuite/smokey/Makefile.am b/testsuite/smokey/Makefile.am
index 633a87387..457e22a84 100644
--- a/testsuite/smokey/Makefile.am
+++ b/testsuite/smokey/Makefile.am
@@ -41,13 +41,15 @@ COBALT_SUBDIRS = 	\
 	vdso-access 	\
 	xddp		\
 	y2038 \
-	alchemytests
+	alchemytests \
+	psostests
 
 MERCURY_SUBDIRS =	\
 	memory-heapmem	\
 	memory-tlsf	\
 	memcheck \
-	alchemytests
+	alchemytests \
+	psostests
 
 DIST_SUBDIRS = 		\
 	arith 		\
@@ -83,7 +85,8 @@ DIST_SUBDIRS = 		\
 	vdso-access 	\
 	xddp		\
 	y2038 \
-	alchemytests
+	alchemytests \
+	psostests
 
 if XENO_X86
 DIST_SUBDIRS += x86io
diff --git a/testsuite/smokey/psostests/Makefile.am b/testsuite/smokey/psostests/Makefile.am
new file mode 100644
index 000000000..bd6abc74c
--- /dev/null
+++ b/testsuite/smokey/psostests/Makefile.am
@@ -0,0 +1,148 @@
+testdir = @XENO_TEST_DIR@
+noinst_LIBRARIES = libpsostests.a
+
+libpsostests_a_SOURCES = psostests.c
+libpsostests_a_CPPFLAGS = 		\
+	@XENO_USER_CFLAGS@	\
+	-I$(top_srcdir)		\
+	-I$(top_srcdir)/include \
+	-DXENO_TEST_DIR='"$(XENO_TEST_DIR)"'
+
+CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
+
+test_PROGRAMS = \
+		psostests       \
+		psostests_mq1	\
+		psostests_mq2	\
+		psostests_mq3	\
+		psostests_pt1	\
+		psostests_rn1	\
+		psostests_sem1	\
+		psostests_sem2	\
+		psostests_tm1	\
+		psostests_tm2	\
+		psostests_tm3	\
+		psostests_tm4	\
+		psostests_tm5	\
+		psostests_tm6	\
+		psostests_tm7	\
+		psostests_task1	\
+		psostests_task2	\
+		psostests_task3	\
+		psostests_task4	\
+		psostests_task5	\
+		psostests_task6	\
+		psostests_task7	\
+		psostests_task8	\
+		psostests_task9
+
+psoscppflags = 				\
+	$(XENO_USER_CFLAGS)		\
+	-I$(top_srcdir)		\
+	-I$(top_srcdir)/include
+
+psosldadd = 					\
+	../../../lib/psos/libpsos@CORE@.la		\
+	../../../lib/copperplate/libcopperplate@CORE@.la	\
+	@XENO_CORE_LDADD@ 			\
+	@XENO_USER_LDADD@			\
+	-lpthread -lrt -lm
+
+psostests_SOURCES = psostests_driver.c
+psostests_CPPFLAGS = $(psoscppflags)
+psostests_LDADD = ../../../lib/smokey/libsmokey@CORE@.la -lpthread -lrt
+psostests_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
+psostests_mq1_SOURCES = mq-1.c
+psostests_mq1_CPPFLAGS = $(psoscppflags)
+psostests_mq1_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_mq1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_mq2_SOURCES = mq-2.c
+psostests_mq2_CPPFLAGS = $(psoscppflags)
+psostests_mq2_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_mq2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_mq3_SOURCES = mq-3.c
+psostests_mq3_CPPFLAGS = $(psoscppflags)
+psostests_mq3_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_mq3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_pt1_SOURCES = pt-1.c
+psostests_pt1_CPPFLAGS = $(psoscppflags)
+psostests_pt1_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_pt1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_rn1_SOURCES = rn-1.c
+psostests_rn1_CPPFLAGS = $(psoscppflags)
+psostests_rn1_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_rn1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_sem1_SOURCES = sem-1.c
+psostests_sem1_CPPFLAGS = $(psoscppflags)
+psostests_sem1_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_sem1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_sem2_SOURCES = sem-2.c
+psostests_sem2_CPPFLAGS = $(psoscppflags)
+psostests_sem2_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_sem2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_tm1_SOURCES = tm-1.c
+psostests_tm1_CPPFLAGS = $(psoscppflags)
+psostests_tm1_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_tm1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_tm2_SOURCES = tm-2.c
+psostests_tm2_CPPFLAGS = $(psoscppflags)
+psostests_tm2_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_tm2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_tm3_SOURCES = tm-3.c
+psostests_tm3_CPPFLAGS = $(psoscppflags)
+psostests_tm3_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_tm3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_tm4_SOURCES = tm-4.c
+psostests_tm4_CPPFLAGS = $(psoscppflags)
+psostests_tm4_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_tm4_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_tm5_SOURCES = tm-5.c
+psostests_tm5_CPPFLAGS = $(psoscppflags)
+psostests_tm5_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_tm5_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_tm6_SOURCES = tm-6.c
+psostests_tm6_CPPFLAGS = $(psoscppflags)
+psostests_tm6_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_tm6_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_tm7_SOURCES = tm-7.c
+psostests_tm7_CPPFLAGS = $(psoscppflags)
+psostests_tm7_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_tm7_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task1_SOURCES = task-1.c
+psostests_task1_CPPFLAGS = $(psoscppflags)
+psostests_task1_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_task1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task2_SOURCES = task-2.c
+psostests_task2_CPPFLAGS = $(psoscppflags)
+psostests_task2_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_task2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task3_SOURCES = task-3.c
+psostests_task3_CPPFLAGS = $(psoscppflags)
+psostests_task3_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_task3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task4_SOURCES = task-4.c
+psostests_task4_CPPFLAGS = $(psoscppflags)
+psostests_task4_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_task4_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task5_SOURCES = task-5.c
+psostests_task5_CPPFLAGS = $(psoscppflags)
+psostests_task5_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_task5_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task6_SOURCES = task-6.c
+psostests_task6_CPPFLAGS = $(psoscppflags)
+psostests_task6_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_task6_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task7_SOURCES = task-7.c
+psostests_task7_CPPFLAGS = $(psoscppflags)
+psostests_task7_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_task7_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task8_SOURCES = task-8.c
+psostests_task8_CPPFLAGS = $(psoscppflags)
+psostests_task8_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_task8_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task9_SOURCES = task-9.c
+psostests_task9_CPPFLAGS = $(psoscppflags)
+psostests_task9_LDADD = $(psosldadd) -lpthread -lrt -lm
+psostests_task9_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
diff --git a/lib/psos/testsuite/mq-1.c b/testsuite/smokey/psostests/mq-1.c
similarity index 97%
rename from lib/psos/testsuite/mq-1.c
rename to testsuite/smokey/psostests/mq-1.c
index 00f424898..83a24028e 100644
--- a/lib/psos/testsuite/mq-1.c
+++ b/testsuite/smokey/psostests/mq-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/mq-2.c b/testsuite/smokey/psostests/mq-2.c
similarity index 98%
rename from lib/psos/testsuite/mq-2.c
rename to testsuite/smokey/psostests/mq-2.c
index 48b4e611c..8af8b42d6 100644
--- a/lib/psos/testsuite/mq-2.c
+++ b/testsuite/smokey/psostests/mq-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/mq-3.c b/testsuite/smokey/psostests/mq-3.c
similarity index 98%
rename from lib/psos/testsuite/mq-3.c
rename to testsuite/smokey/psostests/mq-3.c
index 942b1a325..1171a7054 100644
--- a/lib/psos/testsuite/mq-3.c
+++ b/testsuite/smokey/psostests/mq-3.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/testsuite/smokey/psostests/psostests.c b/testsuite/smokey/psostests/psostests.c
new file mode 100644
index 000000000..254a1515c
--- /dev/null
+++ b/testsuite/smokey/psostests/psostests.c
@@ -0,0 +1,57 @@
+// SPDX-License-Identifier: GPL-2.0
+#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>
+
+#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", XENO_TEST_DIR, t->name);
+	if (ret == -1)
+		return -ENOMEM;
+
+	ret = system(tst_path);
+	free(tst_path);
+
+	return ret;
+}
+
+TEST(psostests)
+TEST(psostests_mq1)
+TEST(psostests_mq2)
+TEST(psostests_mq3)
+TEST(psostests_pt1)
+TEST(psostests_rn1)
+TEST(psostests_sem1)
+TEST(psostests_sem2)
+TEST(psostests_task1)
+TEST(psostests_task2)
+TEST(psostests_task3)
+TEST(psostests_task4)
+TEST(psostests_task5)
+TEST(psostests_task6)
+TEST(psostests_task7)
+TEST(psostests_task8)
+TEST(psostests_task9)
+TEST(psostests_tm1)
+TEST(psostests_tm2)
+TEST(psostests_tm3)
+TEST(psostests_tm4)
+TEST(psostests_tm5)
+TEST(psostests_tm6)
+TEST(psostests_tm7)
+
diff --git a/testsuite/smokey/psostests/psostests_driver.c b/testsuite/smokey/psostests/psostests_driver.c
new file mode 100644
index 000000000..dd9eafc42
--- /dev/null
+++ b/testsuite/smokey/psostests/psostests_driver.c
@@ -0,0 +1,34 @@
+// SPDX-License-Identifier: GPL-2.0
+#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>
+
+int main(int argc, char *const argv[])
+{
+       struct smokey_test *t;
+       int ret, fails = 0;
+
+       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;
+}
+
diff --git a/lib/psos/testsuite/pt-1.c b/testsuite/smokey/psostests/pt-1.c
similarity index 96%
rename from lib/psos/testsuite/pt-1.c
rename to testsuite/smokey/psostests/pt-1.c
index 99f93ca1a..48f9799f7 100644
--- a/lib/psos/testsuite/pt-1.c
+++ b/testsuite/smokey/psostests/pt-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <memory.h>
diff --git a/lib/psos/testsuite/rn-1.c b/testsuite/smokey/psostests/rn-1.c
similarity index 97%
rename from lib/psos/testsuite/rn-1.c
rename to testsuite/smokey/psostests/rn-1.c
index da136f381..42f86a7ea 100644
--- a/lib/psos/testsuite/rn-1.c
+++ b/testsuite/smokey/psostests/rn-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <memory.h>
diff --git a/lib/psos/testsuite/sem-1.c b/testsuite/smokey/psostests/sem-1.c
similarity index 98%
rename from lib/psos/testsuite/sem-1.c
rename to testsuite/smokey/psostests/sem-1.c
index 61fa4b605..d32334c02 100644
--- a/lib/psos/testsuite/sem-1.c
+++ b/testsuite/smokey/psostests/sem-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/sem-2.c b/testsuite/smokey/psostests/sem-2.c
similarity index 97%
rename from lib/psos/testsuite/sem-2.c
rename to testsuite/smokey/psostests/sem-2.c
index a15bc388f..8223434f5 100644
--- a/lib/psos/testsuite/sem-2.c
+++ b/testsuite/smokey/psostests/sem-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/task-1.c b/testsuite/smokey/psostests/task-1.c
similarity index 95%
rename from lib/psos/testsuite/task-1.c
rename to testsuite/smokey/psostests/task-1.c
index f4bb71b7e..a0e6efa97 100644
--- a/lib/psos/testsuite/task-1.c
+++ b/testsuite/smokey/psostests/task-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/task-2.c b/testsuite/smokey/psostests/task-2.c
similarity index 98%
rename from lib/psos/testsuite/task-2.c
rename to testsuite/smokey/psostests/task-2.c
index d7f9fa06f..d24c13465 100644
--- a/lib/psos/testsuite/task-2.c
+++ b/testsuite/smokey/psostests/task-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/task-3.c b/testsuite/smokey/psostests/task-3.c
similarity index 96%
rename from lib/psos/testsuite/task-3.c
rename to testsuite/smokey/psostests/task-3.c
index d775f2823..d13e30423 100644
--- a/lib/psos/testsuite/task-3.c
+++ b/testsuite/smokey/psostests/task-3.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/task-4.c b/testsuite/smokey/psostests/task-4.c
similarity index 97%
rename from lib/psos/testsuite/task-4.c
rename to testsuite/smokey/psostests/task-4.c
index 3bca00271..ec6a99609 100644
--- a/lib/psos/testsuite/task-4.c
+++ b/testsuite/smokey/psostests/task-4.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/task-5.c b/testsuite/smokey/psostests/task-5.c
similarity index 98%
rename from lib/psos/testsuite/task-5.c
rename to testsuite/smokey/psostests/task-5.c
index e0124c12b..dcb8ec6ea 100644
--- a/lib/psos/testsuite/task-5.c
+++ b/testsuite/smokey/psostests/task-5.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/task-6.c b/testsuite/smokey/psostests/task-6.c
similarity index 98%
rename from lib/psos/testsuite/task-6.c
rename to testsuite/smokey/psostests/task-6.c
index 13c618c57..9cc46e633 100644
--- a/lib/psos/testsuite/task-6.c
+++ b/testsuite/smokey/psostests/task-6.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/task-7.c b/testsuite/smokey/psostests/task-7.c
similarity index 97%
rename from lib/psos/testsuite/task-7.c
rename to testsuite/smokey/psostests/task-7.c
index 8f5441afa..9177dbbf4 100644
--- a/lib/psos/testsuite/task-7.c
+++ b/testsuite/smokey/psostests/task-7.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/task-8.c b/testsuite/smokey/psostests/task-8.c
similarity index 98%
rename from lib/psos/testsuite/task-8.c
rename to testsuite/smokey/psostests/task-8.c
index d7c8fb33d..4543a04fa 100644
--- a/lib/psos/testsuite/task-8.c
+++ b/testsuite/smokey/psostests/task-8.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <xeno_config.h>
diff --git a/lib/psos/testsuite/task-9.c b/testsuite/smokey/psostests/task-9.c
similarity index 98%
rename from lib/psos/testsuite/task-9.c
rename to testsuite/smokey/psostests/task-9.c
index 1ae992999..f37d6736e 100644
--- a/lib/psos/testsuite/task-9.c
+++ b/testsuite/smokey/psostests/task-9.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/tm-1.c b/testsuite/smokey/psostests/tm-1.c
similarity index 95%
rename from lib/psos/testsuite/tm-1.c
rename to testsuite/smokey/psostests/tm-1.c
index b2f38f298..64605d8b9 100644
--- a/lib/psos/testsuite/tm-1.c
+++ b/testsuite/smokey/psostests/tm-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/tm-2.c b/testsuite/smokey/psostests/tm-2.c
similarity index 97%
rename from lib/psos/testsuite/tm-2.c
rename to testsuite/smokey/psostests/tm-2.c
index 44340f5dd..18ddff4b6 100644
--- a/lib/psos/testsuite/tm-2.c
+++ b/testsuite/smokey/psostests/tm-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/tm-3.c b/testsuite/smokey/psostests/tm-3.c
similarity index 97%
rename from lib/psos/testsuite/tm-3.c
rename to testsuite/smokey/psostests/tm-3.c
index 260a1314e..f5a947f46 100644
--- a/lib/psos/testsuite/tm-3.c
+++ b/testsuite/smokey/psostests/tm-3.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/tm-4.c b/testsuite/smokey/psostests/tm-4.c
similarity index 97%
rename from lib/psos/testsuite/tm-4.c
rename to testsuite/smokey/psostests/tm-4.c
index 26697c2fb..2c8c7a318 100644
--- a/lib/psos/testsuite/tm-4.c
+++ b/testsuite/smokey/psostests/tm-4.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/tm-5.c b/testsuite/smokey/psostests/tm-5.c
similarity index 97%
rename from lib/psos/testsuite/tm-5.c
rename to testsuite/smokey/psostests/tm-5.c
index 0fca7d023..d13613398 100644
--- a/lib/psos/testsuite/tm-5.c
+++ b/testsuite/smokey/psostests/tm-5.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/tm-6.c b/testsuite/smokey/psostests/tm-6.c
similarity index 95%
rename from lib/psos/testsuite/tm-6.c
rename to testsuite/smokey/psostests/tm-6.c
index 9debc498c..ba92c3071 100644
--- a/lib/psos/testsuite/tm-6.c
+++ b/testsuite/smokey/psostests/tm-6.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/tm-7.c b/testsuite/smokey/psostests/tm-7.c
similarity index 95%
rename from lib/psos/testsuite/tm-7.c
rename to testsuite/smokey/psostests/tm-7.c
index 202985daa..367650278 100644
--- a/lib/psos/testsuite/tm-7.c
+++ b/testsuite/smokey/psostests/tm-7.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
-- 
2.35.3


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

* [PATCH 03/10] testsuite: Fully integrate vwworkstests into smokey
  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-07-25  8:29             ` [PATCH 02/10] testsuite: Fully integrate psostests " Aaron Marcher
@ 2023-07-25  8:29             ` Aaron Marcher
  2023-08-09 11:32               ` [PATCH v7 " Jan Kiszka
  2023-07-25  8:29             ` [PATCH 04/10] testsuite: Remove old alchemytests Makefile Aaron Marcher
                               ` (9 subsequent siblings)
  12 siblings, 1 reply; 112+ messages in thread
From: Aaron Marcher @ 2023-07-25  8:29 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

Same as for alchemytests and psostests.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 configure.ac                                  |  2 +-
 lib/vxworks/testsuite/Makefile                | 43 ---------
 testsuite/Makefile.am                         |  6 +-
 testsuite/smokey/Makefile.am                  |  3 +
 testsuite/smokey/vxworkstests/Makefile.am     | 94 +++++++++++++++++++
 .../smokey/vxworkstests}/lst-1.c              |  1 +
 .../smokey/vxworkstests}/msgQ-1.c             |  1 +
 .../smokey/vxworkstests}/msgQ-2.c             |  1 +
 .../smokey/vxworkstests}/msgQ-3.c             |  1 +
 .../smokey/vxworkstests}/rng-1.c              |  1 +
 .../smokey/vxworkstests}/sem-1.c              |  1 +
 .../smokey/vxworkstests}/sem-2.c              |  1 +
 .../smokey/vxworkstests}/sem-3.c              |  1 +
 .../smokey/vxworkstests}/sem-4.c              |  1 +
 .../smokey/vxworkstests}/task-1.c             |  1 +
 .../smokey/vxworkstests}/task-2.c             |  1 +
 testsuite/smokey/vxworkstests/vxworkstests.c  | 46 +++++++++
 .../smokey/vxworkstests/vxworkstests_driver.c | 33 +++++++
 .../smokey/vxworkstests}/wd-1.c               |  1 +
 19 files changed, 191 insertions(+), 48 deletions(-)
 delete mode 100644 lib/vxworks/testsuite/Makefile
 create mode 100644 testsuite/smokey/vxworkstests/Makefile.am
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/lst-1.c (99%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-1.c (98%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-2.c (98%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-3.c (98%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/rng-1.c (99%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-1.c (98%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-2.c (98%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-3.c (97%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-4.c (98%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/task-1.c (96%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/task-2.c (98%)
 create mode 100644 testsuite/smokey/vxworkstests/vxworkstests.c
 create mode 100644 testsuite/smokey/vxworkstests/vxworkstests_driver.c
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/wd-1.c (97%)

diff --git a/configure.ac b/configure.ac
index 9db5438eb..a601f94cd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1045,9 +1045,9 @@ AC_CONFIG_FILES([ \
 	testsuite/smokey/x86io/Makefile \
 	testsuite/smokey/alchemytests/Makefile \
 	testsuite/smokey/psostests/Makefile \
+	testsuite/smokey/vxworkstests/Makefile \
 	testsuite/clocktest/Makefile \
 	testsuite/xeno-test/Makefile \
-	testsuite/vxworkstests/Makefile \
 	utils/Makefile \
 	utils/hdb/Makefile \
 	utils/can/Makefile \
diff --git a/lib/vxworks/testsuite/Makefile b/lib/vxworks/testsuite/Makefile
deleted file mode 100644
index 648c9be90..000000000
--- a/lib/vxworks/testsuite/Makefile
+++ /dev/null
@@ -1,43 +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)
-
-ifeq ($(prefix),)
-$(error Please add <xenomai-install-path>/bin to your PATH variable or specify DESTDIR)
-endif
-
-TESTS := task-1 task-2 msgQ-1 msgQ-2 msgQ-3 wd-1 sem-1 sem-2 sem-3 sem-4 lst-1 rng-1
-
-CFLAGS := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --skin=vxworks --cflags) -g
-LDFLAGS := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --skin=vxworks --ldflags)
-CC = $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --cc)
-
-all: $(TESTS)
-
-%: %.c
-	$(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
-
-install: all
-	install -d $(prefix)/testsuite/vxworks
-	install -t $(prefix)/testsuite/vxworks $(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
diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
index bb94f6ba6..4932f6d33 100644
--- a/testsuite/Makefile.am
+++ b/testsuite/Makefile.am
@@ -7,8 +7,7 @@ SUBDIRS += 		\
 	gpiotest	\
 	spitest		\
 	switchtest	\
-	xeno-test	\
-	vxworkstests
+	xeno-test
 endif
 
 DIST_SUBDIRS =		\
@@ -19,5 +18,4 @@ DIST_SUBDIRS =		\
 	smokey		\
 	spitest		\
 	switchtest	\
-	xeno-test	\
-	vxworkstests
+	xeno-test
diff --git a/testsuite/smokey/Makefile.am b/testsuite/smokey/Makefile.am
index 457e22a84..888e83b1c 100644
--- a/testsuite/smokey/Makefile.am
+++ b/testsuite/smokey/Makefile.am
@@ -42,6 +42,7 @@ COBALT_SUBDIRS = 	\
 	xddp		\
 	y2038 \
 	alchemytests \
+	vxworkstests \
 	psostests
 
 MERCURY_SUBDIRS =	\
@@ -49,6 +50,7 @@ MERCURY_SUBDIRS =	\
 	memory-tlsf	\
 	memcheck \
 	alchemytests \
+	vxworkstests \
 	psostests
 
 DIST_SUBDIRS = 		\
@@ -86,6 +88,7 @@ DIST_SUBDIRS = 		\
 	xddp		\
 	y2038 \
 	alchemytests \
+	vxworkstests \
 	psostests
 
 if XENO_X86
diff --git a/testsuite/smokey/vxworkstests/Makefile.am b/testsuite/smokey/vxworkstests/Makefile.am
new file mode 100644
index 000000000..ba942c455
--- /dev/null
+++ b/testsuite/smokey/vxworkstests/Makefile.am
@@ -0,0 +1,94 @@
+testdir = @XENO_TEST_DIR@
+noinst_LIBRARIES = libvxworkstests.a
+
+libvxworkstests_a_SOURCES = vxworkstests.c
+libvxworkstests_a_CPPFLAGS = 		\
+	@XENO_USER_CFLAGS@	\
+	-I$(top_srcdir)		\
+	-I$(top_srcdir)/include \
+	-DXENO_TEST_DIR='"$(XENO_TEST_DIR)"'
+
+CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
+
+test_PROGRAMS = \
+		vxworkstests \
+		vxworkstests_lst1	\
+		vxworkstests_msgQ1	\
+		vxworkstests_msgQ2	\
+		vxworkstests_msgQ3	\
+		vxworkstests_rng1	\
+		vxworkstests_sem1	\
+		vxworkstests_sem2	\
+		vxworkstests_sem3	\
+		vxworkstests_sem4	\
+		vxworkstests_wd1	\
+		vxworkstests_task1	\
+		vxworkstests_task2
+
+vxworkscppflags = 				\
+	$(XENO_USER_CFLAGS)		\
+	-I$(top_srcdir)/include
+
+vxworksldadd = 					\
+	../../../lib/vxworks/libvxworks@CORE@.la		\
+	../../../lib/copperplate/libcopperplate@CORE@.la	\
+	@XENO_CORE_LDADD@ 			\
+	@XENO_USER_LDADD@			\
+	-lpthread -lrt -lm
+
+vxworkstests_SOURCES = vxworkstests_driver.c
+vxworkstests_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_LDADD =			\
+	../../../lib/smokey/libsmokey@CORE@.la	\
+	-lpthread -lrt
+
+vxworkstests_lst1_SOURCES = lst-1.c
+vxworkstests_lst1_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_lst1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_lst1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_task1_SOURCES = task-1.c
+vxworkstests_task1_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_task1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_task1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_task2_SOURCES = task-2.c
+vxworkstests_task2_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_task2_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_task2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_msgQ1_SOURCES = msgQ-1.c
+vxworkstests_msgQ1_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_msgQ1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_msgQ1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_msgQ2_SOURCES = msgQ-2.c
+vxworkstests_msgQ2_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_msgQ2_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_msgQ2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_msgQ3_SOURCES = msgQ-3.c
+vxworkstests_msgQ3_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_msgQ3_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_msgQ3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_rng1_SOURCES = rng-1.c
+vxworkstests_rng1_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_rng1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_rng1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_sem1_SOURCES = sem-1.c
+vxworkstests_sem1_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_sem1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_sem1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_sem2_SOURCES = sem-2.c
+vxworkstests_sem2_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_sem2_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_sem2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_sem3_SOURCES = sem-3.c
+vxworkstests_sem3_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_sem3_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_sem3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_sem4_SOURCES = sem-4.c
+vxworkstests_sem4_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_sem4_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_sem4_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_wd1_SOURCES = wd-1.c
+vxworkstests_wd1_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_wd1_LDADD = $(vxworksldadd) -lpthread -lrt -lm
+vxworkstests_wd1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+
diff --git a/lib/vxworks/testsuite/lst-1.c b/testsuite/smokey/vxworkstests/lst-1.c
similarity index 99%
rename from lib/vxworks/testsuite/lst-1.c
rename to testsuite/smokey/vxworkstests/lst-1.c
index 03dec367d..878f32c90 100644
--- a/lib/vxworks/testsuite/lst-1.c
+++ b/testsuite/smokey/vxworkstests/lst-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/vxworks/testsuite/msgQ-1.c b/testsuite/smokey/vxworkstests/msgQ-1.c
similarity index 98%
rename from lib/vxworks/testsuite/msgQ-1.c
rename to testsuite/smokey/vxworkstests/msgQ-1.c
index fd15e1ddd..71eedd44f 100644
--- a/lib/vxworks/testsuite/msgQ-1.c
+++ b/testsuite/smokey/vxworkstests/msgQ-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/vxworks/testsuite/msgQ-2.c b/testsuite/smokey/vxworkstests/msgQ-2.c
similarity index 98%
rename from lib/vxworks/testsuite/msgQ-2.c
rename to testsuite/smokey/vxworkstests/msgQ-2.c
index 58f11e3a1..d3ee1397c 100644
--- a/lib/vxworks/testsuite/msgQ-2.c
+++ b/testsuite/smokey/vxworkstests/msgQ-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/vxworks/testsuite/msgQ-3.c b/testsuite/smokey/vxworkstests/msgQ-3.c
similarity index 98%
rename from lib/vxworks/testsuite/msgQ-3.c
rename to testsuite/smokey/vxworkstests/msgQ-3.c
index 1a4e20d26..a23d5c3d0 100644
--- a/lib/vxworks/testsuite/msgQ-3.c
+++ b/testsuite/smokey/vxworkstests/msgQ-3.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/vxworks/testsuite/rng-1.c b/testsuite/smokey/vxworkstests/rng-1.c
similarity index 99%
rename from lib/vxworks/testsuite/rng-1.c
rename to testsuite/smokey/vxworkstests/rng-1.c
index dd944a58a..1e179c6f6 100644
--- a/lib/vxworks/testsuite/rng-1.c
+++ b/testsuite/smokey/vxworkstests/rng-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
diff --git a/lib/vxworks/testsuite/sem-1.c b/testsuite/smokey/vxworkstests/sem-1.c
similarity index 98%
rename from lib/vxworks/testsuite/sem-1.c
rename to testsuite/smokey/vxworkstests/sem-1.c
index 245eb5c48..b64aba3b8 100644
--- a/lib/vxworks/testsuite/sem-1.c
+++ b/testsuite/smokey/vxworkstests/sem-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/vxworks/testsuite/sem-2.c b/testsuite/smokey/vxworkstests/sem-2.c
similarity index 98%
rename from lib/vxworks/testsuite/sem-2.c
rename to testsuite/smokey/vxworkstests/sem-2.c
index c9befc4d9..67caf2924 100644
--- a/lib/vxworks/testsuite/sem-2.c
+++ b/testsuite/smokey/vxworkstests/sem-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/vxworks/testsuite/sem-3.c b/testsuite/smokey/vxworkstests/sem-3.c
similarity index 97%
rename from lib/vxworks/testsuite/sem-3.c
rename to testsuite/smokey/vxworkstests/sem-3.c
index 1041d25b0..1f4252e3d 100644
--- a/lib/vxworks/testsuite/sem-3.c
+++ b/testsuite/smokey/vxworkstests/sem-3.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/vxworks/testsuite/sem-4.c b/testsuite/smokey/vxworkstests/sem-4.c
similarity index 98%
rename from lib/vxworks/testsuite/sem-4.c
rename to testsuite/smokey/vxworkstests/sem-4.c
index 5c82169e1..0a8daedb1 100644
--- a/lib/vxworks/testsuite/sem-4.c
+++ b/testsuite/smokey/vxworkstests/sem-4.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/vxworks/testsuite/task-1.c b/testsuite/smokey/vxworkstests/task-1.c
similarity index 96%
rename from lib/vxworks/testsuite/task-1.c
rename to testsuite/smokey/vxworkstests/task-1.c
index 3cf5f3806..a07d643c3 100644
--- a/lib/vxworks/testsuite/task-1.c
+++ b/testsuite/smokey/vxworkstests/task-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/vxworks/testsuite/task-2.c b/testsuite/smokey/vxworkstests/task-2.c
similarity index 98%
rename from lib/vxworks/testsuite/task-2.c
rename to testsuite/smokey/vxworkstests/task-2.c
index 46d99a266..7f9f0f002 100644
--- a/lib/vxworks/testsuite/task-2.c
+++ b/testsuite/smokey/vxworkstests/task-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/testsuite/smokey/vxworkstests/vxworkstests.c b/testsuite/smokey/vxworkstests/vxworkstests.c
new file mode 100644
index 000000000..e244c4d98
--- /dev/null
+++ b/testsuite/smokey/vxworkstests/vxworkstests.c
@@ -0,0 +1,46 @@
+// SPDX-License-Identifier: GPL-2.0
+#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>
+
+#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", XENO_TEST_DIR, t->name);
+	if (ret == -1)
+		return -ENOMEM;
+
+	ret = system(tst_path);
+	free(tst_path);
+
+	return ret;
+}
+
+TEST(vxworkstests)
+TEST(vxworkstests_lst1)
+TEST(vxworkstests_msgQ1)
+TEST(vxworkstests_msgQ2)
+TEST(vxworkstests_msgQ3)
+TEST(vxworkstests_rng1)
+TEST(vxworkstests_sem1)
+TEST(vxworkstests_sem2)
+TEST(vxworkstests_sem3)
+TEST(vxworkstests_sem4)
+TEST(vxworkstests_wd1)
+TEST(vxworkstests_task1)
+TEST(vxworkstests_task2)
+
diff --git a/testsuite/smokey/vxworkstests/vxworkstests_driver.c b/testsuite/smokey/vxworkstests/vxworkstests_driver.c
new file mode 100644
index 000000000..7cacbb399
--- /dev/null
+++ b/testsuite/smokey/vxworkstests/vxworkstests_driver.c
@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: GPL-2.0
+#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>
+
+int main(int argc, char *const argv[])
+{
+	struct smokey_test *t;
+	int ret, fails = 0;
+
+	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;
+}
diff --git a/lib/vxworks/testsuite/wd-1.c b/testsuite/smokey/vxworkstests/wd-1.c
similarity index 97%
rename from lib/vxworks/testsuite/wd-1.c
rename to testsuite/smokey/vxworkstests/wd-1.c
index b557545e8..7da5d4dcb 100644
--- a/lib/vxworks/testsuite/wd-1.c
+++ b/testsuite/smokey/vxworkstests/wd-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
-- 
2.35.3


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

* [PATCH 04/10] testsuite: Remove old alchemytests Makefile
  2023-07-25  8:29           ` [PATCH v6 00/10] Revive alchemy, pSOS and VxWorks tests Aaron Marcher
                               ` (2 preceding siblings ...)
  2023-07-25  8:29             ` [PATCH 03/10] testsuite: Fully integrate vwworkstests " Aaron Marcher
@ 2023-07-25  8:29             ` Aaron Marcher
  2023-07-25  8:29             ` [PATCH 05/10] alchemytests: Fix gcc warning in buffer-1 Aaron Marcher
                               ` (8 subsequent siblings)
  12 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-07-25  8:29 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

From: Richard Weinberger <richard@nod.at>

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Aaron Marcher <aaron@sigma-star.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.35.3


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

* [PATCH 05/10] alchemytests: Fix gcc warning in buffer-1
  2023-07-25  8:29           ` [PATCH v6 00/10] Revive alchemy, pSOS and VxWorks tests Aaron Marcher
                               ` (3 preceding siblings ...)
  2023-07-25  8:29             ` [PATCH 04/10] testsuite: Remove old alchemytests Makefile Aaron Marcher
@ 2023-07-25  8:29             ` Aaron Marcher
  2023-07-25  8:29             ` [PATCH 06/10] alchemytests: Fix gcc warning in task-9 Aaron Marcher
                               ` (7 subsequent siblings)
  12 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-07-25  8:29 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

From: Richard Weinberger <richard@nod.at>

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>
Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 testsuite/smokey/alchemytests/buffer-1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testsuite/smokey/alchemytests/buffer-1.c b/testsuite/smokey/alchemytests/buffer-1.c
index fdcb5e8d7..008797827 100644
--- a/testsuite/smokey/alchemytests/buffer-1.c
+++ b/testsuite/smokey/alchemytests/buffer-1.c
@@ -50,7 +50,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.35.3


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

* [PATCH 06/10] alchemytests: Fix gcc warning in task-9
  2023-07-25  8:29           ` [PATCH v6 00/10] Revive alchemy, pSOS and VxWorks tests Aaron Marcher
                               ` (4 preceding siblings ...)
  2023-07-25  8:29             ` [PATCH 05/10] alchemytests: Fix gcc warning in buffer-1 Aaron Marcher
@ 2023-07-25  8:29             ` Aaron Marcher
  2023-07-25  8:29             ` [PATCH 07/10] alchemytests: Check pipe-1 asprintf ret value Aaron Marcher
                               ` (6 subsequent siblings)
  12 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-07-25  8:29 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

From: Richard Weinberger <richard@nod.at>

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>
Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 testsuite/smokey/alchemytests/task-9.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testsuite/smokey/alchemytests/task-9.c b/testsuite/smokey/alchemytests/task-9.c
index 56cc7bfeb..9bb43efbd 100644
--- a/testsuite/smokey/alchemytests/task-9.c
+++ b/testsuite/smokey/alchemytests/task-9.c
@@ -11,7 +11,7 @@ static RT_TASK t_test;
 
 #define ONE_SECOND  1000000000ULL
 
-void sighandler(int sig)
+static void sighandler(int sig)
 {
 	/* nop */
 }
-- 
2.35.3


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

* [PATCH 07/10] alchemytests: Check pipe-1 asprintf ret value
  2023-07-25  8:29           ` [PATCH v6 00/10] Revive alchemy, pSOS and VxWorks tests Aaron Marcher
                               ` (5 preceding siblings ...)
  2023-07-25  8:29             ` [PATCH 06/10] alchemytests: Fix gcc warning in task-9 Aaron Marcher
@ 2023-07-25  8:29             ` Aaron Marcher
  2023-07-25  8:29             ` [PATCH 08/10] alchemytests: Fix task-2 Aaron Marcher
                               ` (5 subsequent siblings)
  12 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-07-25  8:29 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 testsuite/smokey/alchemytests/pipe-1.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/testsuite/smokey/alchemytests/pipe-1.c b/testsuite/smokey/alchemytests/pipe-1.c
index 4011f9c8a..488c0ee3b 100644
--- a/testsuite/smokey/alchemytests/pipe-1.c
+++ b/testsuite/smokey/alchemytests/pipe-1.c
@@ -49,11 +49,13 @@ static void realtime_task(void *arg)
 static void *regular_thread(void *arg)
 {
 	struct pipe_message m;
-	int fd, seq = 0;
+	int fd, res, seq = 0;
 	ssize_t ret;
 	char *rtp;
 
-	asprintf(&rtp, "/dev/rtp%d", minor);
+	res = asprintf(&rtp, "/dev/rtp%d", minor);
+	if (res < 0)
+		return NULL;
 
 	fd = open(rtp, O_RDWR);
 	free(rtp);
-- 
2.35.3


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

* [PATCH 08/10] alchemytests: Fix task-2
  2023-07-25  8:29           ` [PATCH v6 00/10] Revive alchemy, pSOS and VxWorks tests Aaron Marcher
                               ` (6 preceding siblings ...)
  2023-07-25  8:29             ` [PATCH 07/10] alchemytests: Check pipe-1 asprintf ret value Aaron Marcher
@ 2023-07-25  8:29             ` Aaron Marcher
  2023-07-25  8:29             ` [PATCH 09/10] alchemytests: Fix task-5 logic Aaron Marcher
                               ` (4 subsequent siblings)
  12 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-07-25  8:29 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

task-2 seems to suffer from modern gcc, changes to safety and count are dead
stores. Uses a compiler barrier to mitigate this behaviour.

https://lore.kernel.org/xenomai/2065449276.254073.1649941119506.JavaMail.zimbra@nod.at/

Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 testsuite/smokey/alchemytests/task-2.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/testsuite/smokey/alchemytests/task-2.c b/testsuite/smokey/alchemytests/task-2.c
index 592f2ed20..1284a8b61 100644
--- a/testsuite/smokey/alchemytests/task-2.c
+++ b/testsuite/smokey/alchemytests/task-2.c
@@ -29,8 +29,10 @@ static void background_task(void *arg)
 
 	traceobj_mark(&trobj, 2);
 
-	while (--safety > 0)
+	while (--safety > 0) {
+		compiler_barrier();
 		count++;
+	}
 
 	traceobj_exit(&trobj);
 }
-- 
2.35.3


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

* [PATCH 09/10] alchemytests: Fix task-5 logic
  2023-07-25  8:29           ` [PATCH v6 00/10] Revive alchemy, pSOS and VxWorks tests Aaron Marcher
                               ` (7 preceding siblings ...)
  2023-07-25  8:29             ` [PATCH 08/10] alchemytests: Fix task-2 Aaron Marcher
@ 2023-07-25  8:29             ` Aaron Marcher
  2023-07-25  8:29             ` [PATCH 10/10] testsuite: disable broken tests Aaron Marcher
                               ` (3 subsequent siblings)
  12 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-07-25  8:29 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

Semaphore call in wrong logical order, so that on the second
rt_task_set_priority call the task doesn't exist anymore and thus the
call fails with EINVAL.

This commit fixes the order so that the test passes again.

Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 testsuite/smokey/alchemytests/task-5.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/testsuite/smokey/alchemytests/task-5.c b/testsuite/smokey/alchemytests/task-5.c
index b9075945d..2aecd8125 100644
--- a/testsuite/smokey/alchemytests/task-5.c
+++ b/testsuite/smokey/alchemytests/task-5.c
@@ -45,17 +45,17 @@ static void foreground_task(void *arg)
 
 	traceobj_mark(&trobj, 4);
 
-	ret = rt_sem_v(&sem);
-	traceobj_check(&trobj, ret, 0);
+	ret = rt_task_inquire(NULL, &info);
+	traceobj_assert(&trobj, ret == 0 && info.prio == 21);
 
 	traceobj_mark(&trobj, 5);
 
-	ret = rt_task_inquire(NULL, &info);
-	traceobj_assert(&trobj, ret == 0 && info.prio == 21);
+	ret = rt_task_set_priority(&t_bgnd, info.prio);
+	traceobj_check(&trobj, ret, 0);
 
 	traceobj_mark(&trobj, 6);
 
-	ret = rt_task_set_priority(&t_bgnd, info.prio);
+	ret = rt_sem_v(&sem);
 	traceobj_check(&trobj, ret, 0);
 
 	traceobj_mark(&trobj, 7);
-- 
2.35.3


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

* [PATCH 10/10] testsuite: disable broken tests
  2023-07-25  8:29           ` [PATCH v6 00/10] Revive alchemy, pSOS and VxWorks tests Aaron Marcher
                               ` (8 preceding siblings ...)
  2023-07-25  8:29             ` [PATCH 09/10] alchemytests: Fix task-5 logic Aaron Marcher
@ 2023-07-25  8:29             ` Aaron Marcher
  2023-08-03 15:35             ` [PATCH v6 00/10] Revive alchemy, pSOS and VxWorks tests Florian Bezdeka
                               ` (2 subsequent siblings)
  12 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-07-25  8:29 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

as discussed on the mailing list, disable broken tests (for now)

Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 testsuite/smokey/psostests/psostests.c | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/testsuite/smokey/psostests/psostests.c b/testsuite/smokey/psostests/psostests.c
index 254a1515c..f315c1d55 100644
--- a/testsuite/smokey/psostests/psostests.c
+++ b/testsuite/smokey/psostests/psostests.c
@@ -35,18 +35,30 @@ TEST(psostests_mq1)
 TEST(psostests_mq2)
 TEST(psostests_mq3)
 TEST(psostests_pt1)
-TEST(psostests_rn1)
+// 0"000.679| BUG in __traceobj_assert_failed(): [rn1] trace assertion failed:
+//            testsuite/psostests/rn-1.c:46
+// => "ret == 0"
+//TEST(psostests_rn1)
 TEST(psostests_sem1)
 TEST(psostests_sem2)
 TEST(psostests_task1)
-TEST(psostests_task2)
+// 0"014.452| BUG in __traceobj_assert_failed(): [FGND] trace assertion failed:
+//            ../../../../../../../../../workspace/sources/xenomai/testsuite/smokey/psostests/task-2.c:56 => "ret == 0"
+//TEST(psostests_task2)
 TEST(psostests_task3)
 TEST(psostests_task4)
 TEST(psostests_task5)
-TEST(psostests_task6)
+// 0"011.370| BUG in __traceobj_assert_failed(): [FGND] trace assertion failed:
+//            testsuite/psostests/task-6.c:62
+// => "ret == 0 && oldprio == myprio"
+// TEST(psostests_task6)
 TEST(psostests_task7)
-TEST(psostests_task8)
-TEST(psostests_task9)
+// runs forever (100% CPU)
+//TEST(psostests_task8)
+// 0"002.198| WARNING: [main] lack of resources for core thread, EBUSY
+// 0"003.421| BUG in __traceobj_assert_failed(): [root] trace assertion failed:
+//           ../../../../../../../../../workspace/sources/xenomai/testsuite/smokey/psostests/task-9.c:29 => "ret == 0"
+//TEST(psostests_task9)
 TEST(psostests_tm1)
 TEST(psostests_tm2)
 TEST(psostests_tm3)
-- 
2.35.3


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

* Re: [PATCH v6 00/10] Revive alchemy, pSOS and VxWorks tests
  2023-07-25  8:29           ` [PATCH v6 00/10] Revive alchemy, pSOS and VxWorks tests Aaron Marcher
                               ` (9 preceding siblings ...)
  2023-07-25  8:29             ` [PATCH 10/10] testsuite: disable broken tests Aaron Marcher
@ 2023-08-03 15:35             ` Florian Bezdeka
  2023-08-09  7:36             ` Jan Kiszka
  2023-08-09 11:32             ` [PATCH v7 11/10] testsuite/smokey: Hook up new tests Jan Kiszka
  12 siblings, 0 replies; 112+ messages in thread
From: Florian Bezdeka @ 2023-08-03 15:35 UTC (permalink / raw)
  To: Aaron Marcher, xenomai; +Cc: richard, jan.kiszka

On Tue, 2023-07-25 at 10:29 +0200, Aaron Marcher wrote:
> This patch series fully integrates the currently abandoned alchemy, pSOS
> and VxWorks tests into Xenomai's testsuite.
> For each test, a Smokey testcase is hooked up.
> 
> Changes since v5:
> - Improved task-2 fix commit message
> 
> Aaron Marcher (7):
>   testsuite: Fully integrate alchemytests into smokey
>   testsuite: Fully integrate psostests into smokey
>   testsuite: Fully integrate vwworkstests into smokey
>   alchemytests: Check pipe-1 asprintf ret value
>   alchemytests: Fix task-2
>   alchemytests: Fix task-5 logic
>   testsuite: disable broken tests
> 
> Richard Weinberger (3):
>   testsuite: Remove old alchemytests Makefile
>   alchemytests: Fix gcc warning in buffer-1
>   alchemytests: Fix gcc warning in task-9
> 

Feel free to add "Updates" or "Closes" tags for the following gitlab
issue that is tracking your activities here.

Something like

Updates https://gitlab.com/Xenomai/xenomai-hacker-space/-/issues/32

in the commit message should be enough.


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

* Re: [PATCH 01/10] testsuite: Fully integrate alchemytests into smokey
  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
  1 sibling, 0 replies; 112+ messages in thread
From: Jan Kiszka @ 2023-08-09  7:28 UTC (permalink / raw)
  To: Aaron Marcher, xenomai; +Cc: richard

On 25.07.23 10:29, Aaron Marcher wrote:
> This is the very first step to have the alchemy tests embedded
> into our testsuite.
> 
> Build them using Xenomai's build system and hook them up using
> Smokey. Every test binary has it's own respective testcase in the
> testsuite.
> 
> Signed-off-by: Richard Weinberger <richard@nod.at>
> Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
> ---
>  configure.ac                                  |   7 +-
>  testsuite/Makefile.am                         |   8 +-
>  testsuite/smokey/Makefile.am                  |   9 +-
>  testsuite/smokey/alchemytests/Makefile.am     | 148 ++++++++++++++++++
>  .../smokey/alchemytests}/alarm-1.c            |   1 +
>  testsuite/smokey/alchemytests/alchemytests.c  |  56 +++++++
>  .../smokey/alchemytests/alchemytests_driver.c |  33 ++++
>  .../smokey/alchemytests}/buffer-1.c           |   1 +
>  .../smokey/alchemytests}/event-1.c            |   1 +
>  .../smokey/alchemytests}/heap-1.c             |   1 +
>  .../smokey/alchemytests}/heap-2.c             |   1 +
>  .../smokey/alchemytests}/mq-1.c               |   1 +
>  .../smokey/alchemytests}/mq-2.c               |   1 +
>  .../smokey/alchemytests}/mq-3.c               |   1 +
>  .../smokey/alchemytests}/mutex-1.c            |   1 +
>  .../smokey/alchemytests}/pipe-1.c             |   1 +
>  .../smokey/alchemytests}/sem-1.c              |   1 +
>  .../smokey/alchemytests}/sem-2.c              |   1 +
>  .../smokey/alchemytests}/task-1.c             |   1 +
>  .../smokey/alchemytests}/task-10.c            |   1 +
>  .../smokey/alchemytests}/task-2.c             |   1 +
>  .../smokey/alchemytests}/task-3.c             |   1 +
>  .../smokey/alchemytests}/task-4.c             |   1 +
>  .../smokey/alchemytests}/task-5.c             |   1 +
>  .../smokey/alchemytests}/task-6.c             |   1 +
>  .../smokey/alchemytests}/task-7.c             |   1 +
>  .../smokey/alchemytests}/task-8.c             |   1 +
>  .../smokey/alchemytests}/task-9.c             |   1 +
>  28 files changed, 276 insertions(+), 7 deletions(-)
>  create mode 100644 testsuite/smokey/alchemytests/Makefile.am
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/alarm-1.c (97%)
>  create mode 100644 testsuite/smokey/alchemytests/alchemytests.c
>  create mode 100644 testsuite/smokey/alchemytests/alchemytests_driver.c
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/buffer-1.c (98%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/event-1.c (98%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/heap-1.c (98%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/heap-2.c (98%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-1.c (98%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-2.c (98%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-3.c (98%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mutex-1.c (98%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/pipe-1.c (98%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/sem-1.c (98%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/sem-2.c (97%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-1.c (94%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-10.c (97%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-2.c (98%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-3.c (97%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-4.c (98%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-5.c (98%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-6.c (97%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-7.c (98%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-8.c (97%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-9.c (97%)
> 
> diff --git a/configure.ac b/configure.ac
> index 3ce34048e..fe59333ed 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1041,10 +1041,13 @@ AC_CONFIG_FILES([ \
>  	testsuite/smokey/cpu-affinity/Makefile \
>  	testsuite/smokey/gdb/Makefile \
>  	testsuite/smokey/y2038/Makefile \
> -	testsuite/smokey/can/Makefile
> -	testsuite/smokey/x86io/Makefile
> +	testsuite/smokey/can/Makefile \
> +	testsuite/smokey/x86io/Makefile \
> +	testsuite/smokey/alchemytests/Makefile \
>  	testsuite/clocktest/Makefile \
>  	testsuite/xeno-test/Makefile \
> +	testsuite/psostests/Makefile \
> +	testsuite/vxworkstests/Makefile \
>  	utils/Makefile \
>  	utils/hdb/Makefile \
>  	utils/can/Makefile \
> diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
> index 4932f6d33..1be7eaba4 100644
> --- a/testsuite/Makefile.am
> +++ b/testsuite/Makefile.am
> @@ -7,7 +7,9 @@ SUBDIRS += 		\
>  	gpiotest	\
>  	spitest		\
>  	switchtest	\
> -	xeno-test
> +	xeno-test	\
> +	psostests	\
> +	vxworkstests
>  endif
>  
>  DIST_SUBDIRS =		\
> @@ -18,4 +20,6 @@ DIST_SUBDIRS =		\
>  	smokey		\
>  	spitest		\
>  	switchtest	\
> -	xeno-test
> +	xeno-test	\
> +	psostests \
> +	vxworkstests

These changes make no sense and are reverted in later patches. Dropping
them while merging.

> diff --git a/testsuite/smokey/Makefile.am b/testsuite/smokey/Makefile.am
> index 79dc61e9f..633a87387 100644
> --- a/testsuite/smokey/Makefile.am
> +++ b/testsuite/smokey/Makefile.am
> @@ -40,12 +40,14 @@ COBALT_SUBDIRS = 	\
>  	tsc		\
>  	vdso-access 	\
>  	xddp		\
> -	y2038
> +	y2038 \
> +	alchemytests
>  
>  MERCURY_SUBDIRS =	\
>  	memory-heapmem	\
>  	memory-tlsf	\
> -	memcheck
> +	memcheck \
> +	alchemytests
>  
>  DIST_SUBDIRS = 		\
>  	arith 		\
> @@ -80,7 +82,8 @@ DIST_SUBDIRS = 		\
>  	tsc		\
>  	vdso-access 	\
>  	xddp		\
> -	y2038
> +	y2038 \
> +	alchemytests
>  

I'm pushing these hook-ups to a closing patch so that we don't break the
build while applying the series.

Jan

>  if XENO_X86
>  DIST_SUBDIRS += x86io
> diff --git a/testsuite/smokey/alchemytests/Makefile.am b/testsuite/smokey/alchemytests/Makefile.am
> new file mode 100644
> index 000000000..9da3a98f3
> --- /dev/null
> +++ b/testsuite/smokey/alchemytests/Makefile.am
> @@ -0,0 +1,148 @@
> +testdir = @XENO_TEST_DIR@
> +noinst_LIBRARIES = libalchemytests.a
> +
> +libalchemytests_a_SOURCES = alchemytests.c
> +libalchemytests_a_CPPFLAGS = 		\
> +	@XENO_USER_CFLAGS@	\
> +	-I$(top_srcdir)		\
> +	-I$(top_srcdir)/include \
> +	-DXENO_TEST_DIR='"$(XENO_TEST_DIR)"'
> +
> +CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
> +
> +test_PROGRAMS = \
> +		alchemytests \
> +		alchemytests_alarm1		   \
> +		alchemytests_buffer1		   \
> +		alchemytests_event1		   \
> +		alchemytests_heap1		   \
> +		alchemytests_heap2		   \
> +		alchemytests_mq1		   \
> +		alchemytests_mq2		   \
> +		alchemytests_mq3		   \
> +		alchemytests_mutex1		   \
> +		alchemytests_pipe1		   \
> +		alchemytests_sem1		   \
> +		alchemytests_sem2		   \
> +		alchemytests_task1		   \
> +		alchemytests_task2		   \
> +		alchemytests_task3		   \
> +		alchemytests_task4		   \
> +		alchemytests_task5		   \
> +		alchemytests_task6		   \
> +		alchemytests_task7		   \
> +		alchemytests_task8		   \
> +		alchemytests_task9		   \
> +		alchemytests_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
> +
> +alchemytests_SOURCES = alchemytests_driver.c
> +alchemytests_CPPFLAGS =			\
> +	$(XENO_USER_CFLAGS)			\
> +	-I$(top_srcdir)/include
> +alchemytests_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_LDADD =			\
> +	../../../lib/smokey/libsmokey@CORE@.la	\
> +	@XENO_CORE_LDADD@		\
> +	@XENO_USER_LDADD@		\
> +	-lpthread -lrt
> +
> +alchemytests_alarm1_SOURCES = alarm-1.c
> +alchemytests_alarm1_CPPFLAGS = $(alchemycppflags)
> +alchemytests_alarm1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_alarm1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_event1_SOURCES = event-1.c
> +alchemytests_event1_CPPFLAGS = $(alchemycppflags)
> +alchemytests_event1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_event1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_heap1_SOURCES = heap-1.c
> +alchemytests_heap1_CPPFLAGS = $(alchemycppflags)
> +alchemytests_heap1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_heap1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_heap2_SOURCES = heap-2.c
> +alchemytests_heap2_CPPFLAGS = $(alchemycppflags)
> +alchemytests_heap2_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_heap2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_buffer1_SOURCES = buffer-1.c
> +alchemytests_buffer1_CPPFLAGS = $(alchemycppflags)
> +alchemytests_buffer1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_buffer1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_mutex1_SOURCES = mutex-1.c
> +alchemytests_mutex1_CPPFLAGS = $(alchemycppflags)
> +alchemytests_mutex1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_mutex1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_pipe1_SOURCES = pipe-1.c
> +alchemytests_pipe1_CPPFLAGS = $(alchemycppflags)
> +alchemytests_pipe1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_pipe1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_mq1_SOURCES = mq-1.c
> +alchemytests_mq1_CPPFLAGS = $(alchemycppflags)
> +alchemytests_mq1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_mq1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_mq2_SOURCES = mq-2.c
> +alchemytests_mq2_CPPFLAGS = $(alchemycppflags)
> +alchemytests_mq2_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_mq2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_mq3_SOURCES = mq-3.c
> +alchemytests_mq3_CPPFLAGS = $(alchemycppflags)
> +alchemytests_mq3_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_mq3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_sem1_SOURCES = sem-1.c
> +alchemytests_sem1_CPPFLAGS = $(alchemycppflags)
> +alchemytests_sem1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_sem1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_sem2_SOURCES = sem-2.c
> +alchemytests_sem2_CPPFLAGS = $(alchemycppflags)
> +alchemytests_sem2_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_sem2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_task1_SOURCES = task-1.c
> +alchemytests_task1_CPPFLAGS = $(alchemycppflags)
> +alchemytests_task1_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_task1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_task2_SOURCES = task-2.c
> +alchemytests_task2_CPPFLAGS = $(alchemycppflags)
> +alchemytests_task2_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_task2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_task3_SOURCES = task-3.c
> +alchemytests_task3_CPPFLAGS = $(alchemycppflags)
> +alchemytests_task3_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_task3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_task4_SOURCES = task-4.c
> +alchemytests_task4_CPPFLAGS = $(alchemycppflags)
> +alchemytests_task4_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_task4_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_task5_SOURCES = task-5.c
> +alchemytests_task5_CPPFLAGS = $(alchemycppflags)
> +alchemytests_task5_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_task5_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_task6_SOURCES = task-6.c
> +alchemytests_task6_CPPFLAGS = $(alchemycppflags)
> +alchemytests_task6_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_task6_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_task7_SOURCES = task-7.c
> +alchemytests_task7_CPPFLAGS = $(alchemycppflags)
> +alchemytests_task7_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_task7_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_task8_SOURCES = task-8.c
> +alchemytests_task8_CPPFLAGS = $(alchemycppflags)
> +alchemytests_task8_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_task8_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_task9_SOURCES = task-9.c
> +alchemytests_task9_CPPFLAGS = $(alchemycppflags)
> +alchemytests_task9_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_task9_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +alchemytests_task10_SOURCES = task-10.c
> +alchemytests_task10_CPPFLAGS = $(alchemycppflags)
> +alchemytests_task10_LDADD = $(alchemyldadd) -lpthread -lrt -lm
> +alchemytests_task10_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +
> diff --git a/lib/alchemy/testsuite/alarm-1.c b/testsuite/smokey/alchemytests/alarm-1.c
> similarity index 97%
> rename from lib/alchemy/testsuite/alarm-1.c
> rename to testsuite/smokey/alchemytests/alarm-1.c
> index 29b3bbe74..eb6c5310a 100644
> --- a/lib/alchemy/testsuite/alarm-1.c
> +++ b/testsuite/smokey/alchemytests/alarm-1.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <copperplate/traceobj.h>
> diff --git a/testsuite/smokey/alchemytests/alchemytests.c b/testsuite/smokey/alchemytests/alchemytests.c
> new file mode 100644
> index 000000000..ee8d1703b
> --- /dev/null
> +++ b/testsuite/smokey/alchemytests/alchemytests.c
> @@ -0,0 +1,56 @@
> +// SPDX-License-Identifier: GPL-2.0
> +#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>
> +
> +#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", XENO_TEST_DIR, t->name);
> +	if (ret == -1)
> +		return -ENOMEM;
> +
> +	ret = system(tst_path);
> +	free(tst_path);
> +
> +	return ret;
> +}
> +
> +TEST(alchemytests)
> +TEST(alchemytests_alarm1)
> +TEST(alchemytests_buffer1)
> +TEST(alchemytests_event1)
> +TEST(alchemytests_heap1)
> +TEST(alchemytests_heap2)
> +TEST(alchemytests_mq1)
> +TEST(alchemytests_mq2)
> +TEST(alchemytests_mq3)
> +TEST(alchemytests_mutex1)
> +TEST(alchemytests_pipe1)
> +TEST(alchemytests_sem1)
> +TEST(alchemytests_sem2)
> +TEST(alchemytests_task1)
> +TEST(alchemytests_task2)
> +TEST(alchemytests_task3)
> +TEST(alchemytests_task4)
> +TEST(alchemytests_task5)
> +TEST(alchemytests_task6)
> +TEST(alchemytests_task7)
> +TEST(alchemytests_task8)
> +TEST(alchemytests_task9)
> +TEST(alchemytests_task10)
> +
> diff --git a/testsuite/smokey/alchemytests/alchemytests_driver.c b/testsuite/smokey/alchemytests/alchemytests_driver.c
> new file mode 100644
> index 000000000..7cacbb399
> --- /dev/null
> +++ b/testsuite/smokey/alchemytests/alchemytests_driver.c
> @@ -0,0 +1,33 @@
> +// SPDX-License-Identifier: GPL-2.0
> +#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>
> +
> +int main(int argc, char *const argv[])
> +{
> +	struct smokey_test *t;
> +	int ret, fails = 0;
> +
> +	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;
> +}
> diff --git a/lib/alchemy/testsuite/buffer-1.c b/testsuite/smokey/alchemytests/buffer-1.c
> similarity index 98%
> rename from lib/alchemy/testsuite/buffer-1.c
> rename to testsuite/smokey/alchemytests/buffer-1.c
> index d6d1d9ad7..fdcb5e8d7 100644
> --- a/lib/alchemy/testsuite/buffer-1.c
> +++ b/testsuite/smokey/alchemytests/buffer-1.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <memory.h>
> diff --git a/lib/alchemy/testsuite/event-1.c b/testsuite/smokey/alchemytests/event-1.c
> similarity index 98%
> rename from lib/alchemy/testsuite/event-1.c
> rename to testsuite/smokey/alchemytests/event-1.c
> index 0893df36d..9ce679c71 100644
> --- a/lib/alchemy/testsuite/event-1.c
> +++ b/testsuite/smokey/alchemytests/event-1.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <copperplate/traceobj.h>
> diff --git a/lib/alchemy/testsuite/heap-1.c b/testsuite/smokey/alchemytests/heap-1.c
> similarity index 98%
> rename from lib/alchemy/testsuite/heap-1.c
> rename to testsuite/smokey/alchemytests/heap-1.c
> index 48bc4a56e..f0904439f 100644
> --- a/lib/alchemy/testsuite/heap-1.c
> +++ b/testsuite/smokey/alchemytests/heap-1.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <copperplate/traceobj.h>
> diff --git a/lib/alchemy/testsuite/heap-2.c b/testsuite/smokey/alchemytests/heap-2.c
> similarity index 98%
> rename from lib/alchemy/testsuite/heap-2.c
> rename to testsuite/smokey/alchemytests/heap-2.c
> index ad67afb2f..1f80db80c 100644
> --- a/lib/alchemy/testsuite/heap-2.c
> +++ b/testsuite/smokey/alchemytests/heap-2.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <copperplate/traceobj.h>
> diff --git a/lib/alchemy/testsuite/mq-1.c b/testsuite/smokey/alchemytests/mq-1.c
> similarity index 98%
> rename from lib/alchemy/testsuite/mq-1.c
> rename to testsuite/smokey/alchemytests/mq-1.c
> index ac9801e72..952ff6448 100644
> --- a/lib/alchemy/testsuite/mq-1.c
> +++ b/testsuite/smokey/alchemytests/mq-1.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <copperplate/traceobj.h>
> diff --git a/lib/alchemy/testsuite/mq-2.c b/testsuite/smokey/alchemytests/mq-2.c
> similarity index 98%
> rename from lib/alchemy/testsuite/mq-2.c
> rename to testsuite/smokey/alchemytests/mq-2.c
> index 9fea471b7..acc6ec051 100644
> --- a/lib/alchemy/testsuite/mq-2.c
> +++ b/testsuite/smokey/alchemytests/mq-2.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <copperplate/traceobj.h>
> diff --git a/lib/alchemy/testsuite/mq-3.c b/testsuite/smokey/alchemytests/mq-3.c
> similarity index 98%
> rename from lib/alchemy/testsuite/mq-3.c
> rename to testsuite/smokey/alchemytests/mq-3.c
> index 7fcae020a..cb4c77d43 100644
> --- a/lib/alchemy/testsuite/mq-3.c
> +++ b/testsuite/smokey/alchemytests/mq-3.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <copperplate/traceobj.h>
> diff --git a/lib/alchemy/testsuite/mutex-1.c b/testsuite/smokey/alchemytests/mutex-1.c
> similarity index 98%
> rename from lib/alchemy/testsuite/mutex-1.c
> rename to testsuite/smokey/alchemytests/mutex-1.c
> index ef58a2c86..f08665254 100644
> --- a/lib/alchemy/testsuite/mutex-1.c
> +++ b/testsuite/smokey/alchemytests/mutex-1.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <copperplate/traceobj.h>
> diff --git a/lib/alchemy/testsuite/pipe-1.c b/testsuite/smokey/alchemytests/pipe-1.c
> similarity index 98%
> rename from lib/alchemy/testsuite/pipe-1.c
> rename to testsuite/smokey/alchemytests/pipe-1.c
> index 4202be2ba..4011f9c8a 100644
> --- a/lib/alchemy/testsuite/pipe-1.c
> +++ b/testsuite/smokey/alchemytests/pipe-1.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <fcntl.h>
> diff --git a/lib/alchemy/testsuite/sem-1.c b/testsuite/smokey/alchemytests/sem-1.c
> similarity index 98%
> rename from lib/alchemy/testsuite/sem-1.c
> rename to testsuite/smokey/alchemytests/sem-1.c
> index 3e526eddf..080bcea9a 100644
> --- a/lib/alchemy/testsuite/sem-1.c
> +++ b/testsuite/smokey/alchemytests/sem-1.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <copperplate/traceobj.h>
> diff --git a/lib/alchemy/testsuite/sem-2.c b/testsuite/smokey/alchemytests/sem-2.c
> similarity index 97%
> rename from lib/alchemy/testsuite/sem-2.c
> rename to testsuite/smokey/alchemytests/sem-2.c
> index c01f6a431..74cce2b7d 100644
> --- a/lib/alchemy/testsuite/sem-2.c
> +++ b/testsuite/smokey/alchemytests/sem-2.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <copperplate/traceobj.h>
> diff --git a/lib/alchemy/testsuite/task-1.c b/testsuite/smokey/alchemytests/task-1.c
> similarity index 94%
> rename from lib/alchemy/testsuite/task-1.c
> rename to testsuite/smokey/alchemytests/task-1.c
> index 34a6c22fd..d3d9a6f7f 100644
> --- a/lib/alchemy/testsuite/task-1.c
> +++ b/testsuite/smokey/alchemytests/task-1.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <copperplate/traceobj.h>
> diff --git a/lib/alchemy/testsuite/task-10.c b/testsuite/smokey/alchemytests/task-10.c
> similarity index 97%
> rename from lib/alchemy/testsuite/task-10.c
> rename to testsuite/smokey/alchemytests/task-10.c
> index 58f4cb035..c4a29ae76 100644
> --- a/lib/alchemy/testsuite/task-10.c
> +++ b/testsuite/smokey/alchemytests/task-10.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <copperplate/traceobj.h>
> diff --git a/lib/alchemy/testsuite/task-2.c b/testsuite/smokey/alchemytests/task-2.c
> similarity index 98%
> rename from lib/alchemy/testsuite/task-2.c
> rename to testsuite/smokey/alchemytests/task-2.c
> index e751ddd34..592f2ed20 100644
> --- a/lib/alchemy/testsuite/task-2.c
> +++ b/testsuite/smokey/alchemytests/task-2.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <copperplate/traceobj.h>
> diff --git a/lib/alchemy/testsuite/task-3.c b/testsuite/smokey/alchemytests/task-3.c
> similarity index 97%
> rename from lib/alchemy/testsuite/task-3.c
> rename to testsuite/smokey/alchemytests/task-3.c
> index 06f235af9..eb24935a4 100644
> --- a/lib/alchemy/testsuite/task-3.c
> +++ b/testsuite/smokey/alchemytests/task-3.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <copperplate/traceobj.h>
> diff --git a/lib/alchemy/testsuite/task-4.c b/testsuite/smokey/alchemytests/task-4.c
> similarity index 98%
> rename from lib/alchemy/testsuite/task-4.c
> rename to testsuite/smokey/alchemytests/task-4.c
> index eba7fbb86..90e0236be 100644
> --- a/lib/alchemy/testsuite/task-4.c
> +++ b/testsuite/smokey/alchemytests/task-4.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <copperplate/traceobj.h>
> diff --git a/lib/alchemy/testsuite/task-5.c b/testsuite/smokey/alchemytests/task-5.c
> similarity index 98%
> rename from lib/alchemy/testsuite/task-5.c
> rename to testsuite/smokey/alchemytests/task-5.c
> index 3c0fa427c..b9075945d 100644
> --- a/lib/alchemy/testsuite/task-5.c
> +++ b/testsuite/smokey/alchemytests/task-5.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <copperplate/traceobj.h>
> diff --git a/lib/alchemy/testsuite/task-6.c b/testsuite/smokey/alchemytests/task-6.c
> similarity index 97%
> rename from lib/alchemy/testsuite/task-6.c
> rename to testsuite/smokey/alchemytests/task-6.c
> index 7c88fde9c..fa58d0fdc 100644
> --- a/lib/alchemy/testsuite/task-6.c
> +++ b/testsuite/smokey/alchemytests/task-6.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <copperplate/traceobj.h>
> diff --git a/lib/alchemy/testsuite/task-7.c b/testsuite/smokey/alchemytests/task-7.c
> similarity index 98%
> rename from lib/alchemy/testsuite/task-7.c
> rename to testsuite/smokey/alchemytests/task-7.c
> index 1350bb39c..d118abf42 100644
> --- a/lib/alchemy/testsuite/task-7.c
> +++ b/testsuite/smokey/alchemytests/task-7.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <copperplate/traceobj.h>
> diff --git a/lib/alchemy/testsuite/task-8.c b/testsuite/smokey/alchemytests/task-8.c
> similarity index 97%
> rename from lib/alchemy/testsuite/task-8.c
> rename to testsuite/smokey/alchemytests/task-8.c
> index bb6dfff06..959b3d3c4 100644
> --- a/lib/alchemy/testsuite/task-8.c
> +++ b/testsuite/smokey/alchemytests/task-8.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <copperplate/traceobj.h>
> diff --git a/lib/alchemy/testsuite/task-9.c b/testsuite/smokey/alchemytests/task-9.c
> similarity index 97%
> rename from lib/alchemy/testsuite/task-9.c
> rename to testsuite/smokey/alchemytests/task-9.c
> index e358154c5..56cc7bfeb 100644
> --- a/lib/alchemy/testsuite/task-9.c
> +++ b/testsuite/smokey/alchemytests/task-9.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <signal.h>

-- 
Siemens AG, Technology
Linux Expert Center


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

* Re: [PATCH v6 00/10] Revive alchemy, pSOS and VxWorks tests
  2023-07-25  8:29           ` [PATCH v6 00/10] Revive alchemy, pSOS and VxWorks tests Aaron Marcher
                               ` (10 preceding siblings ...)
  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-09 11:32             ` [PATCH v7 11/10] testsuite/smokey: Hook up new tests Jan Kiszka
  12 siblings, 1 reply; 112+ messages in thread
From: Jan Kiszka @ 2023-08-09  7:36 UTC (permalink / raw)
  To: Aaron Marcher, xenomai; +Cc: richard

On 25.07.23 10:29, Aaron Marcher wrote:
> This patch series fully integrates the currently abandoned alchemy, pSOS
> and VxWorks tests into Xenomai's testsuite.
> For each test, a Smokey testcase is hooked up.
> 
> Changes since v5:
> - Improved task-2 fix commit message
> 
> Aaron Marcher (7):
>   testsuite: Fully integrate alchemytests into smokey
>   testsuite: Fully integrate psostests into smokey
>   testsuite: Fully integrate vwworkstests into smokey
>   alchemytests: Check pipe-1 asprintf ret value
>   alchemytests: Fix task-2
>   alchemytests: Fix task-5 logic
>   testsuite: disable broken tests
> 
> Richard Weinberger (3):
>   testsuite: Remove old alchemytests Makefile
>   alchemytests: Fix gcc warning in buffer-1
>   alchemytests: Fix gcc warning in task-9
> 
>  configure.ac                                  |   7 +-
>  lib/alchemy/testsuite/Makefile                |  70 ---------
>  lib/psos/testsuite/Makefile                   |  49 ------
>  lib/vxworks/testsuite/Makefile                |  43 -----
>  testsuite/smokey/Makefile.am                  |  15 +-
>  testsuite/smokey/alchemytests/Makefile.am     | 148 ++++++++++++++++++
>  .../smokey/alchemytests}/alarm-1.c            |   1 +
>  testsuite/smokey/alchemytests/alchemytests.c  |  56 +++++++
>  .../smokey/alchemytests/alchemytests_driver.c |  33 ++++
>  .../smokey/alchemytests}/buffer-1.c           |   3 +-
>  .../smokey/alchemytests}/event-1.c            |   1 +
>  .../smokey/alchemytests}/heap-1.c             |   1 +
>  .../smokey/alchemytests}/heap-2.c             |   1 +
>  .../smokey/alchemytests}/mq-1.c               |   1 +
>  .../smokey/alchemytests}/mq-2.c               |   1 +
>  .../smokey/alchemytests}/mq-3.c               |   1 +
>  .../smokey/alchemytests}/mutex-1.c            |   1 +
>  .../smokey/alchemytests}/pipe-1.c             |   7 +-
>  .../smokey/alchemytests}/sem-1.c              |   1 +
>  .../smokey/alchemytests}/sem-2.c              |   1 +
>  .../smokey/alchemytests}/task-1.c             |   1 +
>  .../smokey/alchemytests}/task-10.c            |   1 +
>  .../smokey/alchemytests}/task-2.c             |   5 +-
>  .../smokey/alchemytests}/task-3.c             |   1 +
>  .../smokey/alchemytests}/task-4.c             |   1 +
>  .../smokey/alchemytests}/task-5.c             |  11 +-
>  .../smokey/alchemytests}/task-6.c             |   1 +
>  .../smokey/alchemytests}/task-7.c             |   1 +
>  .../smokey/alchemytests}/task-8.c             |   1 +
>  .../smokey/alchemytests}/task-9.c             |   3 +-
>  testsuite/smokey/psostests/Makefile.am        | 148 ++++++++++++++++++
>  .../smokey/psostests}/mq-1.c                  |   1 +
>  .../smokey/psostests}/mq-2.c                  |   1 +
>  .../smokey/psostests}/mq-3.c                  |   1 +
>  testsuite/smokey/psostests/psostests.c        |  69 ++++++++
>  testsuite/smokey/psostests/psostests_driver.c |  34 ++++
>  .../smokey/psostests}/pt-1.c                  |   1 +
>  .../smokey/psostests}/rn-1.c                  |   1 +
>  .../smokey/psostests}/sem-1.c                 |   1 +
>  .../smokey/psostests}/sem-2.c                 |   1 +
>  .../smokey/psostests}/task-1.c                |   1 +
>  .../smokey/psostests}/task-2.c                |   1 +
>  .../smokey/psostests}/task-3.c                |   1 +
>  .../smokey/psostests}/task-4.c                |   1 +
>  .../smokey/psostests}/task-5.c                |   1 +
>  .../smokey/psostests}/task-6.c                |   1 +
>  .../smokey/psostests}/task-7.c                |   1 +
>  .../smokey/psostests}/task-8.c                |   1 +
>  .../smokey/psostests}/task-9.c                |   1 +
>  .../smokey/psostests}/tm-1.c                  |   1 +
>  .../smokey/psostests}/tm-2.c                  |   1 +
>  .../smokey/psostests}/tm-3.c                  |   1 +
>  .../smokey/psostests}/tm-4.c                  |   1 +
>  .../smokey/psostests}/tm-5.c                  |   1 +
>  .../smokey/psostests}/tm-6.c                  |   1 +
>  .../smokey/psostests}/tm-7.c                  |   1 +
>  testsuite/smokey/vxworkstests/Makefile.am     |  94 +++++++++++
>  .../smokey/vxworkstests}/lst-1.c              |   1 +
>  .../smokey/vxworkstests}/msgQ-1.c             |   1 +
>  .../smokey/vxworkstests}/msgQ-2.c             |   1 +
>  .../smokey/vxworkstests}/msgQ-3.c             |   1 +
>  .../smokey/vxworkstests}/rng-1.c              |   1 +
>  .../smokey/vxworkstests}/sem-1.c              |   1 +
>  .../smokey/vxworkstests}/sem-2.c              |   1 +
>  .../smokey/vxworkstests}/sem-3.c              |   1 +
>  .../smokey/vxworkstests}/sem-4.c              |   1 +
>  .../smokey/vxworkstests}/task-1.c             |   1 +
>  .../smokey/vxworkstests}/task-2.c             |   1 +
>  testsuite/smokey/vxworkstests/vxworkstests.c  |  46 ++++++
>  .../smokey/vxworkstests/vxworkstests_driver.c |  33 ++++
>  .../smokey/vxworkstests}/wd-1.c               |   1 +
>  71 files changed, 749 insertions(+), 177 deletions(-)
>  delete mode 100644 lib/alchemy/testsuite/Makefile
>  delete mode 100644 lib/psos/testsuite/Makefile
>  delete mode 100644 lib/vxworks/testsuite/Makefile
>  create mode 100644 testsuite/smokey/alchemytests/Makefile.am
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/alarm-1.c (97%)
>  create mode 100644 testsuite/smokey/alchemytests/alchemytests.c
>  create mode 100644 testsuite/smokey/alchemytests/alchemytests_driver.c
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/buffer-1.c (97%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/event-1.c (98%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/heap-1.c (98%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/heap-2.c (98%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-1.c (98%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-2.c (98%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-3.c (98%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mutex-1.c (98%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/pipe-1.c (96%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/sem-1.c (98%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/sem-2.c (97%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-1.c (94%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-10.c (97%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-2.c (95%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-3.c (97%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-4.c (98%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-5.c (98%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-6.c (97%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-7.c (98%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-8.c (97%)
>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-9.c (94%)
>  create mode 100644 testsuite/smokey/psostests/Makefile.am
>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/mq-1.c (97%)
>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/mq-2.c (98%)
>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/mq-3.c (98%)
>  create mode 100644 testsuite/smokey/psostests/psostests.c
>  create mode 100644 testsuite/smokey/psostests/psostests_driver.c
>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/pt-1.c (96%)
>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/rn-1.c (97%)
>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/sem-1.c (98%)
>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/sem-2.c (97%)
>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-1.c (95%)
>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-2.c (98%)
>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-3.c (96%)
>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-4.c (97%)
>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-5.c (98%)
>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-6.c (98%)
>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-7.c (97%)
>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-8.c (98%)
>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-9.c (98%)
>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-1.c (95%)
>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-2.c (97%)
>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-3.c (97%)
>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-4.c (97%)
>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-5.c (97%)
>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-6.c (95%)
>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-7.c (95%)
>  create mode 100644 testsuite/smokey/vxworkstests/Makefile.am
>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/lst-1.c (99%)
>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-1.c (98%)
>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-2.c (98%)
>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-3.c (98%)
>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/rng-1.c (99%)
>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-1.c (98%)
>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-2.c (98%)
>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-3.c (97%)
>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-4.c (98%)
>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/task-1.c (96%)
>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/task-2.c (98%)
>  create mode 100644 testsuite/smokey/vxworkstests/vxworkstests.c
>  create mode 100644 testsuite/smokey/vxworkstests/vxworkstests_driver.c
>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/wd-1.c (97%)
> 

All applied, just with some whitespace massaging and a reordering of
when the build system is actually updated. See next branch for the result.

Thanks,
Jan

-- 
Siemens AG, Technology
Linux Expert Center


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

* [PATCH v7 01/10] testsuite: Fully integrate alchemytests into smokey
  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               ` Jan Kiszka
  1 sibling, 0 replies; 112+ messages in thread
From: Jan Kiszka @ 2023-08-09 11:32 UTC (permalink / raw)
  To: Aaron Marcher, xenomai; +Cc: richard

From: Aaron Marcher <aaron@sigma-star.at>

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

Build them using Xenomai's build system and hook them up using
Smokey. Every test binary has it's own respective testcase in the
testsuite.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
[Jan: fix whitespace issues, clean up makefile, do not hook into automake yet]
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 configure.ac                                  |   7 +-
 testsuite/smokey/alchemytests/Makefile.am     | 147 ++++++++++++++++++
 .../smokey/alchemytests}/alarm-1.c            |   1 +
 testsuite/smokey/alchemytests/alchemytests.c  |  55 +++++++
 .../smokey/alchemytests/alchemytests_driver.c |  33 ++++
 .../smokey/alchemytests}/buffer-1.c           |   1 +
 .../smokey/alchemytests}/event-1.c            |   1 +
 .../smokey/alchemytests}/heap-1.c             |   1 +
 .../smokey/alchemytests}/heap-2.c             |   1 +
 .../smokey/alchemytests}/mq-1.c               |   1 +
 .../smokey/alchemytests}/mq-2.c               |   1 +
 .../smokey/alchemytests}/mq-3.c               |   1 +
 .../smokey/alchemytests}/mutex-1.c            |   1 +
 .../smokey/alchemytests}/pipe-1.c             |   1 +
 .../smokey/alchemytests}/sem-1.c              |   1 +
 .../smokey/alchemytests}/sem-2.c              |   1 +
 .../smokey/alchemytests}/task-1.c             |   1 +
 .../smokey/alchemytests}/task-10.c            |   1 +
 .../smokey/alchemytests}/task-2.c             |   1 +
 .../smokey/alchemytests}/task-3.c             |   1 +
 .../smokey/alchemytests}/task-4.c             |   1 +
 .../smokey/alchemytests}/task-5.c             |   1 +
 .../smokey/alchemytests}/task-6.c             |   1 +
 .../smokey/alchemytests}/task-7.c             |   1 +
 .../smokey/alchemytests}/task-8.c             |   1 +
 .../smokey/alchemytests}/task-9.c             |   1 +
 26 files changed, 262 insertions(+), 2 deletions(-)
 create mode 100644 testsuite/smokey/alchemytests/Makefile.am
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/alarm-1.c (97%)
 create mode 100644 testsuite/smokey/alchemytests/alchemytests.c
 create mode 100644 testsuite/smokey/alchemytests/alchemytests_driver.c
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/buffer-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/event-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/heap-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/heap-2.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-2.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-3.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mutex-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/pipe-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/sem-1.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/sem-2.c (97%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-1.c (94%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-10.c (97%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-2.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-3.c (97%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-4.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-5.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-6.c (97%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-7.c (98%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-8.c (97%)
 rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-9.c (97%)

diff --git a/configure.ac b/configure.ac
index 3ce34048e6..fe59333ed4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1041,10 +1041,13 @@ AC_CONFIG_FILES([ \
 	testsuite/smokey/cpu-affinity/Makefile \
 	testsuite/smokey/gdb/Makefile \
 	testsuite/smokey/y2038/Makefile \
-	testsuite/smokey/can/Makefile
-	testsuite/smokey/x86io/Makefile
+	testsuite/smokey/can/Makefile \
+	testsuite/smokey/x86io/Makefile \
+	testsuite/smokey/alchemytests/Makefile \
 	testsuite/clocktest/Makefile \
 	testsuite/xeno-test/Makefile \
+	testsuite/psostests/Makefile \
+	testsuite/vxworkstests/Makefile \
 	utils/Makefile \
 	utils/hdb/Makefile \
 	utils/can/Makefile \
diff --git a/testsuite/smokey/alchemytests/Makefile.am b/testsuite/smokey/alchemytests/Makefile.am
new file mode 100644
index 0000000000..68255b1112
--- /dev/null
+++ b/testsuite/smokey/alchemytests/Makefile.am
@@ -0,0 +1,147 @@
+testdir = @XENO_TEST_DIR@
+noinst_LIBRARIES = libalchemytests.a
+
+libalchemytests_a_SOURCES = alchemytests.c
+libalchemytests_a_CPPFLAGS =	\
+	@XENO_USER_CFLAGS@	\
+	-I$(top_srcdir)		\
+	-I$(top_srcdir)/include \
+	-DXENO_TEST_DIR='"$(XENO_TEST_DIR)"'
+
+CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
+
+test_PROGRAMS =				\
+		alchemytests		\
+		alchemytests_alarm1	\
+		alchemytests_buffer1	\
+		alchemytests_event1	\
+		alchemytests_heap1	\
+		alchemytests_heap2	\
+		alchemytests_mq1	\
+		alchemytests_mq2	\
+		alchemytests_mq3	\
+		alchemytests_mutex1	\
+		alchemytests_pipe1	\
+		alchemytests_sem1	\
+		alchemytests_sem2	\
+		alchemytests_task1	\
+		alchemytests_task2	\
+		alchemytests_task3	\
+		alchemytests_task4	\
+		alchemytests_task5	\
+		alchemytests_task6	\
+		alchemytests_task7	\
+		alchemytests_task8	\
+		alchemytests_task9	\
+		alchemytests_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
+
+alchemytests_SOURCES = alchemytests_driver.c
+alchemytests_CPPFLAGS =				\
+	$(XENO_USER_CFLAGS)			\
+	-I$(top_srcdir)/include
+alchemytests_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_LDADD =				\
+	../../../lib/smokey/libsmokey@CORE@.la	\
+	@XENO_CORE_LDADD@			\
+	@XENO_USER_LDADD@			\
+	-lpthread -lrt
+
+alchemytests_alarm1_SOURCES = alarm-1.c
+alchemytests_alarm1_CPPFLAGS = $(alchemycppflags)
+alchemytests_alarm1_LDADD = $(alchemyldadd)
+alchemytests_alarm1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_event1_SOURCES = event-1.c
+alchemytests_event1_CPPFLAGS = $(alchemycppflags)
+alchemytests_event1_LDADD = $(alchemyldadd)
+alchemytests_event1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_heap1_SOURCES = heap-1.c
+alchemytests_heap1_CPPFLAGS = $(alchemycppflags)
+alchemytests_heap1_LDADD = $(alchemyldadd)
+alchemytests_heap1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_heap2_SOURCES = heap-2.c
+alchemytests_heap2_CPPFLAGS = $(alchemycppflags)
+alchemytests_heap2_LDADD = $(alchemyldadd)
+alchemytests_heap2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_buffer1_SOURCES = buffer-1.c
+alchemytests_buffer1_CPPFLAGS = $(alchemycppflags)
+alchemytests_buffer1_LDADD = $(alchemyldadd)
+alchemytests_buffer1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_mutex1_SOURCES = mutex-1.c
+alchemytests_mutex1_CPPFLAGS = $(alchemycppflags)
+alchemytests_mutex1_LDADD = $(alchemyldadd)
+alchemytests_mutex1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_pipe1_SOURCES = pipe-1.c
+alchemytests_pipe1_CPPFLAGS = $(alchemycppflags)
+alchemytests_pipe1_LDADD = $(alchemyldadd)
+alchemytests_pipe1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_mq1_SOURCES = mq-1.c
+alchemytests_mq1_CPPFLAGS = $(alchemycppflags)
+alchemytests_mq1_LDADD = $(alchemyldadd)
+alchemytests_mq1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_mq2_SOURCES = mq-2.c
+alchemytests_mq2_CPPFLAGS = $(alchemycppflags)
+alchemytests_mq2_LDADD = $(alchemyldadd)
+alchemytests_mq2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_mq3_SOURCES = mq-3.c
+alchemytests_mq3_CPPFLAGS = $(alchemycppflags)
+alchemytests_mq3_LDADD = $(alchemyldadd)
+alchemytests_mq3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_sem1_SOURCES = sem-1.c
+alchemytests_sem1_CPPFLAGS = $(alchemycppflags)
+alchemytests_sem1_LDADD = $(alchemyldadd)
+alchemytests_sem1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_sem2_SOURCES = sem-2.c
+alchemytests_sem2_CPPFLAGS = $(alchemycppflags)
+alchemytests_sem2_LDADD = $(alchemyldadd)
+alchemytests_sem2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task1_SOURCES = task-1.c
+alchemytests_task1_CPPFLAGS = $(alchemycppflags)
+alchemytests_task1_LDADD = $(alchemyldadd)
+alchemytests_task1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task2_SOURCES = task-2.c
+alchemytests_task2_CPPFLAGS = $(alchemycppflags)
+alchemytests_task2_LDADD = $(alchemyldadd)
+alchemytests_task2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task3_SOURCES = task-3.c
+alchemytests_task3_CPPFLAGS = $(alchemycppflags)
+alchemytests_task3_LDADD = $(alchemyldadd)
+alchemytests_task3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task4_SOURCES = task-4.c
+alchemytests_task4_CPPFLAGS = $(alchemycppflags)
+alchemytests_task4_LDADD = $(alchemyldadd)
+alchemytests_task4_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task5_SOURCES = task-5.c
+alchemytests_task5_CPPFLAGS = $(alchemycppflags)
+alchemytests_task5_LDADD = $(alchemyldadd)
+alchemytests_task5_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task6_SOURCES = task-6.c
+alchemytests_task6_CPPFLAGS = $(alchemycppflags)
+alchemytests_task6_LDADD = $(alchemyldadd)
+alchemytests_task6_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task7_SOURCES = task-7.c
+alchemytests_task7_CPPFLAGS = $(alchemycppflags)
+alchemytests_task7_LDADD = $(alchemyldadd)
+alchemytests_task7_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task8_SOURCES = task-8.c
+alchemytests_task8_CPPFLAGS = $(alchemycppflags)
+alchemytests_task8_LDADD = $(alchemyldadd)
+alchemytests_task8_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task9_SOURCES = task-9.c
+alchemytests_task9_CPPFLAGS = $(alchemycppflags)
+alchemytests_task9_LDADD = $(alchemyldadd)
+alchemytests_task9_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+alchemytests_task10_SOURCES = task-10.c
+alchemytests_task10_CPPFLAGS = $(alchemycppflags)
+alchemytests_task10_LDADD = $(alchemyldadd)
+alchemytests_task10_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
diff --git a/lib/alchemy/testsuite/alarm-1.c b/testsuite/smokey/alchemytests/alarm-1.c
similarity index 97%
rename from lib/alchemy/testsuite/alarm-1.c
rename to testsuite/smokey/alchemytests/alarm-1.c
index 29b3bbe740..eb6c5310aa 100644
--- a/lib/alchemy/testsuite/alarm-1.c
+++ b/testsuite/smokey/alchemytests/alarm-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/testsuite/smokey/alchemytests/alchemytests.c b/testsuite/smokey/alchemytests/alchemytests.c
new file mode 100644
index 0000000000..19989cc09d
--- /dev/null
+++ b/testsuite/smokey/alchemytests/alchemytests.c
@@ -0,0 +1,55 @@
+// SPDX-License-Identifier: GPL-2.0
+#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>
+
+#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", XENO_TEST_DIR, t->name);
+	if (ret == -1)
+		return -ENOMEM;
+
+	ret = system(tst_path);
+	free(tst_path);
+
+	return ret;
+}
+
+TEST(alchemytests)
+TEST(alchemytests_alarm1)
+TEST(alchemytests_buffer1)
+TEST(alchemytests_event1)
+TEST(alchemytests_heap1)
+TEST(alchemytests_heap2)
+TEST(alchemytests_mq1)
+TEST(alchemytests_mq2)
+TEST(alchemytests_mq3)
+TEST(alchemytests_mutex1)
+TEST(alchemytests_pipe1)
+TEST(alchemytests_sem1)
+TEST(alchemytests_sem2)
+TEST(alchemytests_task1)
+TEST(alchemytests_task2)
+TEST(alchemytests_task3)
+TEST(alchemytests_task4)
+TEST(alchemytests_task5)
+TEST(alchemytests_task6)
+TEST(alchemytests_task7)
+TEST(alchemytests_task8)
+TEST(alchemytests_task9)
+TEST(alchemytests_task10)
diff --git a/testsuite/smokey/alchemytests/alchemytests_driver.c b/testsuite/smokey/alchemytests/alchemytests_driver.c
new file mode 100644
index 0000000000..7cacbb399b
--- /dev/null
+++ b/testsuite/smokey/alchemytests/alchemytests_driver.c
@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: GPL-2.0
+#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>
+
+int main(int argc, char *const argv[])
+{
+	struct smokey_test *t;
+	int ret, fails = 0;
+
+	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;
+}
diff --git a/lib/alchemy/testsuite/buffer-1.c b/testsuite/smokey/alchemytests/buffer-1.c
similarity index 98%
rename from lib/alchemy/testsuite/buffer-1.c
rename to testsuite/smokey/alchemytests/buffer-1.c
index d6d1d9ad72..fdcb5e8d75 100644
--- a/lib/alchemy/testsuite/buffer-1.c
+++ b/testsuite/smokey/alchemytests/buffer-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <memory.h>
diff --git a/lib/alchemy/testsuite/event-1.c b/testsuite/smokey/alchemytests/event-1.c
similarity index 98%
rename from lib/alchemy/testsuite/event-1.c
rename to testsuite/smokey/alchemytests/event-1.c
index 0893df36de..9ce679c717 100644
--- a/lib/alchemy/testsuite/event-1.c
+++ b/testsuite/smokey/alchemytests/event-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/heap-1.c b/testsuite/smokey/alchemytests/heap-1.c
similarity index 98%
rename from lib/alchemy/testsuite/heap-1.c
rename to testsuite/smokey/alchemytests/heap-1.c
index 48bc4a56e4..f0904439f7 100644
--- a/lib/alchemy/testsuite/heap-1.c
+++ b/testsuite/smokey/alchemytests/heap-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/heap-2.c b/testsuite/smokey/alchemytests/heap-2.c
similarity index 98%
rename from lib/alchemy/testsuite/heap-2.c
rename to testsuite/smokey/alchemytests/heap-2.c
index ad67afb2fd..1f80db80cc 100644
--- a/lib/alchemy/testsuite/heap-2.c
+++ b/testsuite/smokey/alchemytests/heap-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/mq-1.c b/testsuite/smokey/alchemytests/mq-1.c
similarity index 98%
rename from lib/alchemy/testsuite/mq-1.c
rename to testsuite/smokey/alchemytests/mq-1.c
index ac9801e726..952ff6448a 100644
--- a/lib/alchemy/testsuite/mq-1.c
+++ b/testsuite/smokey/alchemytests/mq-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/mq-2.c b/testsuite/smokey/alchemytests/mq-2.c
similarity index 98%
rename from lib/alchemy/testsuite/mq-2.c
rename to testsuite/smokey/alchemytests/mq-2.c
index 9fea471b78..acc6ec0519 100644
--- a/lib/alchemy/testsuite/mq-2.c
+++ b/testsuite/smokey/alchemytests/mq-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/mq-3.c b/testsuite/smokey/alchemytests/mq-3.c
similarity index 98%
rename from lib/alchemy/testsuite/mq-3.c
rename to testsuite/smokey/alchemytests/mq-3.c
index 7fcae020af..cb4c77d430 100644
--- a/lib/alchemy/testsuite/mq-3.c
+++ b/testsuite/smokey/alchemytests/mq-3.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/mutex-1.c b/testsuite/smokey/alchemytests/mutex-1.c
similarity index 98%
rename from lib/alchemy/testsuite/mutex-1.c
rename to testsuite/smokey/alchemytests/mutex-1.c
index ef58a2c866..f08665254e 100644
--- a/lib/alchemy/testsuite/mutex-1.c
+++ b/testsuite/smokey/alchemytests/mutex-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/pipe-1.c b/testsuite/smokey/alchemytests/pipe-1.c
similarity index 98%
rename from lib/alchemy/testsuite/pipe-1.c
rename to testsuite/smokey/alchemytests/pipe-1.c
index 4202be2bac..4011f9c8a7 100644
--- a/lib/alchemy/testsuite/pipe-1.c
+++ b/testsuite/smokey/alchemytests/pipe-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <fcntl.h>
diff --git a/lib/alchemy/testsuite/sem-1.c b/testsuite/smokey/alchemytests/sem-1.c
similarity index 98%
rename from lib/alchemy/testsuite/sem-1.c
rename to testsuite/smokey/alchemytests/sem-1.c
index 3e526eddf5..080bcea9ae 100644
--- a/lib/alchemy/testsuite/sem-1.c
+++ b/testsuite/smokey/alchemytests/sem-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/sem-2.c b/testsuite/smokey/alchemytests/sem-2.c
similarity index 97%
rename from lib/alchemy/testsuite/sem-2.c
rename to testsuite/smokey/alchemytests/sem-2.c
index c01f6a431d..74cce2b7d9 100644
--- a/lib/alchemy/testsuite/sem-2.c
+++ b/testsuite/smokey/alchemytests/sem-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/task-1.c b/testsuite/smokey/alchemytests/task-1.c
similarity index 94%
rename from lib/alchemy/testsuite/task-1.c
rename to testsuite/smokey/alchemytests/task-1.c
index 34a6c22fdd..d3d9a6f7f8 100644
--- a/lib/alchemy/testsuite/task-1.c
+++ b/testsuite/smokey/alchemytests/task-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/task-10.c b/testsuite/smokey/alchemytests/task-10.c
similarity index 97%
rename from lib/alchemy/testsuite/task-10.c
rename to testsuite/smokey/alchemytests/task-10.c
index 58f4cb0357..c4a29ae760 100644
--- a/lib/alchemy/testsuite/task-10.c
+++ b/testsuite/smokey/alchemytests/task-10.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/task-2.c b/testsuite/smokey/alchemytests/task-2.c
similarity index 98%
rename from lib/alchemy/testsuite/task-2.c
rename to testsuite/smokey/alchemytests/task-2.c
index e751ddd347..592f2ed20c 100644
--- a/lib/alchemy/testsuite/task-2.c
+++ b/testsuite/smokey/alchemytests/task-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/task-3.c b/testsuite/smokey/alchemytests/task-3.c
similarity index 97%
rename from lib/alchemy/testsuite/task-3.c
rename to testsuite/smokey/alchemytests/task-3.c
index 06f235af9b..eb24935a4f 100644
--- a/lib/alchemy/testsuite/task-3.c
+++ b/testsuite/smokey/alchemytests/task-3.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/task-4.c b/testsuite/smokey/alchemytests/task-4.c
similarity index 98%
rename from lib/alchemy/testsuite/task-4.c
rename to testsuite/smokey/alchemytests/task-4.c
index eba7fbb86d..90e0236bed 100644
--- a/lib/alchemy/testsuite/task-4.c
+++ b/testsuite/smokey/alchemytests/task-4.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/task-5.c b/testsuite/smokey/alchemytests/task-5.c
similarity index 98%
rename from lib/alchemy/testsuite/task-5.c
rename to testsuite/smokey/alchemytests/task-5.c
index 3c0fa427c3..b9075945d1 100644
--- a/lib/alchemy/testsuite/task-5.c
+++ b/testsuite/smokey/alchemytests/task-5.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/task-6.c b/testsuite/smokey/alchemytests/task-6.c
similarity index 97%
rename from lib/alchemy/testsuite/task-6.c
rename to testsuite/smokey/alchemytests/task-6.c
index 7c88fde9c5..fa58d0fdca 100644
--- a/lib/alchemy/testsuite/task-6.c
+++ b/testsuite/smokey/alchemytests/task-6.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/task-7.c b/testsuite/smokey/alchemytests/task-7.c
similarity index 98%
rename from lib/alchemy/testsuite/task-7.c
rename to testsuite/smokey/alchemytests/task-7.c
index 1350bb39cf..d118abf423 100644
--- a/lib/alchemy/testsuite/task-7.c
+++ b/testsuite/smokey/alchemytests/task-7.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/task-8.c b/testsuite/smokey/alchemytests/task-8.c
similarity index 97%
rename from lib/alchemy/testsuite/task-8.c
rename to testsuite/smokey/alchemytests/task-8.c
index bb6dfff062..959b3d3c4c 100644
--- a/lib/alchemy/testsuite/task-8.c
+++ b/testsuite/smokey/alchemytests/task-8.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/alchemy/testsuite/task-9.c b/testsuite/smokey/alchemytests/task-9.c
similarity index 97%
rename from lib/alchemy/testsuite/task-9.c
rename to testsuite/smokey/alchemytests/task-9.c
index e358154c59..56cc7bfebc 100644
--- a/lib/alchemy/testsuite/task-9.c
+++ b/testsuite/smokey/alchemytests/task-9.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <signal.h>
-- 
2.35.3

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

* [PATCH v7 02/10] testsuite: Fully integrate psostests into smokey
  2023-07-25  8:29             ` [PATCH 02/10] testsuite: Fully integrate psostests " Aaron Marcher
@ 2023-08-09 11:32               ` Jan Kiszka
  0 siblings, 0 replies; 112+ messages in thread
From: Jan Kiszka @ 2023-08-09 11:32 UTC (permalink / raw)
  To: Aaron Marcher, xenomai; +Cc: richard

From: Aaron Marcher <aaron@sigma-star.at>

Just like for alchemytests, integrate them into our testsuite.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
[Jan: fix whitespace issue, clean up makefile, do not hook into automake yet]
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 configure.ac                                  |   2 +-
 lib/psos/testsuite/Makefile                   |  49 ------
 testsuite/smokey/psostests/Makefile.am        | 151 ++++++++++++++++++
 .../smokey/psostests}/mq-1.c                  |   1 +
 .../smokey/psostests}/mq-2.c                  |   1 +
 .../smokey/psostests}/mq-3.c                  |   1 +
 testsuite/smokey/psostests/psostests.c        |  56 +++++++
 testsuite/smokey/psostests/psostests_driver.c |  33 ++++
 .../smokey/psostests}/pt-1.c                  |   1 +
 .../smokey/psostests}/rn-1.c                  |   1 +
 .../smokey/psostests}/sem-1.c                 |   1 +
 .../smokey/psostests}/sem-2.c                 |   1 +
 .../smokey/psostests}/task-1.c                |   1 +
 .../smokey/psostests}/task-2.c                |   1 +
 .../smokey/psostests}/task-3.c                |   1 +
 .../smokey/psostests}/task-4.c                |   1 +
 .../smokey/psostests}/task-5.c                |   1 +
 .../smokey/psostests}/task-6.c                |   1 +
 .../smokey/psostests}/task-7.c                |   1 +
 .../smokey/psostests}/task-8.c                |   1 +
 .../smokey/psostests}/task-9.c                |   1 +
 .../smokey/psostests}/tm-1.c                  |   1 +
 .../smokey/psostests}/tm-2.c                  |   1 +
 .../smokey/psostests}/tm-3.c                  |   1 +
 .../smokey/psostests}/tm-4.c                  |   1 +
 .../smokey/psostests}/tm-5.c                  |   1 +
 .../smokey/psostests}/tm-6.c                  |   1 +
 .../smokey/psostests}/tm-7.c                  |   1 +
 28 files changed, 264 insertions(+), 50 deletions(-)
 delete mode 100644 lib/psos/testsuite/Makefile
 create mode 100644 testsuite/smokey/psostests/Makefile.am
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/mq-1.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/mq-2.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/mq-3.c (98%)
 create mode 100644 testsuite/smokey/psostests/psostests.c
 create mode 100644 testsuite/smokey/psostests/psostests_driver.c
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/pt-1.c (96%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/rn-1.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/sem-1.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/sem-2.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-1.c (95%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-2.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-3.c (96%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-4.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-5.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-6.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-7.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-8.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-9.c (98%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-1.c (95%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-2.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-3.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-4.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-5.c (97%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-6.c (95%)
 rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-7.c (95%)

diff --git a/configure.ac b/configure.ac
index fe59333ed4..9db5438eb6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1044,9 +1044,9 @@ AC_CONFIG_FILES([ \
 	testsuite/smokey/can/Makefile \
 	testsuite/smokey/x86io/Makefile \
 	testsuite/smokey/alchemytests/Makefile \
+	testsuite/smokey/psostests/Makefile \
 	testsuite/clocktest/Makefile \
 	testsuite/xeno-test/Makefile \
-	testsuite/psostests/Makefile \
 	testsuite/vxworkstests/Makefile \
 	utils/Makefile \
 	utils/hdb/Makefile \
diff --git a/lib/psos/testsuite/Makefile b/lib/psos/testsuite/Makefile
deleted file mode 100644
index 3330a617ca..0000000000
--- a/lib/psos/testsuite/Makefile
+++ /dev/null
@@ -1,49 +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)
-
-ifeq ($(prefix),)
-$(error Please add <xenomai-install-path>/bin to your PATH variable or specify DESTDIR)
-endif
-
-TESTS := \
-	task-1 task-2 task-3 task-4 task-5 task-6 task-7 task-8 task-9 \
-	tm-1 tm-2 tm-3 tm-4 tm-5 tm-6 tm-7 \
-	mq-1 mq-2 mq-3 \
-	sem-1 sem-2 \
-	pt-1 \
-	rn-1
-
-CFLAGS := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --skin=psos --cflags) -g
-LDFLAGS := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --skin=psos --ldflags)
-CC = $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --cc)
-
-all: $(TESTS)
-
-%: %.c
-	$(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
-
-install: all
-	install -d $(prefix)/testsuite/psos
-	install -t $(prefix)/testsuite/psos $(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
diff --git a/testsuite/smokey/psostests/Makefile.am b/testsuite/smokey/psostests/Makefile.am
new file mode 100644
index 0000000000..ef4a231239
--- /dev/null
+++ b/testsuite/smokey/psostests/Makefile.am
@@ -0,0 +1,151 @@
+testdir = @XENO_TEST_DIR@
+noinst_LIBRARIES = libpsostests.a
+
+libpsostests_a_SOURCES = psostests.c
+libpsostests_a_CPPFLAGS = 	\
+	@XENO_USER_CFLAGS@	\
+	-I$(top_srcdir)		\
+	-I$(top_srcdir)/include \
+	-DXENO_TEST_DIR='"$(XENO_TEST_DIR)"'
+
+CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
+
+test_PROGRAMS =			\
+		psostests       \
+		psostests_mq1	\
+		psostests_mq2	\
+		psostests_mq3	\
+		psostests_pt1	\
+		psostests_rn1	\
+		psostests_sem1	\
+		psostests_sem2	\
+		psostests_tm1	\
+		psostests_tm2	\
+		psostests_tm3	\
+		psostests_tm4	\
+		psostests_tm5	\
+		psostests_tm6	\
+		psostests_tm7	\
+		psostests_task1	\
+		psostests_task2	\
+		psostests_task3	\
+		psostests_task4	\
+		psostests_task5	\
+		psostests_task6	\
+		psostests_task7	\
+		psostests_task8	\
+		psostests_task9
+
+psoscppflags =				\
+	@XENO_USER_CFLAGS@		\
+	-I$(top_srcdir)			\
+	-I$(top_srcdir)/include
+
+psosldadd =							\
+	../../../lib/psos/libpsos@CORE@.la			\
+	../../../lib/copperplate/libcopperplate@CORE@.la	\
+	@XENO_CORE_LDADD@ 					\
+	@XENO_USER_LDADD@					\
+	-lpthread -lrt -lm
+
+psostests_SOURCES = psostests_driver.c
+psostests_CPPFLAGS = $(psoscppflags)
+psostests_LDADD =						\
+	../../../lib/smokey/libsmokey@CORE@.la			\
+	@XENO_CORE_LDADD@ 					\
+	@XENO_USER_LDADD@					\
+	-lpthread -lrt
+psostests_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ $(XENO_POSIX_WRAPPERS)
+
+psostests_mq1_SOURCES = mq-1.c
+psostests_mq1_CPPFLAGS = $(psoscppflags)
+psostests_mq1_LDADD = $(psosldadd)
+psostests_mq1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_mq2_SOURCES = mq-2.c
+psostests_mq2_CPPFLAGS = $(psoscppflags)
+psostests_mq2_LDADD = $(psosldadd)
+psostests_mq2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_mq3_SOURCES = mq-3.c
+psostests_mq3_CPPFLAGS = $(psoscppflags)
+psostests_mq3_LDADD = $(psosldadd)
+psostests_mq3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_pt1_SOURCES = pt-1.c
+psostests_pt1_CPPFLAGS = $(psoscppflags)
+psostests_pt1_LDADD = $(psosldadd)
+psostests_pt1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_rn1_SOURCES = rn-1.c
+psostests_rn1_CPPFLAGS = $(psoscppflags)
+psostests_rn1_LDADD = $(psosldadd)
+psostests_rn1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_sem1_SOURCES = sem-1.c
+psostests_sem1_CPPFLAGS = $(psoscppflags)
+psostests_sem1_LDADD = $(psosldadd)
+psostests_sem1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_sem2_SOURCES = sem-2.c
+psostests_sem2_CPPFLAGS = $(psoscppflags)
+psostests_sem2_LDADD = $(psosldadd)
+psostests_sem2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_tm1_SOURCES = tm-1.c
+psostests_tm1_CPPFLAGS = $(psoscppflags)
+psostests_tm1_LDADD = $(psosldadd)
+psostests_tm1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_tm2_SOURCES = tm-2.c
+psostests_tm2_CPPFLAGS = $(psoscppflags)
+psostests_tm2_LDADD = $(psosldadd)
+psostests_tm2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_tm3_SOURCES = tm-3.c
+psostests_tm3_CPPFLAGS = $(psoscppflags)
+psostests_tm3_LDADD = $(psosldadd)
+psostests_tm3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_tm4_SOURCES = tm-4.c
+psostests_tm4_CPPFLAGS = $(psoscppflags)
+psostests_tm4_LDADD = $(psosldadd)
+psostests_tm4_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_tm5_SOURCES = tm-5.c
+psostests_tm5_CPPFLAGS = $(psoscppflags)
+psostests_tm5_LDADD = $(psosldadd)
+psostests_tm5_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_tm6_SOURCES = tm-6.c
+psostests_tm6_CPPFLAGS = $(psoscppflags)
+psostests_tm6_LDADD = $(psosldadd)
+psostests_tm6_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_tm7_SOURCES = tm-7.c
+psostests_tm7_CPPFLAGS = $(psoscppflags)
+psostests_tm7_LDADD = $(psosldadd)
+psostests_tm7_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task1_SOURCES = task-1.c
+psostests_task1_CPPFLAGS = $(psoscppflags)
+psostests_task1_LDADD = $(psosldadd)
+psostests_task1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task2_SOURCES = task-2.c
+psostests_task2_CPPFLAGS = $(psoscppflags)
+psostests_task2_LDADD = $(psosldadd)
+psostests_task2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task3_SOURCES = task-3.c
+psostests_task3_CPPFLAGS = $(psoscppflags)
+psostests_task3_LDADD = $(psosldadd)
+psostests_task3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task4_SOURCES = task-4.c
+psostests_task4_CPPFLAGS = $(psoscppflags)
+psostests_task4_LDADD = $(psosldadd)
+psostests_task4_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task5_SOURCES = task-5.c
+psostests_task5_CPPFLAGS = $(psoscppflags)
+psostests_task5_LDADD = $(psosldadd)
+psostests_task5_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task6_SOURCES = task-6.c
+psostests_task6_CPPFLAGS = $(psoscppflags)
+psostests_task6_LDADD = $(psosldadd)
+psostests_task6_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task7_SOURCES = task-7.c
+psostests_task7_CPPFLAGS = $(psoscppflags)
+psostests_task7_LDADD = $(psosldadd)
+psostests_task7_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task8_SOURCES = task-8.c
+psostests_task8_CPPFLAGS = $(psoscppflags)
+psostests_task8_LDADD = $(psosldadd)
+psostests_task8_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+psostests_task9_SOURCES = task-9.c
+psostests_task9_CPPFLAGS = $(psoscppflags)
+psostests_task9_LDADD = $(psosldadd)
+psostests_task9_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
diff --git a/lib/psos/testsuite/mq-1.c b/testsuite/smokey/psostests/mq-1.c
similarity index 97%
rename from lib/psos/testsuite/mq-1.c
rename to testsuite/smokey/psostests/mq-1.c
index 00f4248984..83a24028ec 100644
--- a/lib/psos/testsuite/mq-1.c
+++ b/testsuite/smokey/psostests/mq-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/mq-2.c b/testsuite/smokey/psostests/mq-2.c
similarity index 98%
rename from lib/psos/testsuite/mq-2.c
rename to testsuite/smokey/psostests/mq-2.c
index 48b4e611cd..8af8b42d6e 100644
--- a/lib/psos/testsuite/mq-2.c
+++ b/testsuite/smokey/psostests/mq-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/mq-3.c b/testsuite/smokey/psostests/mq-3.c
similarity index 98%
rename from lib/psos/testsuite/mq-3.c
rename to testsuite/smokey/psostests/mq-3.c
index 942b1a325f..1171a70544 100644
--- a/lib/psos/testsuite/mq-3.c
+++ b/testsuite/smokey/psostests/mq-3.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/testsuite/smokey/psostests/psostests.c b/testsuite/smokey/psostests/psostests.c
new file mode 100644
index 0000000000..0221f65afd
--- /dev/null
+++ b/testsuite/smokey/psostests/psostests.c
@@ -0,0 +1,56 @@
+// SPDX-License-Identifier: GPL-2.0
+#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>
+
+#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", XENO_TEST_DIR, t->name);
+	if (ret == -1)
+		return -ENOMEM;
+
+	ret = system(tst_path);
+	free(tst_path);
+
+	return ret;
+}
+
+TEST(psostests)
+TEST(psostests_mq1)
+TEST(psostests_mq2)
+TEST(psostests_mq3)
+TEST(psostests_pt1)
+TEST(psostests_rn1)
+TEST(psostests_sem1)
+TEST(psostests_sem2)
+TEST(psostests_task1)
+TEST(psostests_task2)
+TEST(psostests_task3)
+TEST(psostests_task4)
+TEST(psostests_task5)
+TEST(psostests_task6)
+TEST(psostests_task7)
+TEST(psostests_task8)
+TEST(psostests_task9)
+TEST(psostests_tm1)
+TEST(psostests_tm2)
+TEST(psostests_tm3)
+TEST(psostests_tm4)
+TEST(psostests_tm5)
+TEST(psostests_tm6)
+TEST(psostests_tm7)
diff --git a/testsuite/smokey/psostests/psostests_driver.c b/testsuite/smokey/psostests/psostests_driver.c
new file mode 100644
index 0000000000..c931d196d5
--- /dev/null
+++ b/testsuite/smokey/psostests/psostests_driver.c
@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: GPL-2.0
+#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>
+
+int main(int argc, char *const argv[])
+{
+       struct smokey_test *t;
+       int ret, fails = 0;
+
+       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;
+}
diff --git a/lib/psos/testsuite/pt-1.c b/testsuite/smokey/psostests/pt-1.c
similarity index 96%
rename from lib/psos/testsuite/pt-1.c
rename to testsuite/smokey/psostests/pt-1.c
index 99f93ca1a1..48f9799f79 100644
--- a/lib/psos/testsuite/pt-1.c
+++ b/testsuite/smokey/psostests/pt-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <memory.h>
diff --git a/lib/psos/testsuite/rn-1.c b/testsuite/smokey/psostests/rn-1.c
similarity index 97%
rename from lib/psos/testsuite/rn-1.c
rename to testsuite/smokey/psostests/rn-1.c
index da136f3815..42f86a7eab 100644
--- a/lib/psos/testsuite/rn-1.c
+++ b/testsuite/smokey/psostests/rn-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <memory.h>
diff --git a/lib/psos/testsuite/sem-1.c b/testsuite/smokey/psostests/sem-1.c
similarity index 98%
rename from lib/psos/testsuite/sem-1.c
rename to testsuite/smokey/psostests/sem-1.c
index 61fa4b6051..d32334c02c 100644
--- a/lib/psos/testsuite/sem-1.c
+++ b/testsuite/smokey/psostests/sem-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/sem-2.c b/testsuite/smokey/psostests/sem-2.c
similarity index 97%
rename from lib/psos/testsuite/sem-2.c
rename to testsuite/smokey/psostests/sem-2.c
index a15bc388f7..8223434f5e 100644
--- a/lib/psos/testsuite/sem-2.c
+++ b/testsuite/smokey/psostests/sem-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/task-1.c b/testsuite/smokey/psostests/task-1.c
similarity index 95%
rename from lib/psos/testsuite/task-1.c
rename to testsuite/smokey/psostests/task-1.c
index f4bb71b7eb..a0e6efa972 100644
--- a/lib/psos/testsuite/task-1.c
+++ b/testsuite/smokey/psostests/task-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/task-2.c b/testsuite/smokey/psostests/task-2.c
similarity index 98%
rename from lib/psos/testsuite/task-2.c
rename to testsuite/smokey/psostests/task-2.c
index d7f9fa06ff..d24c134653 100644
--- a/lib/psos/testsuite/task-2.c
+++ b/testsuite/smokey/psostests/task-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/task-3.c b/testsuite/smokey/psostests/task-3.c
similarity index 96%
rename from lib/psos/testsuite/task-3.c
rename to testsuite/smokey/psostests/task-3.c
index d775f28232..d13e30423b 100644
--- a/lib/psos/testsuite/task-3.c
+++ b/testsuite/smokey/psostests/task-3.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/task-4.c b/testsuite/smokey/psostests/task-4.c
similarity index 97%
rename from lib/psos/testsuite/task-4.c
rename to testsuite/smokey/psostests/task-4.c
index 3bca00271e..ec6a99609f 100644
--- a/lib/psos/testsuite/task-4.c
+++ b/testsuite/smokey/psostests/task-4.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/task-5.c b/testsuite/smokey/psostests/task-5.c
similarity index 98%
rename from lib/psos/testsuite/task-5.c
rename to testsuite/smokey/psostests/task-5.c
index e0124c12b5..dcb8ec6eaa 100644
--- a/lib/psos/testsuite/task-5.c
+++ b/testsuite/smokey/psostests/task-5.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/task-6.c b/testsuite/smokey/psostests/task-6.c
similarity index 98%
rename from lib/psos/testsuite/task-6.c
rename to testsuite/smokey/psostests/task-6.c
index 13c618c578..9cc46e6339 100644
--- a/lib/psos/testsuite/task-6.c
+++ b/testsuite/smokey/psostests/task-6.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/task-7.c b/testsuite/smokey/psostests/task-7.c
similarity index 97%
rename from lib/psos/testsuite/task-7.c
rename to testsuite/smokey/psostests/task-7.c
index 8f5441afa0..9177dbbf46 100644
--- a/lib/psos/testsuite/task-7.c
+++ b/testsuite/smokey/psostests/task-7.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/task-8.c b/testsuite/smokey/psostests/task-8.c
similarity index 98%
rename from lib/psos/testsuite/task-8.c
rename to testsuite/smokey/psostests/task-8.c
index d7c8fb33dd..4543a04fad 100644
--- a/lib/psos/testsuite/task-8.c
+++ b/testsuite/smokey/psostests/task-8.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <xeno_config.h>
diff --git a/lib/psos/testsuite/task-9.c b/testsuite/smokey/psostests/task-9.c
similarity index 98%
rename from lib/psos/testsuite/task-9.c
rename to testsuite/smokey/psostests/task-9.c
index 1ae9929997..f37d6736ed 100644
--- a/lib/psos/testsuite/task-9.c
+++ b/testsuite/smokey/psostests/task-9.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/tm-1.c b/testsuite/smokey/psostests/tm-1.c
similarity index 95%
rename from lib/psos/testsuite/tm-1.c
rename to testsuite/smokey/psostests/tm-1.c
index b2f38f2986..64605d8b99 100644
--- a/lib/psos/testsuite/tm-1.c
+++ b/testsuite/smokey/psostests/tm-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/tm-2.c b/testsuite/smokey/psostests/tm-2.c
similarity index 97%
rename from lib/psos/testsuite/tm-2.c
rename to testsuite/smokey/psostests/tm-2.c
index 44340f5ddc..18ddff4b6e 100644
--- a/lib/psos/testsuite/tm-2.c
+++ b/testsuite/smokey/psostests/tm-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/tm-3.c b/testsuite/smokey/psostests/tm-3.c
similarity index 97%
rename from lib/psos/testsuite/tm-3.c
rename to testsuite/smokey/psostests/tm-3.c
index 260a1314e8..f5a947f463 100644
--- a/lib/psos/testsuite/tm-3.c
+++ b/testsuite/smokey/psostests/tm-3.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/tm-4.c b/testsuite/smokey/psostests/tm-4.c
similarity index 97%
rename from lib/psos/testsuite/tm-4.c
rename to testsuite/smokey/psostests/tm-4.c
index 26697c2fb3..2c8c7a3189 100644
--- a/lib/psos/testsuite/tm-4.c
+++ b/testsuite/smokey/psostests/tm-4.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/tm-5.c b/testsuite/smokey/psostests/tm-5.c
similarity index 97%
rename from lib/psos/testsuite/tm-5.c
rename to testsuite/smokey/psostests/tm-5.c
index 0fca7d023a..d136133987 100644
--- a/lib/psos/testsuite/tm-5.c
+++ b/testsuite/smokey/psostests/tm-5.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/tm-6.c b/testsuite/smokey/psostests/tm-6.c
similarity index 95%
rename from lib/psos/testsuite/tm-6.c
rename to testsuite/smokey/psostests/tm-6.c
index 9debc498c7..ba92c3071f 100644
--- a/lib/psos/testsuite/tm-6.c
+++ b/testsuite/smokey/psostests/tm-6.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/psos/testsuite/tm-7.c b/testsuite/smokey/psostests/tm-7.c
similarity index 95%
rename from lib/psos/testsuite/tm-7.c
rename to testsuite/smokey/psostests/tm-7.c
index 202985daa3..3676502784 100644
--- a/lib/psos/testsuite/tm-7.c
+++ b/testsuite/smokey/psostests/tm-7.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
-- 
2.35.3

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

* [PATCH v7 03/10] testsuite: Fully integrate vwworkstests into smokey
  2023-07-25  8:29             ` [PATCH 03/10] testsuite: Fully integrate vwworkstests " Aaron Marcher
@ 2023-08-09 11:32               ` Jan Kiszka
  2023-08-09 15:02                 ` Jan Kiszka
  0 siblings, 1 reply; 112+ messages in thread
From: Jan Kiszka @ 2023-08-09 11:32 UTC (permalink / raw)
  To: Aaron Marcher, xenomai; +Cc: richard

From: Aaron Marcher <aaron@sigma-star.at>

Same as for alchemytests and psostests.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
[Jan: fix whitespace issues, clean up makefile, do not hook into automake yet]
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 configure.ac                                  |  2 +-
 lib/vxworks/testsuite/Makefile                | 43 ---------
 testsuite/smokey/vxworkstests/Makefile.am     | 95 +++++++++++++++++++
 .../smokey/vxworkstests}/lst-1.c              |  1 +
 .../smokey/vxworkstests}/msgQ-1.c             |  1 +
 .../smokey/vxworkstests}/msgQ-2.c             |  1 +
 .../smokey/vxworkstests}/msgQ-3.c             |  1 +
 .../smokey/vxworkstests}/rng-1.c              |  1 +
 .../smokey/vxworkstests}/sem-1.c              |  1 +
 .../smokey/vxworkstests}/sem-2.c              |  1 +
 .../smokey/vxworkstests}/sem-3.c              |  1 +
 .../smokey/vxworkstests}/sem-4.c              |  1 +
 .../smokey/vxworkstests}/task-1.c             |  1 +
 .../smokey/vxworkstests}/task-2.c             |  1 +
 testsuite/smokey/vxworkstests/vxworkstests.c  | 45 +++++++++
 .../smokey/vxworkstests/vxworkstests_driver.c | 33 +++++++
 .../smokey/vxworkstests}/wd-1.c               |  1 +
 17 files changed, 186 insertions(+), 44 deletions(-)
 delete mode 100644 lib/vxworks/testsuite/Makefile
 create mode 100644 testsuite/smokey/vxworkstests/Makefile.am
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/lst-1.c (99%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-1.c (98%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-2.c (98%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-3.c (98%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/rng-1.c (99%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-1.c (98%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-2.c (98%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-3.c (97%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-4.c (98%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/task-1.c (96%)
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/task-2.c (98%)
 create mode 100644 testsuite/smokey/vxworkstests/vxworkstests.c
 create mode 100644 testsuite/smokey/vxworkstests/vxworkstests_driver.c
 rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/wd-1.c (97%)

diff --git a/configure.ac b/configure.ac
index 9db5438eb6..a601f94cd3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1045,9 +1045,9 @@ AC_CONFIG_FILES([ \
 	testsuite/smokey/x86io/Makefile \
 	testsuite/smokey/alchemytests/Makefile \
 	testsuite/smokey/psostests/Makefile \
+	testsuite/smokey/vxworkstests/Makefile \
 	testsuite/clocktest/Makefile \
 	testsuite/xeno-test/Makefile \
-	testsuite/vxworkstests/Makefile \
 	utils/Makefile \
 	utils/hdb/Makefile \
 	utils/can/Makefile \
diff --git a/lib/vxworks/testsuite/Makefile b/lib/vxworks/testsuite/Makefile
deleted file mode 100644
index 648c9be90a..0000000000
--- a/lib/vxworks/testsuite/Makefile
+++ /dev/null
@@ -1,43 +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)
-
-ifeq ($(prefix),)
-$(error Please add <xenomai-install-path>/bin to your PATH variable or specify DESTDIR)
-endif
-
-TESTS := task-1 task-2 msgQ-1 msgQ-2 msgQ-3 wd-1 sem-1 sem-2 sem-3 sem-4 lst-1 rng-1
-
-CFLAGS := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --skin=vxworks --cflags) -g
-LDFLAGS := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --skin=vxworks --ldflags)
-CC = $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --cc)
-
-all: $(TESTS)
-
-%: %.c
-	$(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
-
-install: all
-	install -d $(prefix)/testsuite/vxworks
-	install -t $(prefix)/testsuite/vxworks $(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
diff --git a/testsuite/smokey/vxworkstests/Makefile.am b/testsuite/smokey/vxworkstests/Makefile.am
new file mode 100644
index 0000000000..a0aa9df764
--- /dev/null
+++ b/testsuite/smokey/vxworkstests/Makefile.am
@@ -0,0 +1,95 @@
+testdir = @XENO_TEST_DIR@
+noinst_LIBRARIES = libvxworkstests.a
+
+libvxworkstests_a_SOURCES = vxworkstests.c
+libvxworkstests_a_CPPFLAGS =	\
+	@XENO_USER_CFLAGS@	\
+	-I$(top_srcdir)		\
+	-I$(top_srcdir)/include \
+	-DXENO_TEST_DIR='"$(XENO_TEST_DIR)"'
+
+CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
+
+test_PROGRAMS =				\
+		vxworkstests		\
+		vxworkstests_lst1	\
+		vxworkstests_msgQ1	\
+		vxworkstests_msgQ2	\
+		vxworkstests_msgQ3	\
+		vxworkstests_rng1	\
+		vxworkstests_sem1	\
+		vxworkstests_sem2	\
+		vxworkstests_sem3	\
+		vxworkstests_sem4	\
+		vxworkstests_wd1	\
+		vxworkstests_task1	\
+		vxworkstests_task2
+
+vxworkscppflags = 			\
+	@XENO_USER_CFLAGS@		\
+	-I$(top_srcdir)/include
+
+vxworksldadd = 							\
+	../../../lib/vxworks/libvxworks@CORE@.la		\
+	../../../lib/copperplate/libcopperplate@CORE@.la	\
+	@XENO_CORE_LDADD@ 					\
+	@XENO_USER_LDADD@					\
+	-lpthread -lrt -lm
+
+vxworkstests_SOURCES = vxworkstests_driver.c
+vxworkstests_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ $(XENO_POSIX_WRAPPERS)
+vxworkstests_LDADD =				\
+	../../../lib/smokey/libsmokey@CORE@.la	\
+	@XENO_CORE_LDADD@ 			\
+	@XENO_USER_LDADD@			\
+	-lpthread -lrt
+
+vxworkstests_lst1_SOURCES = lst-1.c
+vxworkstests_lst1_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_lst1_LDADD = $(vxworksldadd)
+vxworkstests_lst1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_task1_SOURCES = task-1.c
+vxworkstests_task1_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_task1_LDADD = $(vxworksldadd)
+vxworkstests_task1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_task2_SOURCES = task-2.c
+vxworkstests_task2_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_task2_LDADD = $(vxworksldadd)
+vxworkstests_task2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_msgQ1_SOURCES = msgQ-1.c
+vxworkstests_msgQ1_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_msgQ1_LDADD = $(vxworksldadd)
+vxworkstests_msgQ1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_msgQ2_SOURCES = msgQ-2.c
+vxworkstests_msgQ2_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_msgQ2_LDADD = $(vxworksldadd)
+vxworkstests_msgQ2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_msgQ3_SOURCES = msgQ-3.c
+vxworkstests_msgQ3_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_msgQ3_LDADD = $(vxworksldadd)
+vxworkstests_msgQ3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_rng1_SOURCES = rng-1.c
+vxworkstests_rng1_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_rng1_LDADD = $(vxworksldadd)
+vxworkstests_rng1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_sem1_SOURCES = sem-1.c
+vxworkstests_sem1_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_sem1_LDADD = $(vxworksldadd)
+vxworkstests_sem1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_sem2_SOURCES = sem-2.c
+vxworkstests_sem2_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_sem2_LDADD = $(vxworksldadd)
+vxworkstests_sem2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_sem3_SOURCES = sem-3.c
+vxworkstests_sem3_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_sem3_LDADD = $(vxworksldadd)
+vxworkstests_sem3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_sem4_SOURCES = sem-4.c
+vxworkstests_sem4_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_sem4_LDADD = $(vxworksldadd)
+vxworkstests_sem4_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
+vxworkstests_wd1_SOURCES = wd-1.c
+vxworkstests_wd1_CPPFLAGS = $(vxworkscppflags)
+vxworkstests_wd1_LDADD = $(vxworksldadd)
+vxworkstests_wd1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
diff --git a/lib/vxworks/testsuite/lst-1.c b/testsuite/smokey/vxworkstests/lst-1.c
similarity index 99%
rename from lib/vxworks/testsuite/lst-1.c
rename to testsuite/smokey/vxworkstests/lst-1.c
index 03dec367d7..878f32c902 100644
--- a/lib/vxworks/testsuite/lst-1.c
+++ b/testsuite/smokey/vxworkstests/lst-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/vxworks/testsuite/msgQ-1.c b/testsuite/smokey/vxworkstests/msgQ-1.c
similarity index 98%
rename from lib/vxworks/testsuite/msgQ-1.c
rename to testsuite/smokey/vxworkstests/msgQ-1.c
index fd15e1ddd9..71eedd44f5 100644
--- a/lib/vxworks/testsuite/msgQ-1.c
+++ b/testsuite/smokey/vxworkstests/msgQ-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/vxworks/testsuite/msgQ-2.c b/testsuite/smokey/vxworkstests/msgQ-2.c
similarity index 98%
rename from lib/vxworks/testsuite/msgQ-2.c
rename to testsuite/smokey/vxworkstests/msgQ-2.c
index 58f11e3a16..d3ee1397c7 100644
--- a/lib/vxworks/testsuite/msgQ-2.c
+++ b/testsuite/smokey/vxworkstests/msgQ-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/vxworks/testsuite/msgQ-3.c b/testsuite/smokey/vxworkstests/msgQ-3.c
similarity index 98%
rename from lib/vxworks/testsuite/msgQ-3.c
rename to testsuite/smokey/vxworkstests/msgQ-3.c
index 1a4e20d26c..a23d5c3d09 100644
--- a/lib/vxworks/testsuite/msgQ-3.c
+++ b/testsuite/smokey/vxworkstests/msgQ-3.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/vxworks/testsuite/rng-1.c b/testsuite/smokey/vxworkstests/rng-1.c
similarity index 99%
rename from lib/vxworks/testsuite/rng-1.c
rename to testsuite/smokey/vxworkstests/rng-1.c
index dd944a58ac..1e179c6f66 100644
--- a/lib/vxworks/testsuite/rng-1.c
+++ b/testsuite/smokey/vxworkstests/rng-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
diff --git a/lib/vxworks/testsuite/sem-1.c b/testsuite/smokey/vxworkstests/sem-1.c
similarity index 98%
rename from lib/vxworks/testsuite/sem-1.c
rename to testsuite/smokey/vxworkstests/sem-1.c
index 245eb5c484..b64aba3b8f 100644
--- a/lib/vxworks/testsuite/sem-1.c
+++ b/testsuite/smokey/vxworkstests/sem-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/vxworks/testsuite/sem-2.c b/testsuite/smokey/vxworkstests/sem-2.c
similarity index 98%
rename from lib/vxworks/testsuite/sem-2.c
rename to testsuite/smokey/vxworkstests/sem-2.c
index c9befc4d9f..67caf2924f 100644
--- a/lib/vxworks/testsuite/sem-2.c
+++ b/testsuite/smokey/vxworkstests/sem-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/vxworks/testsuite/sem-3.c b/testsuite/smokey/vxworkstests/sem-3.c
similarity index 97%
rename from lib/vxworks/testsuite/sem-3.c
rename to testsuite/smokey/vxworkstests/sem-3.c
index 1041d25b0d..1f4252e3d9 100644
--- a/lib/vxworks/testsuite/sem-3.c
+++ b/testsuite/smokey/vxworkstests/sem-3.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/vxworks/testsuite/sem-4.c b/testsuite/smokey/vxworkstests/sem-4.c
similarity index 98%
rename from lib/vxworks/testsuite/sem-4.c
rename to testsuite/smokey/vxworkstests/sem-4.c
index 5c82169e19..0a8daedb1d 100644
--- a/lib/vxworks/testsuite/sem-4.c
+++ b/testsuite/smokey/vxworkstests/sem-4.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/vxworks/testsuite/task-1.c b/testsuite/smokey/vxworkstests/task-1.c
similarity index 96%
rename from lib/vxworks/testsuite/task-1.c
rename to testsuite/smokey/vxworkstests/task-1.c
index 3cf5f38061..a07d643c39 100644
--- a/lib/vxworks/testsuite/task-1.c
+++ b/testsuite/smokey/vxworkstests/task-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
diff --git a/lib/vxworks/testsuite/task-2.c b/testsuite/smokey/vxworkstests/task-2.c
similarity index 98%
rename from lib/vxworks/testsuite/task-2.c
rename to testsuite/smokey/vxworkstests/task-2.c
index 46d99a266b..7f9f0f0020 100644
--- a/lib/vxworks/testsuite/task-2.c
+++ b/testsuite/smokey/vxworkstests/task-2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/testsuite/smokey/vxworkstests/vxworkstests.c b/testsuite/smokey/vxworkstests/vxworkstests.c
new file mode 100644
index 0000000000..183df35095
--- /dev/null
+++ b/testsuite/smokey/vxworkstests/vxworkstests.c
@@ -0,0 +1,45 @@
+// SPDX-License-Identifier: GPL-2.0
+#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>
+
+#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", XENO_TEST_DIR, t->name);
+	if (ret == -1)
+		return -ENOMEM;
+
+	ret = system(tst_path);
+	free(tst_path);
+
+	return ret;
+}
+
+TEST(vxworkstests)
+TEST(vxworkstests_lst1)
+TEST(vxworkstests_msgQ1)
+TEST(vxworkstests_msgQ2)
+TEST(vxworkstests_msgQ3)
+TEST(vxworkstests_rng1)
+TEST(vxworkstests_sem1)
+TEST(vxworkstests_sem2)
+TEST(vxworkstests_sem3)
+TEST(vxworkstests_sem4)
+TEST(vxworkstests_wd1)
+TEST(vxworkstests_task1)
+TEST(vxworkstests_task2)
diff --git a/testsuite/smokey/vxworkstests/vxworkstests_driver.c b/testsuite/smokey/vxworkstests/vxworkstests_driver.c
new file mode 100644
index 0000000000..7cacbb399b
--- /dev/null
+++ b/testsuite/smokey/vxworkstests/vxworkstests_driver.c
@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: GPL-2.0
+#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>
+
+int main(int argc, char *const argv[])
+{
+	struct smokey_test *t;
+	int ret, fails = 0;
+
+	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;
+}
diff --git a/lib/vxworks/testsuite/wd-1.c b/testsuite/smokey/vxworkstests/wd-1.c
similarity index 97%
rename from lib/vxworks/testsuite/wd-1.c
rename to testsuite/smokey/vxworkstests/wd-1.c
index b557545e8b..7da5d4dcbb 100644
--- a/lib/vxworks/testsuite/wd-1.c
+++ b/testsuite/smokey/vxworkstests/wd-1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 #include <stdio.h>
 #include <stdlib.h>
 #include <copperplate/traceobj.h>
-- 
2.35.3

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

* [PATCH v7 11/10] testsuite/smokey: Hook up new tests
  2023-07-25  8:29           ` [PATCH v6 00/10] Revive alchemy, pSOS and VxWorks tests Aaron Marcher
                               ` (11 preceding siblings ...)
  2023-08-09  7:36             ` Jan Kiszka
@ 2023-08-09 11:32             ` Jan Kiszka
  12 siblings, 0 replies; 112+ messages in thread
From: Jan Kiszka @ 2023-08-09 11:32 UTC (permalink / raw)
  To: Aaron Marcher, xenomai; +Cc: richard

From: Jan Kiszka <jan.kiszka@siemens.com>

Now that all their build and runtime issues are fixed, we can hook them
up.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 testsuite/smokey/Makefile.am | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/testsuite/smokey/Makefile.am b/testsuite/smokey/Makefile.am
index 79dc61e9fd..b7654682d5 100644
--- a/testsuite/smokey/Makefile.am
+++ b/testsuite/smokey/Makefile.am
@@ -40,12 +40,18 @@ COBALT_SUBDIRS = 	\
 	tsc		\
 	vdso-access 	\
 	xddp		\
-	y2038
+	y2038		\
+	alchemytests	\
+	vxworkstests	\
+	psostests
 
 MERCURY_SUBDIRS =	\
 	memory-heapmem	\
 	memory-tlsf	\
-	memcheck
+	memcheck	\
+	alchemytests	\
+	vxworkstests	\
+	psostests
 
 DIST_SUBDIRS = 		\
 	arith 		\
@@ -80,7 +86,10 @@ DIST_SUBDIRS = 		\
 	tsc		\
 	vdso-access 	\
 	xddp		\
-	y2038
+	y2038		\
+	alchemytests	\
+	vxworkstests	\
+	psostests
 
 if XENO_X86
 DIST_SUBDIRS += x86io
-- 
2.35.3

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

* Re: [PATCH v6 00/10] Revive alchemy, pSOS and VxWorks tests
  2023-08-09  7:36             ` Jan Kiszka
@ 2023-08-09 11:33               ` Jan Kiszka
  2023-08-16 12:37                 ` Aaron Marcher
  0 siblings, 1 reply; 112+ messages in thread
From: Jan Kiszka @ 2023-08-09 11:33 UTC (permalink / raw)
  To: Aaron Marcher, xenomai; +Cc: richard

On 09.08.23 09:36, Jan Kiszka wrote:
> On 25.07.23 10:29, Aaron Marcher wrote:
>> This patch series fully integrates the currently abandoned alchemy, pSOS
>> and VxWorks tests into Xenomai's testsuite.
>> For each test, a Smokey testcase is hooked up.
>>
>> Changes since v5:
>> - Improved task-2 fix commit message
>>
>> Aaron Marcher (7):
>>   testsuite: Fully integrate alchemytests into smokey
>>   testsuite: Fully integrate psostests into smokey
>>   testsuite: Fully integrate vwworkstests into smokey
>>   alchemytests: Check pipe-1 asprintf ret value
>>   alchemytests: Fix task-2
>>   alchemytests: Fix task-5 logic
>>   testsuite: disable broken tests
>>
>> Richard Weinberger (3):
>>   testsuite: Remove old alchemytests Makefile
>>   alchemytests: Fix gcc warning in buffer-1
>>   alchemytests: Fix gcc warning in task-9
>>
>>  configure.ac                                  |   7 +-
>>  lib/alchemy/testsuite/Makefile                |  70 ---------
>>  lib/psos/testsuite/Makefile                   |  49 ------
>>  lib/vxworks/testsuite/Makefile                |  43 -----
>>  testsuite/smokey/Makefile.am                  |  15 +-
>>  testsuite/smokey/alchemytests/Makefile.am     | 148 ++++++++++++++++++
>>  .../smokey/alchemytests}/alarm-1.c            |   1 +
>>  testsuite/smokey/alchemytests/alchemytests.c  |  56 +++++++
>>  .../smokey/alchemytests/alchemytests_driver.c |  33 ++++
>>  .../smokey/alchemytests}/buffer-1.c           |   3 +-
>>  .../smokey/alchemytests}/event-1.c            |   1 +
>>  .../smokey/alchemytests}/heap-1.c             |   1 +
>>  .../smokey/alchemytests}/heap-2.c             |   1 +
>>  .../smokey/alchemytests}/mq-1.c               |   1 +
>>  .../smokey/alchemytests}/mq-2.c               |   1 +
>>  .../smokey/alchemytests}/mq-3.c               |   1 +
>>  .../smokey/alchemytests}/mutex-1.c            |   1 +
>>  .../smokey/alchemytests}/pipe-1.c             |   7 +-
>>  .../smokey/alchemytests}/sem-1.c              |   1 +
>>  .../smokey/alchemytests}/sem-2.c              |   1 +
>>  .../smokey/alchemytests}/task-1.c             |   1 +
>>  .../smokey/alchemytests}/task-10.c            |   1 +
>>  .../smokey/alchemytests}/task-2.c             |   5 +-
>>  .../smokey/alchemytests}/task-3.c             |   1 +
>>  .../smokey/alchemytests}/task-4.c             |   1 +
>>  .../smokey/alchemytests}/task-5.c             |  11 +-
>>  .../smokey/alchemytests}/task-6.c             |   1 +
>>  .../smokey/alchemytests}/task-7.c             |   1 +
>>  .../smokey/alchemytests}/task-8.c             |   1 +
>>  .../smokey/alchemytests}/task-9.c             |   3 +-
>>  testsuite/smokey/psostests/Makefile.am        | 148 ++++++++++++++++++
>>  .../smokey/psostests}/mq-1.c                  |   1 +
>>  .../smokey/psostests}/mq-2.c                  |   1 +
>>  .../smokey/psostests}/mq-3.c                  |   1 +
>>  testsuite/smokey/psostests/psostests.c        |  69 ++++++++
>>  testsuite/smokey/psostests/psostests_driver.c |  34 ++++
>>  .../smokey/psostests}/pt-1.c                  |   1 +
>>  .../smokey/psostests}/rn-1.c                  |   1 +
>>  .../smokey/psostests}/sem-1.c                 |   1 +
>>  .../smokey/psostests}/sem-2.c                 |   1 +
>>  .../smokey/psostests}/task-1.c                |   1 +
>>  .../smokey/psostests}/task-2.c                |   1 +
>>  .../smokey/psostests}/task-3.c                |   1 +
>>  .../smokey/psostests}/task-4.c                |   1 +
>>  .../smokey/psostests}/task-5.c                |   1 +
>>  .../smokey/psostests}/task-6.c                |   1 +
>>  .../smokey/psostests}/task-7.c                |   1 +
>>  .../smokey/psostests}/task-8.c                |   1 +
>>  .../smokey/psostests}/task-9.c                |   1 +
>>  .../smokey/psostests}/tm-1.c                  |   1 +
>>  .../smokey/psostests}/tm-2.c                  |   1 +
>>  .../smokey/psostests}/tm-3.c                  |   1 +
>>  .../smokey/psostests}/tm-4.c                  |   1 +
>>  .../smokey/psostests}/tm-5.c                  |   1 +
>>  .../smokey/psostests}/tm-6.c                  |   1 +
>>  .../smokey/psostests}/tm-7.c                  |   1 +
>>  testsuite/smokey/vxworkstests/Makefile.am     |  94 +++++++++++
>>  .../smokey/vxworkstests}/lst-1.c              |   1 +
>>  .../smokey/vxworkstests}/msgQ-1.c             |   1 +
>>  .../smokey/vxworkstests}/msgQ-2.c             |   1 +
>>  .../smokey/vxworkstests}/msgQ-3.c             |   1 +
>>  .../smokey/vxworkstests}/rng-1.c              |   1 +
>>  .../smokey/vxworkstests}/sem-1.c              |   1 +
>>  .../smokey/vxworkstests}/sem-2.c              |   1 +
>>  .../smokey/vxworkstests}/sem-3.c              |   1 +
>>  .../smokey/vxworkstests}/sem-4.c              |   1 +
>>  .../smokey/vxworkstests}/task-1.c             |   1 +
>>  .../smokey/vxworkstests}/task-2.c             |   1 +
>>  testsuite/smokey/vxworkstests/vxworkstests.c  |  46 ++++++
>>  .../smokey/vxworkstests/vxworkstests_driver.c |  33 ++++
>>  .../smokey/vxworkstests}/wd-1.c               |   1 +
>>  71 files changed, 749 insertions(+), 177 deletions(-)
>>  delete mode 100644 lib/alchemy/testsuite/Makefile
>>  delete mode 100644 lib/psos/testsuite/Makefile
>>  delete mode 100644 lib/vxworks/testsuite/Makefile
>>  create mode 100644 testsuite/smokey/alchemytests/Makefile.am
>>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/alarm-1.c (97%)
>>  create mode 100644 testsuite/smokey/alchemytests/alchemytests.c
>>  create mode 100644 testsuite/smokey/alchemytests/alchemytests_driver.c
>>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/buffer-1.c (97%)
>>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/event-1.c (98%)
>>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/heap-1.c (98%)
>>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/heap-2.c (98%)
>>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-1.c (98%)
>>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-2.c (98%)
>>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-3.c (98%)
>>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mutex-1.c (98%)
>>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/pipe-1.c (96%)
>>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/sem-1.c (98%)
>>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/sem-2.c (97%)
>>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-1.c (94%)
>>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-10.c (97%)
>>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-2.c (95%)
>>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-3.c (97%)
>>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-4.c (98%)
>>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-5.c (98%)
>>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-6.c (97%)
>>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-7.c (98%)
>>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-8.c (97%)
>>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-9.c (94%)
>>  create mode 100644 testsuite/smokey/psostests/Makefile.am
>>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/mq-1.c (97%)
>>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/mq-2.c (98%)
>>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/mq-3.c (98%)
>>  create mode 100644 testsuite/smokey/psostests/psostests.c
>>  create mode 100644 testsuite/smokey/psostests/psostests_driver.c
>>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/pt-1.c (96%)
>>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/rn-1.c (97%)
>>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/sem-1.c (98%)
>>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/sem-2.c (97%)
>>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-1.c (95%)
>>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-2.c (98%)
>>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-3.c (96%)
>>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-4.c (97%)
>>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-5.c (98%)
>>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-6.c (98%)
>>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-7.c (97%)
>>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-8.c (98%)
>>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-9.c (98%)
>>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-1.c (95%)
>>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-2.c (97%)
>>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-3.c (97%)
>>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-4.c (97%)
>>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-5.c (97%)
>>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-6.c (95%)
>>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-7.c (95%)
>>  create mode 100644 testsuite/smokey/vxworkstests/Makefile.am
>>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/lst-1.c (99%)
>>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-1.c (98%)
>>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-2.c (98%)
>>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-3.c (98%)
>>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/rng-1.c (99%)
>>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-1.c (98%)
>>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-2.c (98%)
>>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-3.c (97%)
>>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-4.c (98%)
>>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/task-1.c (96%)
>>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/task-2.c (98%)
>>  create mode 100644 testsuite/smokey/vxworkstests/vxworkstests.c
>>  create mode 100644 testsuite/smokey/vxworkstests/vxworkstests_driver.c
>>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/wd-1.c (97%)
>>
> 
> All applied, just with some whitespace massaging and a reordering of
> when the build system is actually updated. See next branch for the result.
> 

There were also bugs in the makefiles, breaking vxworks and psos build
on debian bullseye toolchain at least. Updated patches submitted.

Jan

-- 
Siemens AG, Technology
Linux Expert Center


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

* Re: [PATCH v7 03/10] testsuite: Fully integrate vwworkstests into smokey
  2023-08-09 11:32               ` [PATCH v7 " Jan Kiszka
@ 2023-08-09 15:02                 ` Jan Kiszka
  0 siblings, 0 replies; 112+ messages in thread
From: Jan Kiszka @ 2023-08-09 15:02 UTC (permalink / raw)
  To: Aaron Marcher, xenomai; +Cc: richard

On 09.08.23 13:32, Jan Kiszka wrote:
> From: Aaron Marcher <aaron@sigma-star.at>
> 
> Same as for alchemytests and psostests.
> 
> Signed-off-by: Richard Weinberger <richard@nod.at>
> Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
> [Jan: fix whitespace issues, clean up makefile, do not hook into automake yet]
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  configure.ac                                  |  2 +-
>  lib/vxworks/testsuite/Makefile                | 43 ---------
>  testsuite/smokey/vxworkstests/Makefile.am     | 95 +++++++++++++++++++
>  .../smokey/vxworkstests}/lst-1.c              |  1 +
>  .../smokey/vxworkstests}/msgQ-1.c             |  1 +
>  .../smokey/vxworkstests}/msgQ-2.c             |  1 +
>  .../smokey/vxworkstests}/msgQ-3.c             |  1 +
>  .../smokey/vxworkstests}/rng-1.c              |  1 +
>  .../smokey/vxworkstests}/sem-1.c              |  1 +
>  .../smokey/vxworkstests}/sem-2.c              |  1 +
>  .../smokey/vxworkstests}/sem-3.c              |  1 +
>  .../smokey/vxworkstests}/sem-4.c              |  1 +
>  .../smokey/vxworkstests}/task-1.c             |  1 +
>  .../smokey/vxworkstests}/task-2.c             |  1 +
>  testsuite/smokey/vxworkstests/vxworkstests.c  | 45 +++++++++
>  .../smokey/vxworkstests/vxworkstests_driver.c | 33 +++++++
>  .../smokey/vxworkstests}/wd-1.c               |  1 +
>  17 files changed, 186 insertions(+), 44 deletions(-)
>  delete mode 100644 lib/vxworks/testsuite/Makefile
>  create mode 100644 testsuite/smokey/vxworkstests/Makefile.am
>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/lst-1.c (99%)
>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-1.c (98%)
>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-2.c (98%)
>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-3.c (98%)
>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/rng-1.c (99%)
>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-1.c (98%)
>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-2.c (98%)
>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-3.c (97%)
>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-4.c (98%)
>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/task-1.c (96%)
>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/task-2.c (98%)
>  create mode 100644 testsuite/smokey/vxworkstests/vxworkstests.c
>  create mode 100644 testsuite/smokey/vxworkstests/vxworkstests_driver.c
>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/wd-1.c (97%)
> 
> diff --git a/configure.ac b/configure.ac
> index 9db5438eb6..a601f94cd3 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1045,9 +1045,9 @@ AC_CONFIG_FILES([ \
>  	testsuite/smokey/x86io/Makefile \
>  	testsuite/smokey/alchemytests/Makefile \
>  	testsuite/smokey/psostests/Makefile \
> +	testsuite/smokey/vxworkstests/Makefile \
>  	testsuite/clocktest/Makefile \
>  	testsuite/xeno-test/Makefile \
> -	testsuite/vxworkstests/Makefile \
>  	utils/Makefile \
>  	utils/hdb/Makefile \
>  	utils/can/Makefile \
> diff --git a/lib/vxworks/testsuite/Makefile b/lib/vxworks/testsuite/Makefile
> deleted file mode 100644
> index 648c9be90a..0000000000
> --- a/lib/vxworks/testsuite/Makefile
> +++ /dev/null
> @@ -1,43 +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)
> -
> -ifeq ($(prefix),)
> -$(error Please add <xenomai-install-path>/bin to your PATH variable or specify DESTDIR)
> -endif
> -
> -TESTS := task-1 task-2 msgQ-1 msgQ-2 msgQ-3 wd-1 sem-1 sem-2 sem-3 sem-4 lst-1 rng-1
> -
> -CFLAGS := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --skin=vxworks --cflags) -g
> -LDFLAGS := $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --skin=vxworks --ldflags)
> -CC = $(shell DESTDIR=$(DESTDIR) $(XENO_CONFIG) --cc)
> -
> -all: $(TESTS)
> -
> -%: %.c
> -	$(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
> -
> -install: all
> -	install -d $(prefix)/testsuite/vxworks
> -	install -t $(prefix)/testsuite/vxworks $(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
> diff --git a/testsuite/smokey/vxworkstests/Makefile.am b/testsuite/smokey/vxworkstests/Makefile.am
> new file mode 100644
> index 0000000000..a0aa9df764
> --- /dev/null
> +++ b/testsuite/smokey/vxworkstests/Makefile.am
> @@ -0,0 +1,95 @@
> +testdir = @XENO_TEST_DIR@
> +noinst_LIBRARIES = libvxworkstests.a
> +
> +libvxworkstests_a_SOURCES = vxworkstests.c
> +libvxworkstests_a_CPPFLAGS =	\
> +	@XENO_USER_CFLAGS@	\
> +	-I$(top_srcdir)		\
> +	-I$(top_srcdir)/include \
> +	-DXENO_TEST_DIR='"$(XENO_TEST_DIR)"'
> +
> +CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
> +
> +test_PROGRAMS =				\
> +		vxworkstests		\
> +		vxworkstests_lst1	\
> +		vxworkstests_msgQ1	\
> +		vxworkstests_msgQ2	\
> +		vxworkstests_msgQ3	\
> +		vxworkstests_rng1	\
> +		vxworkstests_sem1	\
> +		vxworkstests_sem2	\
> +		vxworkstests_sem3	\
> +		vxworkstests_sem4	\
> +		vxworkstests_wd1	\
> +		vxworkstests_task1	\
> +		vxworkstests_task2
> +
> +vxworkscppflags = 			\
> +	@XENO_USER_CFLAGS@		\
> +	-I$(top_srcdir)/include
> +
> +vxworksldadd = 							\
> +	../../../lib/vxworks/libvxworks@CORE@.la		\
> +	../../../lib/copperplate/libcopperplate@CORE@.la	\
> +	@XENO_CORE_LDADD@ 					\
> +	@XENO_USER_LDADD@					\
> +	-lpthread -lrt -lm
> +
> +vxworkstests_SOURCES = vxworkstests_driver.c
> +vxworkstests_CPPFLAGS = $(vxworkscppflags)
> +vxworkstests_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ $(XENO_POSIX_WRAPPERS)
> +vxworkstests_LDADD =				\
> +	../../../lib/smokey/libsmokey@CORE@.la	\
> +	@XENO_CORE_LDADD@ 			\
> +	@XENO_USER_LDADD@			\
> +	-lpthread -lrt
> +
> +vxworkstests_lst1_SOURCES = lst-1.c
> +vxworkstests_lst1_CPPFLAGS = $(vxworkscppflags)
> +vxworkstests_lst1_LDADD = $(vxworksldadd)
> +vxworkstests_lst1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +vxworkstests_task1_SOURCES = task-1.c
> +vxworkstests_task1_CPPFLAGS = $(vxworkscppflags)
> +vxworkstests_task1_LDADD = $(vxworksldadd)
> +vxworkstests_task1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +vxworkstests_task2_SOURCES = task-2.c
> +vxworkstests_task2_CPPFLAGS = $(vxworkscppflags)
> +vxworkstests_task2_LDADD = $(vxworksldadd)
> +vxworkstests_task2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +vxworkstests_msgQ1_SOURCES = msgQ-1.c
> +vxworkstests_msgQ1_CPPFLAGS = $(vxworkscppflags)
> +vxworkstests_msgQ1_LDADD = $(vxworksldadd)
> +vxworkstests_msgQ1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +vxworkstests_msgQ2_SOURCES = msgQ-2.c
> +vxworkstests_msgQ2_CPPFLAGS = $(vxworkscppflags)
> +vxworkstests_msgQ2_LDADD = $(vxworksldadd)
> +vxworkstests_msgQ2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +vxworkstests_msgQ3_SOURCES = msgQ-3.c
> +vxworkstests_msgQ3_CPPFLAGS = $(vxworkscppflags)
> +vxworkstests_msgQ3_LDADD = $(vxworksldadd)
> +vxworkstests_msgQ3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +vxworkstests_rng1_SOURCES = rng-1.c
> +vxworkstests_rng1_CPPFLAGS = $(vxworkscppflags)
> +vxworkstests_rng1_LDADD = $(vxworksldadd)
> +vxworkstests_rng1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +vxworkstests_sem1_SOURCES = sem-1.c
> +vxworkstests_sem1_CPPFLAGS = $(vxworkscppflags)
> +vxworkstests_sem1_LDADD = $(vxworksldadd)
> +vxworkstests_sem1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +vxworkstests_sem2_SOURCES = sem-2.c
> +vxworkstests_sem2_CPPFLAGS = $(vxworkscppflags)
> +vxworkstests_sem2_LDADD = $(vxworksldadd)
> +vxworkstests_sem2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +vxworkstests_sem3_SOURCES = sem-3.c
> +vxworkstests_sem3_CPPFLAGS = $(vxworkscppflags)
> +vxworkstests_sem3_LDADD = $(vxworksldadd)
> +vxworkstests_sem3_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +vxworkstests_sem4_SOURCES = sem-4.c
> +vxworkstests_sem4_CPPFLAGS = $(vxworkscppflags)
> +vxworkstests_sem4_LDADD = $(vxworksldadd)
> +vxworkstests_sem4_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> +vxworkstests_wd1_SOURCES = wd-1.c
> +vxworkstests_wd1_CPPFLAGS = $(vxworkscppflags)
> +vxworkstests_wd1_LDADD = $(vxworksldadd)
> +vxworkstests_wd1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
> diff --git a/lib/vxworks/testsuite/lst-1.c b/testsuite/smokey/vxworkstests/lst-1.c
> similarity index 99%
> rename from lib/vxworks/testsuite/lst-1.c
> rename to testsuite/smokey/vxworkstests/lst-1.c
> index 03dec367d7..878f32c902 100644
> --- a/lib/vxworks/testsuite/lst-1.c
> +++ b/testsuite/smokey/vxworkstests/lst-1.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <copperplate/traceobj.h>
> diff --git a/lib/vxworks/testsuite/msgQ-1.c b/testsuite/smokey/vxworkstests/msgQ-1.c
> similarity index 98%
> rename from lib/vxworks/testsuite/msgQ-1.c
> rename to testsuite/smokey/vxworkstests/msgQ-1.c
> index fd15e1ddd9..71eedd44f5 100644
> --- a/lib/vxworks/testsuite/msgQ-1.c
> +++ b/testsuite/smokey/vxworkstests/msgQ-1.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <copperplate/traceobj.h>
> diff --git a/lib/vxworks/testsuite/msgQ-2.c b/testsuite/smokey/vxworkstests/msgQ-2.c
> similarity index 98%
> rename from lib/vxworks/testsuite/msgQ-2.c
> rename to testsuite/smokey/vxworkstests/msgQ-2.c
> index 58f11e3a16..d3ee1397c7 100644
> --- a/lib/vxworks/testsuite/msgQ-2.c
> +++ b/testsuite/smokey/vxworkstests/msgQ-2.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <copperplate/traceobj.h>
> diff --git a/lib/vxworks/testsuite/msgQ-3.c b/testsuite/smokey/vxworkstests/msgQ-3.c
> similarity index 98%
> rename from lib/vxworks/testsuite/msgQ-3.c
> rename to testsuite/smokey/vxworkstests/msgQ-3.c
> index 1a4e20d26c..a23d5c3d09 100644
> --- a/lib/vxworks/testsuite/msgQ-3.c
> +++ b/testsuite/smokey/vxworkstests/msgQ-3.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <copperplate/traceobj.h>
> diff --git a/lib/vxworks/testsuite/rng-1.c b/testsuite/smokey/vxworkstests/rng-1.c
> similarity index 99%
> rename from lib/vxworks/testsuite/rng-1.c
> rename to testsuite/smokey/vxworkstests/rng-1.c
> index dd944a58ac..1e179c6f66 100644
> --- a/lib/vxworks/testsuite/rng-1.c
> +++ b/testsuite/smokey/vxworkstests/rng-1.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdlib.h>
>  #include <string.h>
>  #include <stdio.h>
> diff --git a/lib/vxworks/testsuite/sem-1.c b/testsuite/smokey/vxworkstests/sem-1.c
> similarity index 98%
> rename from lib/vxworks/testsuite/sem-1.c
> rename to testsuite/smokey/vxworkstests/sem-1.c
> index 245eb5c484..b64aba3b8f 100644
> --- a/lib/vxworks/testsuite/sem-1.c
> +++ b/testsuite/smokey/vxworkstests/sem-1.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <copperplate/traceobj.h>
> diff --git a/lib/vxworks/testsuite/sem-2.c b/testsuite/smokey/vxworkstests/sem-2.c
> similarity index 98%
> rename from lib/vxworks/testsuite/sem-2.c
> rename to testsuite/smokey/vxworkstests/sem-2.c
> index c9befc4d9f..67caf2924f 100644
> --- a/lib/vxworks/testsuite/sem-2.c
> +++ b/testsuite/smokey/vxworkstests/sem-2.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <copperplate/traceobj.h>
> diff --git a/lib/vxworks/testsuite/sem-3.c b/testsuite/smokey/vxworkstests/sem-3.c
> similarity index 97%
> rename from lib/vxworks/testsuite/sem-3.c
> rename to testsuite/smokey/vxworkstests/sem-3.c
> index 1041d25b0d..1f4252e3d9 100644
> --- a/lib/vxworks/testsuite/sem-3.c
> +++ b/testsuite/smokey/vxworkstests/sem-3.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <copperplate/traceobj.h>
> diff --git a/lib/vxworks/testsuite/sem-4.c b/testsuite/smokey/vxworkstests/sem-4.c
> similarity index 98%
> rename from lib/vxworks/testsuite/sem-4.c
> rename to testsuite/smokey/vxworkstests/sem-4.c
> index 5c82169e19..0a8daedb1d 100644
> --- a/lib/vxworks/testsuite/sem-4.c
> +++ b/testsuite/smokey/vxworkstests/sem-4.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <copperplate/traceobj.h>
> diff --git a/lib/vxworks/testsuite/task-1.c b/testsuite/smokey/vxworkstests/task-1.c
> similarity index 96%
> rename from lib/vxworks/testsuite/task-1.c
> rename to testsuite/smokey/vxworkstests/task-1.c
> index 3cf5f38061..a07d643c39 100644
> --- a/lib/vxworks/testsuite/task-1.c
> +++ b/testsuite/smokey/vxworkstests/task-1.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <copperplate/traceobj.h>
> diff --git a/lib/vxworks/testsuite/task-2.c b/testsuite/smokey/vxworkstests/task-2.c
> similarity index 98%
> rename from lib/vxworks/testsuite/task-2.c
> rename to testsuite/smokey/vxworkstests/task-2.c
> index 46d99a266b..7f9f0f0020 100644
> --- a/lib/vxworks/testsuite/task-2.c
> +++ b/testsuite/smokey/vxworkstests/task-2.c
> @@ -1,3 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <unistd.h>

We still have failures with this one, see

https://source.denx.de/Xenomai/xenomai-images/-/jobs/672278

2023-08-09T22:41:46 vxworkstests_task1 OK
2023-08-09T22:41:46 [8] at task-2.c:86
2023-08-09T22:41:46 [1] at task-2.c:33
2023-08-09T22:41:46 [9] at task-2.c:92
2023-08-09T22:41:46 [4] at task-2.c:58
2023-08-09T22:41:46 [10] at task-2.c:98
2023-08-09T22:41:46 [5] at task-2.c:63
2023-08-09T22:41:46 [11] at task-2.c:104
2023-08-09T22:41:46 [2] at task-2.c:38
2023-08-09T22:41:46 [12] at task-2.c:110
2023-08-09T22:41:46 [6] at task-2.c:67
2023-08-09T22:41:46    0\"009.525| BUG in __traceobj_assert_failed(): [foregroundTask] trace assertion failed:
2023-08-09T22:41:46               task-2.c:70 => \"ret == 0\"

Seems like taskSuspend is failing. Please examine - or let me know if we 
should disable this test for now as well.

Jan

-- 
Siemens AG, Technology
Linux Expert Center


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

* Re: [PATCH 01/10] testsuite: Fully integrate alchemytests into smokey
  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:41           ` Aaron Marcher
  0 siblings, 2 replies; 112+ messages in thread
From: Florian Bezdeka @ 2023-08-10  7:07 UTC (permalink / raw)
  To: Aaron Marcher, xenomai; +Cc: richard, jan.kiszka

On Mon, 2023-07-24 at 15:52 +0200, Aaron Marcher wrote:
> This is the very first step to have the alchemy tests embedded
> into our testsuite.
> 
> Build them using Xenomai's build system and hook them up using
> Smokey. Every test binary has it's own respective testcase in the
> testsuite.
> 
> Signed-off-by: Richard Weinberger <richard@nod.at>
> Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
> ---

[snip]

> 
> diff --git a/testsuite/smokey/alchemytests/alchemytests.c b/testsuite/smokey/alchemytests/alchemytests.c
> new file mode 100644
> index 000000000..ee8d1703b
> --- /dev/null
> +++ b/testsuite/smokey/alchemytests/alchemytests.c
> @@ -0,0 +1,56 @@
> +// SPDX-License-Identifier: GPL-2.0
> +#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>

IMHO includes can be cleaned up. Can't spot a usage of error.h,
libgen.h, stdbool.h and unistd.h (at least).

Applies to more locations within this series.

> +
> +#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", XENO_TEST_DIR, t->name);
> +	if (ret == -1)
> +		return -ENOMEM;
> +
> +	ret = system(tst_path);
> +	free(tst_path);
> +
> +	return ret;
> +}
> +
> +TEST(alchemytests)
> +TEST(alchemytests_alarm1)
> +TEST(alchemytests_buffer1)
> +TEST(alchemytests_event1)
> +TEST(alchemytests_heap1)
> +TEST(alchemytests_heap2)
> +TEST(alchemytests_mq1)
> +TEST(alchemytests_mq2)
> +TEST(alchemytests_mq3)
> +TEST(alchemytests_mutex1)
> +TEST(alchemytests_pipe1)
> +TEST(alchemytests_sem1)
> +TEST(alchemytests_sem2)
> +TEST(alchemytests_task1)
> +TEST(alchemytests_task2)
> +TEST(alchemytests_task3)
> +TEST(alchemytests_task4)
> +TEST(alchemytests_task5)
> +TEST(alchemytests_task6)
> +TEST(alchemytests_task7)
> +TEST(alchemytests_task8)
> +TEST(alchemytests_task9)
> +TEST(alchemytests_task10)
> +

The following applies here and on several other places of this series:

Do we really want to have a test plugin for each sub-test? I would have
expected one plugin for each "test class", so basically one for each
sub folder in testsuite/smokey.

Each module could then call all the sub-tests and report back which one
actually failed - if any.

Btw: I think Jan already reported that: I have to disable the
vxworkstests_task2 test as it fails CI runs here.

Best regards,
Florian


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

* Re: [PATCH 01/10] testsuite: Fully integrate alchemytests into smokey
  2023-08-10  7:07         ` Florian Bezdeka
@ 2023-08-11 17:32           ` Jan Kiszka
  2023-08-16 12:43             ` Aaron Marcher
  2023-08-16 12:41           ` Aaron Marcher
  1 sibling, 1 reply; 112+ messages in thread
From: Jan Kiszka @ 2023-08-11 17:32 UTC (permalink / raw)
  To: Florian Bezdeka, Aaron Marcher, xenomai; +Cc: richard

On 10.08.23 09:07, Florian Bezdeka wrote:
> On Mon, 2023-07-24 at 15:52 +0200, Aaron Marcher wrote:
>> This is the very first step to have the alchemy tests embedded
>> into our testsuite.
>>
>> Build them using Xenomai's build system and hook them up using
>> Smokey. Every test binary has it's own respective testcase in the
>> testsuite.
>>
>> Signed-off-by: Richard Weinberger <richard@nod.at>
>> Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
>> ---
> 
> [snip]
> 
>>
>> diff --git a/testsuite/smokey/alchemytests/alchemytests.c b/testsuite/smokey/alchemytests/alchemytests.c
>> new file mode 100644
>> index 000000000..ee8d1703b
>> --- /dev/null
>> +++ b/testsuite/smokey/alchemytests/alchemytests.c
>> @@ -0,0 +1,56 @@
>> +// SPDX-License-Identifier: GPL-2.0
>> +#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>
> 
> IMHO includes can be cleaned up. Can't spot a usage of error.h,
> libgen.h, stdbool.h and unistd.h (at least).
> 
> Applies to more locations within this series.
> 
>> +
>> +#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", XENO_TEST_DIR, t->name);
>> +	if (ret == -1)
>> +		return -ENOMEM;
>> +
>> +	ret = system(tst_path);
>> +	free(tst_path);
>> +
>> +	return ret;
>> +}
>> +
>> +TEST(alchemytests)
>> +TEST(alchemytests_alarm1)
>> +TEST(alchemytests_buffer1)
>> +TEST(alchemytests_event1)
>> +TEST(alchemytests_heap1)
>> +TEST(alchemytests_heap2)
>> +TEST(alchemytests_mq1)
>> +TEST(alchemytests_mq2)
>> +TEST(alchemytests_mq3)
>> +TEST(alchemytests_mutex1)
>> +TEST(alchemytests_pipe1)
>> +TEST(alchemytests_sem1)
>> +TEST(alchemytests_sem2)
>> +TEST(alchemytests_task1)
>> +TEST(alchemytests_task2)
>> +TEST(alchemytests_task3)
>> +TEST(alchemytests_task4)
>> +TEST(alchemytests_task5)
>> +TEST(alchemytests_task6)
>> +TEST(alchemytests_task7)
>> +TEST(alchemytests_task8)
>> +TEST(alchemytests_task9)
>> +TEST(alchemytests_task10)
>> +
> 
> The following applies here and on several other places of this series:
> 
> Do we really want to have a test plugin for each sub-test? I would have
> expected one plugin for each "test class", so basically one for each
> sub folder in testsuite/smokey.
> 
> Each module could then call all the sub-tests and report back which one
> actually failed - if any.
> 

Looking at smokey --list, I agree with this: too many test cases to
browse now. Please rework this on top of 'next'.

> Btw: I think Jan already reported that: I have to disable the
> vxworkstests_task2 test as it fails CI runs here.
> 

Fix is in next.

Jan

-- 
Siemens AG, Technology
Linux Expert Center


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

* Re: [PATCH v6 00/10] Revive alchemy, pSOS and VxWorks tests
  2023-08-09 11:33               ` Jan Kiszka
@ 2023-08-16 12:37                 ` Aaron Marcher
  0 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-08-16 12:37 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: xenomai, richard

Hi Jan,

sorry for the delay, i was on vacation. Thanks a lot for all the fixes
on my patchseries!

I will create follow-up patches for the remaining tasks from the
following mailing list threads soon.

Regards,
Aaron

-- 
sigma star gmbh | Eduard-Bodem-Gasse 6, 6020 Innsbruck, AUT
UID/VAT Nr: ATU 66964118 | FN: 374287y

On Wed, Aug 09, 2023 at 01:33:50PM +0200, Jan Kiszka wrote:
> On 09.08.23 09:36, Jan Kiszka wrote:
> > On 25.07.23 10:29, Aaron Marcher wrote:
> >> This patch series fully integrates the currently abandoned alchemy, pSOS
> >> and VxWorks tests into Xenomai's testsuite.
> >> For each test, a Smokey testcase is hooked up.
> >>
> >> Changes since v5:
> >> - Improved task-2 fix commit message
> >>
> >> Aaron Marcher (7):
> >>   testsuite: Fully integrate alchemytests into smokey
> >>   testsuite: Fully integrate psostests into smokey
> >>   testsuite: Fully integrate vwworkstests into smokey
> >>   alchemytests: Check pipe-1 asprintf ret value
> >>   alchemytests: Fix task-2
> >>   alchemytests: Fix task-5 logic
> >>   testsuite: disable broken tests
> >>
> >> Richard Weinberger (3):
> >>   testsuite: Remove old alchemytests Makefile
> >>   alchemytests: Fix gcc warning in buffer-1
> >>   alchemytests: Fix gcc warning in task-9
> >>
> >>  configure.ac                                  |   7 +-
> >>  lib/alchemy/testsuite/Makefile                |  70 ---------
> >>  lib/psos/testsuite/Makefile                   |  49 ------
> >>  lib/vxworks/testsuite/Makefile                |  43 -----
> >>  testsuite/smokey/Makefile.am                  |  15 +-
> >>  testsuite/smokey/alchemytests/Makefile.am     | 148 ++++++++++++++++++
> >>  .../smokey/alchemytests}/alarm-1.c            |   1 +
> >>  testsuite/smokey/alchemytests/alchemytests.c  |  56 +++++++
> >>  .../smokey/alchemytests/alchemytests_driver.c |  33 ++++
> >>  .../smokey/alchemytests}/buffer-1.c           |   3 +-
> >>  .../smokey/alchemytests}/event-1.c            |   1 +
> >>  .../smokey/alchemytests}/heap-1.c             |   1 +
> >>  .../smokey/alchemytests}/heap-2.c             |   1 +
> >>  .../smokey/alchemytests}/mq-1.c               |   1 +
> >>  .../smokey/alchemytests}/mq-2.c               |   1 +
> >>  .../smokey/alchemytests}/mq-3.c               |   1 +
> >>  .../smokey/alchemytests}/mutex-1.c            |   1 +
> >>  .../smokey/alchemytests}/pipe-1.c             |   7 +-
> >>  .../smokey/alchemytests}/sem-1.c              |   1 +
> >>  .../smokey/alchemytests}/sem-2.c              |   1 +
> >>  .../smokey/alchemytests}/task-1.c             |   1 +
> >>  .../smokey/alchemytests}/task-10.c            |   1 +
> >>  .../smokey/alchemytests}/task-2.c             |   5 +-
> >>  .../smokey/alchemytests}/task-3.c             |   1 +
> >>  .../smokey/alchemytests}/task-4.c             |   1 +
> >>  .../smokey/alchemytests}/task-5.c             |  11 +-
> >>  .../smokey/alchemytests}/task-6.c             |   1 +
> >>  .../smokey/alchemytests}/task-7.c             |   1 +
> >>  .../smokey/alchemytests}/task-8.c             |   1 +
> >>  .../smokey/alchemytests}/task-9.c             |   3 +-
> >>  testsuite/smokey/psostests/Makefile.am        | 148 ++++++++++++++++++
> >>  .../smokey/psostests}/mq-1.c                  |   1 +
> >>  .../smokey/psostests}/mq-2.c                  |   1 +
> >>  .../smokey/psostests}/mq-3.c                  |   1 +
> >>  testsuite/smokey/psostests/psostests.c        |  69 ++++++++
> >>  testsuite/smokey/psostests/psostests_driver.c |  34 ++++
> >>  .../smokey/psostests}/pt-1.c                  |   1 +
> >>  .../smokey/psostests}/rn-1.c                  |   1 +
> >>  .../smokey/psostests}/sem-1.c                 |   1 +
> >>  .../smokey/psostests}/sem-2.c                 |   1 +
> >>  .../smokey/psostests}/task-1.c                |   1 +
> >>  .../smokey/psostests}/task-2.c                |   1 +
> >>  .../smokey/psostests}/task-3.c                |   1 +
> >>  .../smokey/psostests}/task-4.c                |   1 +
> >>  .../smokey/psostests}/task-5.c                |   1 +
> >>  .../smokey/psostests}/task-6.c                |   1 +
> >>  .../smokey/psostests}/task-7.c                |   1 +
> >>  .../smokey/psostests}/task-8.c                |   1 +
> >>  .../smokey/psostests}/task-9.c                |   1 +
> >>  .../smokey/psostests}/tm-1.c                  |   1 +
> >>  .../smokey/psostests}/tm-2.c                  |   1 +
> >>  .../smokey/psostests}/tm-3.c                  |   1 +
> >>  .../smokey/psostests}/tm-4.c                  |   1 +
> >>  .../smokey/psostests}/tm-5.c                  |   1 +
> >>  .../smokey/psostests}/tm-6.c                  |   1 +
> >>  .../smokey/psostests}/tm-7.c                  |   1 +
> >>  testsuite/smokey/vxworkstests/Makefile.am     |  94 +++++++++++
> >>  .../smokey/vxworkstests}/lst-1.c              |   1 +
> >>  .../smokey/vxworkstests}/msgQ-1.c             |   1 +
> >>  .../smokey/vxworkstests}/msgQ-2.c             |   1 +
> >>  .../smokey/vxworkstests}/msgQ-3.c             |   1 +
> >>  .../smokey/vxworkstests}/rng-1.c              |   1 +
> >>  .../smokey/vxworkstests}/sem-1.c              |   1 +
> >>  .../smokey/vxworkstests}/sem-2.c              |   1 +
> >>  .../smokey/vxworkstests}/sem-3.c              |   1 +
> >>  .../smokey/vxworkstests}/sem-4.c              |   1 +
> >>  .../smokey/vxworkstests}/task-1.c             |   1 +
> >>  .../smokey/vxworkstests}/task-2.c             |   1 +
> >>  testsuite/smokey/vxworkstests/vxworkstests.c  |  46 ++++++
> >>  .../smokey/vxworkstests/vxworkstests_driver.c |  33 ++++
> >>  .../smokey/vxworkstests}/wd-1.c               |   1 +
> >>  71 files changed, 749 insertions(+), 177 deletions(-)
> >>  delete mode 100644 lib/alchemy/testsuite/Makefile
> >>  delete mode 100644 lib/psos/testsuite/Makefile
> >>  delete mode 100644 lib/vxworks/testsuite/Makefile
> >>  create mode 100644 testsuite/smokey/alchemytests/Makefile.am
> >>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/alarm-1.c (97%)
> >>  create mode 100644 testsuite/smokey/alchemytests/alchemytests.c
> >>  create mode 100644 testsuite/smokey/alchemytests/alchemytests_driver.c
> >>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/buffer-1.c (97%)
> >>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/event-1.c (98%)
> >>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/heap-1.c (98%)
> >>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/heap-2.c (98%)
> >>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-1.c (98%)
> >>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-2.c (98%)
> >>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mq-3.c (98%)
> >>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/mutex-1.c (98%)
> >>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/pipe-1.c (96%)
> >>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/sem-1.c (98%)
> >>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/sem-2.c (97%)
> >>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-1.c (94%)
> >>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-10.c (97%)
> >>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-2.c (95%)
> >>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-3.c (97%)
> >>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-4.c (98%)
> >>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-5.c (98%)
> >>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-6.c (97%)
> >>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-7.c (98%)
> >>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-8.c (97%)
> >>  rename {lib/alchemy/testsuite => testsuite/smokey/alchemytests}/task-9.c (94%)
> >>  create mode 100644 testsuite/smokey/psostests/Makefile.am
> >>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/mq-1.c (97%)
> >>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/mq-2.c (98%)
> >>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/mq-3.c (98%)
> >>  create mode 100644 testsuite/smokey/psostests/psostests.c
> >>  create mode 100644 testsuite/smokey/psostests/psostests_driver.c
> >>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/pt-1.c (96%)
> >>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/rn-1.c (97%)
> >>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/sem-1.c (98%)
> >>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/sem-2.c (97%)
> >>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-1.c (95%)
> >>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-2.c (98%)
> >>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-3.c (96%)
> >>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-4.c (97%)
> >>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-5.c (98%)
> >>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-6.c (98%)
> >>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-7.c (97%)
> >>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-8.c (98%)
> >>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/task-9.c (98%)
> >>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-1.c (95%)
> >>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-2.c (97%)
> >>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-3.c (97%)
> >>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-4.c (97%)
> >>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-5.c (97%)
> >>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-6.c (95%)
> >>  rename {lib/psos/testsuite => testsuite/smokey/psostests}/tm-7.c (95%)
> >>  create mode 100644 testsuite/smokey/vxworkstests/Makefile.am
> >>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/lst-1.c (99%)
> >>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-1.c (98%)
> >>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-2.c (98%)
> >>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/msgQ-3.c (98%)
> >>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/rng-1.c (99%)
> >>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-1.c (98%)
> >>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-2.c (98%)
> >>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-3.c (97%)
> >>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/sem-4.c (98%)
> >>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/task-1.c (96%)
> >>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/task-2.c (98%)
> >>  create mode 100644 testsuite/smokey/vxworkstests/vxworkstests.c
> >>  create mode 100644 testsuite/smokey/vxworkstests/vxworkstests_driver.c
> >>  rename {lib/vxworks/testsuite => testsuite/smokey/vxworkstests}/wd-1.c (97%)
> >>
> > 
> > All applied, just with some whitespace massaging and a reordering of
> > when the build system is actually updated. See next branch for the result.
> > 
> 
> There were also bugs in the makefiles, breaking vxworks and psos build
> on debian bullseye toolchain at least. Updated patches submitted.
> 
> Jan
> 
> -- 
> Siemens AG, Technology
> Linux Expert Center
> 

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

* Re: [PATCH 01/10] testsuite: Fully integrate alchemytests into smokey
  2023-08-10  7:07         ` Florian Bezdeka
  2023-08-11 17:32           ` Jan Kiszka
@ 2023-08-16 12:41           ` Aaron Marcher
  2023-08-16 14:19             ` Jan Kiszka
  1 sibling, 1 reply; 112+ messages in thread
From: Aaron Marcher @ 2023-08-16 12:41 UTC (permalink / raw)
  To: Florian Bezdeka; +Cc: xenomai, richard, jan.kiszka

Hi,

> IMHO includes can be cleaned up. Can't spot a usage of error.h,
> libgen.h, stdbool.h and unistd.h (at least).
> 
> Applies to more locations within this series.

Oh, missed that one. Thanks for the note, will fix.

> The following applies here and on several other places of this series:
> 
> Do we really want to have a test plugin for each sub-test? I would have
> expected one plugin for each "test class", so basically one for each
> sub folder in testsuite/smokey.
> 
> Each module could then call all the sub-tests and report back which one
> actually failed - if any.

Hm, I will have a look if that is easily changeable, as I had some
troubles with linking the Smokey plugins together initially when trying to
create a plugin for each "class" (which was planned originally).

> Btw: I think Jan already reported that: I have to disable the
> vxworkstests_task2 test as it fails CI runs here.

I think Jan posted a fix already afterwards?

Best regards,
Aaron

-- 
sigma star gmbh | Eduard-Bodem-Gasse 6, 6020 Innsbruck, AUT
UID/VAT Nr: ATU 66964118 | FN: 374287y

On Thu, Aug 10, 2023 at 09:07:09AM +0200, Florian Bezdeka wrote:
> On Mon, 2023-07-24 at 15:52 +0200, Aaron Marcher wrote:
> > This is the very first step to have the alchemy tests embedded
> > into our testsuite.
> > 
> > Build them using Xenomai's build system and hook them up using
> > Smokey. Every test binary has it's own respective testcase in the
> > testsuite.
> > 
> > Signed-off-by: Richard Weinberger <richard@nod.at>
> > Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
> > ---
> 
> [snip]
> 
> > 
> > diff --git a/testsuite/smokey/alchemytests/alchemytests.c b/testsuite/smokey/alchemytests/alchemytests.c
> > new file mode 100644
> > index 000000000..ee8d1703b
> > --- /dev/null
> > +++ b/testsuite/smokey/alchemytests/alchemytests.c
> > @@ -0,0 +1,56 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +#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>
> 
> IMHO includes can be cleaned up. Can't spot a usage of error.h,
> libgen.h, stdbool.h and unistd.h (at least).
> 
> Applies to more locations within this series.
> 
> > +
> > +#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", XENO_TEST_DIR, t->name);
> > +	if (ret == -1)
> > +		return -ENOMEM;
> > +
> > +	ret = system(tst_path);
> > +	free(tst_path);
> > +
> > +	return ret;
> > +}
> > +
> > +TEST(alchemytests)
> > +TEST(alchemytests_alarm1)
> > +TEST(alchemytests_buffer1)
> > +TEST(alchemytests_event1)
> > +TEST(alchemytests_heap1)
> > +TEST(alchemytests_heap2)
> > +TEST(alchemytests_mq1)
> > +TEST(alchemytests_mq2)
> > +TEST(alchemytests_mq3)
> > +TEST(alchemytests_mutex1)
> > +TEST(alchemytests_pipe1)
> > +TEST(alchemytests_sem1)
> > +TEST(alchemytests_sem2)
> > +TEST(alchemytests_task1)
> > +TEST(alchemytests_task2)
> > +TEST(alchemytests_task3)
> > +TEST(alchemytests_task4)
> > +TEST(alchemytests_task5)
> > +TEST(alchemytests_task6)
> > +TEST(alchemytests_task7)
> > +TEST(alchemytests_task8)
> > +TEST(alchemytests_task9)
> > +TEST(alchemytests_task10)
> > +
> 
> The following applies here and on several other places of this series:
> 
> Do we really want to have a test plugin for each sub-test? I would have
> expected one plugin for each "test class", so basically one for each
> sub folder in testsuite/smokey.
> 
> Each module could then call all the sub-tests and report back which one
> actually failed - if any.
> 
> Btw: I think Jan already reported that: I have to disable the
> vxworkstests_task2 test as it fails CI runs here.
> 
> Best regards,
> Florian
> 

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

* Re: [PATCH 01/10] testsuite: Fully integrate alchemytests into smokey
  2023-08-11 17:32           ` Jan Kiszka
@ 2023-08-16 12:43             ` Aaron Marcher
  2023-09-14  7:41               ` Jan Kiszka
  0 siblings, 1 reply; 112+ messages in thread
From: Aaron Marcher @ 2023-08-16 12:43 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Florian Bezdeka, xenomai, richard

Hi,

> Looking at smokey --list, I agree with this: too many test cases to
> browse now. Please rework this on top of 'next'.

As already described in the previous mail, I will have a look what can
be improved. Generally I totally agree that the number of tests is a
little overwhelming atm.

Best regards,
Aaron

-- 
sigma star gmbh | Eduard-Bodem-Gasse 6, 6020 Innsbruck, AUT
UID/VAT Nr: ATU 66964118 | FN: 374287y

On Fri, Aug 11, 2023 at 07:32:56PM +0200, Jan Kiszka wrote:
> On 10.08.23 09:07, Florian Bezdeka wrote:
> > On Mon, 2023-07-24 at 15:52 +0200, Aaron Marcher wrote:
> >> This is the very first step to have the alchemy tests embedded
> >> into our testsuite.
> >>
> >> Build them using Xenomai's build system and hook them up using
> >> Smokey. Every test binary has it's own respective testcase in the
> >> testsuite.
> >>
> >> Signed-off-by: Richard Weinberger <richard@nod.at>
> >> Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
> >> ---
> > 
> > [snip]
> > 
> >>
> >> diff --git a/testsuite/smokey/alchemytests/alchemytests.c b/testsuite/smokey/alchemytests/alchemytests.c
> >> new file mode 100644
> >> index 000000000..ee8d1703b
> >> --- /dev/null
> >> +++ b/testsuite/smokey/alchemytests/alchemytests.c
> >> @@ -0,0 +1,56 @@
> >> +// SPDX-License-Identifier: GPL-2.0
> >> +#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>
> > 
> > IMHO includes can be cleaned up. Can't spot a usage of error.h,
> > libgen.h, stdbool.h and unistd.h (at least).
> > 
> > Applies to more locations within this series.
> > 
> >> +
> >> +#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", XENO_TEST_DIR, t->name);
> >> +	if (ret == -1)
> >> +		return -ENOMEM;
> >> +
> >> +	ret = system(tst_path);
> >> +	free(tst_path);
> >> +
> >> +	return ret;
> >> +}
> >> +
> >> +TEST(alchemytests)
> >> +TEST(alchemytests_alarm1)
> >> +TEST(alchemytests_buffer1)
> >> +TEST(alchemytests_event1)
> >> +TEST(alchemytests_heap1)
> >> +TEST(alchemytests_heap2)
> >> +TEST(alchemytests_mq1)
> >> +TEST(alchemytests_mq2)
> >> +TEST(alchemytests_mq3)
> >> +TEST(alchemytests_mutex1)
> >> +TEST(alchemytests_pipe1)
> >> +TEST(alchemytests_sem1)
> >> +TEST(alchemytests_sem2)
> >> +TEST(alchemytests_task1)
> >> +TEST(alchemytests_task2)
> >> +TEST(alchemytests_task3)
> >> +TEST(alchemytests_task4)
> >> +TEST(alchemytests_task5)
> >> +TEST(alchemytests_task6)
> >> +TEST(alchemytests_task7)
> >> +TEST(alchemytests_task8)
> >> +TEST(alchemytests_task9)
> >> +TEST(alchemytests_task10)
> >> +
> > 
> > The following applies here and on several other places of this series:
> > 
> > Do we really want to have a test plugin for each sub-test? I would have
> > expected one plugin for each "test class", so basically one for each
> > sub folder in testsuite/smokey.
> > 
> > Each module could then call all the sub-tests and report back which one
> > actually failed - if any.
> > 
> 
> Looking at smokey --list, I agree with this: too many test cases to
> browse now. Please rework this on top of 'next'.
> 
> > Btw: I think Jan already reported that: I have to disable the
> > vxworkstests_task2 test as it fails CI runs here.
> > 
> 
> Fix is in next.
> 
> Jan
> 
> -- 
> Siemens AG, Technology
> Linux Expert Center
> 

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

* Re: [PATCH 01/10] testsuite: Fully integrate alchemytests into smokey
  2023-08-16 12:41           ` Aaron Marcher
@ 2023-08-16 14:19             ` Jan Kiszka
  0 siblings, 0 replies; 112+ messages in thread
From: Jan Kiszka @ 2023-08-16 14:19 UTC (permalink / raw)
  To: Aaron Marcher, Florian Bezdeka, xenomai, richard

On 16.08.23 14:41, Aaron Marcher wrote:
> Hi,
> 
>> IMHO includes can be cleaned up. Can't spot a usage of error.h,
>> libgen.h, stdbool.h and unistd.h (at least).
>>
>> Applies to more locations within this series.
> 
> Oh, missed that one. Thanks for the note, will fix.
> 
>> The following applies here and on several other places of this series:
>>
>> Do we really want to have a test plugin for each sub-test? I would have
>> expected one plugin for each "test class", so basically one for each
>> sub folder in testsuite/smokey.
>>
>> Each module could then call all the sub-tests and report back which one
>> actually failed - if any.
> 
> Hm, I will have a look if that is easily changeable, as I had some
> troubles with linking the Smokey plugins together initially when trying to
> create a plugin for each "class" (which was planned originally).
> 
>> Btw: I think Jan already reported that: I have to disable the
>> vxworkstests_task2 test as it fails CI runs here.
> 
> I think Jan posted a fix already afterwards?

Yes, task2 should be fine now. I had some other tests failing in some
qemu build these days, see
https://source.denx.de/Xenomai/xenomai-images/-/jobs/675985.

Jan

-- 
Siemens AG, Technology
Linux Expert Center


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

* Re: [PATCH 01/10] testsuite: Fully integrate alchemytests into smokey
  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 14:00                 ` [PATCH 01/10] testsuite: Fully integrate alchemytests into smokey Aaron Marcher
  0 siblings, 2 replies; 112+ messages in thread
From: Jan Kiszka @ 2023-09-14  7:41 UTC (permalink / raw)
  To: Aaron Marcher, Florian Bezdeka, xenomai, richard

Hi Aaron,

On 16.08.23 18:13, Aaron Marcher wrote:
> Hi,
> 
>> Looking at smokey --list, I agree with this: too many test cases to
>> browse now. Please rework this on top of 'next'.
> 
> As already described in the previous mail, I will have a look what can
> be improved. Generally I totally agree that the number of tests is a
> little overwhelming atm.
> 

Any news on this?

Jan

-- 
Siemens AG, Technology
Linux Expert Center


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

* [PATCH 0/5] Improvements for smokey skintests
  2023-09-14  7:41               ` Jan Kiszka
@ 2023-09-20 13:52                 ` Aaron Marcher
  2023-09-20 13:52                   ` [PATCH 1/5] lib: Add smokey_run_extprog as helper for testsuite Aaron Marcher
                                     ` (5 more replies)
  2023-09-20 14:00                 ` [PATCH 01/10] testsuite: Fully integrate alchemytests into smokey Aaron Marcher
  1 sibling, 6 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-09-20 13:52 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

Merges all skin-related testsuite parts into common top-level smokey testcases,
which in turn spawn all the related skin tests - as discussed before.

Additionally cleans up some includes and more.

Aaron Marcher (5):
  lib: Add smokey_run_extprog as helper for testsuite
  testsuite: Merge alchemytests in single smokey case
  testsuite: Merge psostests in a single smokey case
  testsuite: Merge vxworkstests in a single smokey case
  testsuite: Drop skin test "drivers"

 include/smokey/smokey.h                       |   2 +
 lib/smokey/helpers.c                          |  15 +++
 testsuite/smokey/alchemytests/Makefile.am     |  12 --
 testsuite/smokey/alchemytests/alchemytests.c  |  85 +++++++-------
 .../smokey/alchemytests/alchemytests_driver.c |  33 ------
 testsuite/smokey/psostests/Makefile.am        |  10 --
 testsuite/smokey/psostests/psostests.c        | 111 +++++++++---------
 testsuite/smokey/psostests/psostests_driver.c |  33 ------
 testsuite/smokey/vxworkstests/Makefile.am     |  10 --
 testsuite/smokey/vxworkstests/vxworkstests.c  |  66 ++++++-----
 .../smokey/vxworkstests/vxworkstests_driver.c |  33 ------
 11 files changed, 150 insertions(+), 260 deletions(-)
 delete mode 100644 testsuite/smokey/alchemytests/alchemytests_driver.c
 delete mode 100644 testsuite/smokey/psostests/psostests_driver.c
 delete mode 100644 testsuite/smokey/vxworkstests/vxworkstests_driver.c

-- 
2.35.3


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

* [PATCH 1/5] lib: Add smokey_run_extprog as helper for testsuite
  2023-09-20 13:52                 ` [PATCH 0/5] Improvements for smokey skintests Aaron Marcher
@ 2023-09-20 13:52                   ` Aaron Marcher
  2023-09-22 15:49                     ` Jan Kiszka
  2023-09-20 13:52                   ` [PATCH 2/5] testsuite: Merge alchemytests in single smokey case Aaron Marcher
                                     ` (4 subsequent siblings)
  5 siblings, 1 reply; 112+ messages in thread
From: Aaron Marcher @ 2023-09-20 13:52 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 include/smokey/smokey.h |  2 ++
 lib/smokey/helpers.c    | 15 +++++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/include/smokey/smokey.h b/include/smokey/smokey.h
index 0ac1e8df4..4d0fe011f 100644
--- a/include/smokey/smokey.h
+++ b/include/smokey/smokey.h
@@ -259,6 +259,8 @@ int smokey_modprobe(const char *name, bool silent);
 
 int smokey_rmmod(const char *name);
 
+int smokey_run_extprog(const char *dir, const char *name, int argc, char *const argv[]);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/smokey/helpers.c b/lib/smokey/helpers.c
index 0fc450ff6..dfd63b409 100644
--- a/lib/smokey/helpers.c
+++ b/lib/smokey/helpers.c
@@ -410,3 +410,18 @@ int smokey_rmmod(const char *name)
 
 	return err;
 }
+
+int smokey_run_extprog(const char *dir, const char *name, int argc, char *const argv[])
+{
+	int ret;
+	char *tst_path;
+
+	ret = asprintf(&tst_path, "%s/%s --cpu-affinity=0", dir, name);
+	if (ret == -1)
+		return -ENOMEM;
+
+	ret = system(tst_path);
+	free(tst_path);
+
+	return ret;
+}
-- 
2.35.3


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

* [PATCH 2/5] testsuite: Merge alchemytests in single smokey case
  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-20 13:52                   ` Aaron Marcher
  2023-09-20 13:52                   ` [PATCH 3/5] testsuite: Merge psostests in a " Aaron Marcher
                                     ` (3 subsequent siblings)
  5 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-09-20 13:52 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 testsuite/smokey/alchemytests/alchemytests.c | 85 ++++++++++----------
 1 file changed, 43 insertions(+), 42 deletions(-)

diff --git a/testsuite/smokey/alchemytests/alchemytests.c b/testsuite/smokey/alchemytests/alchemytests.c
index 19989cc09..5753af423 100644
--- a/testsuite/smokey/alchemytests/alchemytests.c
+++ b/testsuite/smokey/alchemytests/alchemytests.c
@@ -1,55 +1,56 @@
 // SPDX-License-Identifier: GPL-2.0
 #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>
-
-#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);				   \
-	}
+#include <smokey/smokey.h>
 
-static int __run_extprog(struct smokey_test *t, int argc, char *const argv[])
+static int run_alchemytests(struct smokey_test *t, int argc, char *const argv[])
 {
-	int ret;
-	char *tst_path;
+	int ret = 0;
+
+	char *tests[] = {
+		"alchemytests_alarm1",
+		"alchemytests_buffer1",
+		"alchemytests_event1",
+		"alchemytests_heap1",
+		"alchemytests_heap2",
+		"alchemytests_mq1",
+		"alchemytests_mq2",
+		"alchemytests_mq3",
+		"alchemytests_mutex1",
+		"alchemytests_pipe1",
+		"alchemytests_sem1",
+		"alchemytests_sem2",
+		"alchemytests_task1",
+		"alchemytests_task2",
+		"alchemytests_task3",
+		"alchemytests_task4",
+		"alchemytests_task5",
+		"alchemytests_task6",
+		"alchemytests_task7",
+		"alchemytests_task8",
+		"alchemytests_task9",
+		"alchemytests_task10"
+	};
 
-	ret = asprintf(&tst_path, "%s/%s --cpu-affinity=0", XENO_TEST_DIR, t->name);
-	if (ret == -1)
-		return -ENOMEM;
+	for (size_t t = 0; t < sizeof(tests) / sizeof(tests[0]); t++)
+	{
+		int fails = 0;
 
-	ret = system(tst_path);
-	free(tst_path);
+		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], argc, argv);
+		if (ret) {
+			fails++;
+			if (smokey_keep_going)
+				continue;
+			if (smokey_verbose_mode)
+				error(1, -ret, "test %s failed", tests[t]);
+			return 1;
+		}
+		smokey_note("%s OK", tests[t]);
+	}
 
 	return ret;
 }
+smokey_test_plugin(alchemytests, SMOKEY_NOARGS, "Run external alchemytests");
 
-TEST(alchemytests)
-TEST(alchemytests_alarm1)
-TEST(alchemytests_buffer1)
-TEST(alchemytests_event1)
-TEST(alchemytests_heap1)
-TEST(alchemytests_heap2)
-TEST(alchemytests_mq1)
-TEST(alchemytests_mq2)
-TEST(alchemytests_mq3)
-TEST(alchemytests_mutex1)
-TEST(alchemytests_pipe1)
-TEST(alchemytests_sem1)
-TEST(alchemytests_sem2)
-TEST(alchemytests_task1)
-TEST(alchemytests_task2)
-TEST(alchemytests_task3)
-TEST(alchemytests_task4)
-TEST(alchemytests_task5)
-TEST(alchemytests_task6)
-TEST(alchemytests_task7)
-TEST(alchemytests_task8)
-TEST(alchemytests_task9)
-TEST(alchemytests_task10)
-- 
2.35.3


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

* [PATCH 3/5] testsuite: Merge psostests in a single smokey case
  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-20 13:52                   ` [PATCH 2/5] testsuite: Merge alchemytests in single smokey case Aaron Marcher
@ 2023-09-20 13:52                   ` Aaron Marcher
  2023-09-20 13:52                   ` [PATCH 4/5] testsuite: Merge vxworkstests " Aaron Marcher
                                     ` (2 subsequent siblings)
  5 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-09-20 13:52 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

Cleans up includes

Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 testsuite/smokey/psostests/psostests.c | 111 +++++++++++++------------
 1 file changed, 56 insertions(+), 55 deletions(-)

diff --git a/testsuite/smokey/psostests/psostests.c b/testsuite/smokey/psostests/psostests.c
index 13397894d..a54e6ea31 100644
--- a/testsuite/smokey/psostests/psostests.c
+++ b/testsuite/smokey/psostests/psostests.c
@@ -1,68 +1,69 @@
 // SPDX-License-Identifier: GPL-2.0
 #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>
-
-#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);				   \
-	}
+#include <smokey/smokey.h>
 
-static int __run_extprog(struct smokey_test *t, int argc, char *const argv[])
+static int run_psostests(struct smokey_test *t, int argc, char *const argv[])
 {
-	int ret;
-	char *tst_path;
+	int ret = 0;
+
+	char *tests[] = {
+		"psostests_mq1",
+		"psostests_mq2",
+		"psostests_mq3",
+		"psostests_pt1",
+		// 0"000.679| BUG in __traceobj_assert_failed(): [rn1] trace assertion failed:
+		// testsuite/psostests/rn-1.c:46
+		// => "ret == 0"
+		//"psostests_rn1"
+		"psostests_sem1",
+		"psostests_sem2",
+		"psostests_task1",
+		// 0"014.452| BUG in __traceobj_assert_failed(): [FGND] trace assertion failed:
+		//		../../../../../../../../../workspace/sources/xenomai/testsuite/smokey/psostests/task-2.c:56 => "ret == 0"
+		//"psostests_task2",
+		"psostests_task3",
+		"psostests_task4",
+		"psostests_task5",
+		// 0"011.370| BUG in __traceobj_assert_failed(): [FGND] trace assertion failed:
+		//		testsuite/psostests/task-6.c:62
+		// => "ret == 0 && oldprio == myprio"
+		//"psostests_task6",
+		"psostests_task7",
+		// Runs forever (100% CPU)
+		//"psostests_task8"
+		// 0"002.198| WARNING: [main] lack of resources for core thread, EBUSY
+		// 0"003.421| BUG in __traceobj_assert_failed(): [root] trace assertion failed:
+		//	   ../../../../../../../../../workspace/sources/xenomai/testsuite/smokey/psostests/task-9.c:29 => "ret == 0"
+		//"psostests_task9",
+		"psostests_tm1",
+		"psostests_tm2",
+		"psostests_tm3",
+		"psostests_tm4",
+		"psostests_tm5",
+		"psostests_tm6",
+		"psostests_tm7"
+	};
 
-	ret = asprintf(&tst_path, "%s/%s --cpu-affinity=0", XENO_TEST_DIR, t->name);
-	if (ret == -1)
-		return -ENOMEM;
+	for (size_t t = 0; t < sizeof(tests) / sizeof(tests[0]); t++)
+	{
+		int fails = 0;
 
-	ret = system(tst_path);
-	free(tst_path);
+		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], argc, argv);
+		if (ret) {
+			fails++;
+			if (smokey_keep_going)
+				continue;
+			if (smokey_verbose_mode)
+				error(1, -ret, "test %s failed", tests[t]);
+			return 1;
+		}
+		smokey_note("%s OK", tests[t]);
+	}
 
 	return ret;
 }
+smokey_test_plugin(psostests, SMOKEY_NOARGS, "Run external psostests");
 
-TEST(psostests)
-TEST(psostests_mq1)
-TEST(psostests_mq2)
-TEST(psostests_mq3)
-TEST(psostests_pt1)
-// 0"000.679| BUG in __traceobj_assert_failed(): [rn1] trace assertion failed:
-//            testsuite/psostests/rn-1.c:46
-// => "ret == 0"
-//TEST(psostests_rn1)
-TEST(psostests_sem1)
-TEST(psostests_sem2)
-TEST(psostests_task1)
-// 0"014.452| BUG in __traceobj_assert_failed(): [FGND] trace assertion failed:
-//            ../../../../../../../../../workspace/sources/xenomai/testsuite/smokey/psostests/task-2.c:56 => "ret == 0"
-//TEST(psostests_task2)
-TEST(psostests_task3)
-TEST(psostests_task4)
-TEST(psostests_task5)
-// 0"011.370| BUG in __traceobj_assert_failed(): [FGND] trace assertion failed:
-//            testsuite/psostests/task-6.c:62
-// => "ret == 0 && oldprio == myprio"
-// TEST(psostests_task6)
-TEST(psostests_task7)
-// runs forever (100% CPU)
-//TEST(psostests_task8)
-// 0"002.198| WARNING: [main] lack of resources for core thread, EBUSY
-// 0"003.421| BUG in __traceobj_assert_failed(): [root] trace assertion failed:
-//           ../../../../../../../../../workspace/sources/xenomai/testsuite/smokey/psostests/task-9.c:29 => "ret == 0"
-//TEST(psostests_task9)
-TEST(psostests_tm1)
-TEST(psostests_tm2)
-TEST(psostests_tm3)
-TEST(psostests_tm4)
-TEST(psostests_tm5)
-TEST(psostests_tm6)
-TEST(psostests_tm7)
-- 
2.35.3


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

* [PATCH 4/5] testsuite: Merge vxworkstests in a single smokey case
  2023-09-20 13:52                 ` [PATCH 0/5] Improvements for smokey skintests Aaron Marcher
                                     ` (2 preceding siblings ...)
  2023-09-20 13:52                   ` [PATCH 3/5] testsuite: Merge psostests in a " Aaron Marcher
@ 2023-09-20 13:52                   ` 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
  5 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-09-20 13:52 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

Cleans up includes

Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 testsuite/smokey/vxworkstests/vxworkstests.c | 66 ++++++++++----------
 1 file changed, 34 insertions(+), 32 deletions(-)

diff --git a/testsuite/smokey/vxworkstests/vxworkstests.c b/testsuite/smokey/vxworkstests/vxworkstests.c
index 183df3509..d3ac891ae 100644
--- a/testsuite/smokey/vxworkstests/vxworkstests.c
+++ b/testsuite/smokey/vxworkstests/vxworkstests.c
@@ -1,45 +1,47 @@
 // SPDX-License-Identifier: GPL-2.0
 #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>
-
-#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);				   \
-	}
+#include <smokey/smokey.h>
 
-static int __run_extprog(struct smokey_test *t, int argc, char *const argv[])
+static int run_vxworkstests(struct smokey_test *t, int argc, char *const argv[])
 {
-	int ret;
-	char *tst_path;
+	int ret = 0;
+
+	char *tests[] = {
+		"vxworkstests",
+		"vxworkstests_lst1",
+		"vxworkstests_msgQ1",
+		"vxworkstests_msgQ2",
+		"vxworkstests_msgQ3",
+		"vxworkstests_rng1",
+		"vxworkstests_sem1",
+		"vxworkstests_sem2",
+		"vxworkstests_sem3",
+		"vxworkstests_sem4",
+		"vxworkstests_wd1",
+		"vxworkstests_task1",
+		"vxworkstests_task2"
+	};
 
-	ret = asprintf(&tst_path, "%s/%s --cpu-affinity=0", XENO_TEST_DIR, t->name);
-	if (ret == -1)
-		return -ENOMEM;
+	for (size_t t = 0; t < sizeof(tests) / sizeof(tests[0]); t++)
+	{
+		int fails = 0;
 
-	ret = system(tst_path);
-	free(tst_path);
+		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], argc, argv);
+		if (ret) {
+			fails++;
+			if (smokey_keep_going)
+				continue;
+			if (smokey_verbose_mode)
+				error(1, -ret, "test %s failed", tests[t]);
+			return 1;
+		}
+		smokey_note("%s OK", tests[t]);
+	}
 
 	return ret;
 }
+smokey_test_plugin(vxworkstests, SMOKEY_NOARGS, "Run external vxworkstests");
 
-TEST(vxworkstests)
-TEST(vxworkstests_lst1)
-TEST(vxworkstests_msgQ1)
-TEST(vxworkstests_msgQ2)
-TEST(vxworkstests_msgQ3)
-TEST(vxworkstests_rng1)
-TEST(vxworkstests_sem1)
-TEST(vxworkstests_sem2)
-TEST(vxworkstests_sem3)
-TEST(vxworkstests_sem4)
-TEST(vxworkstests_wd1)
-TEST(vxworkstests_task1)
-TEST(vxworkstests_task2)
-- 
2.35.3


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

* [PATCH 5/5] testsuite: Drop skin test "drivers"
  2023-09-20 13:52                 ` [PATCH 0/5] Improvements for smokey skintests Aaron Marcher
                                     ` (3 preceding siblings ...)
  2023-09-20 13:52                   ` [PATCH 4/5] testsuite: Merge vxworkstests " Aaron Marcher
@ 2023-09-20 13:52                   ` Aaron Marcher
  2023-09-22 15:52                   ` [PATCH 0/5] Improvements for smokey skintests Jan Kiszka
  5 siblings, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-09-20 13:52 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

Each skin-testsuite now has its own respective smokey test case, which runs
all underlying tests and returns appropriately.

Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 testsuite/smokey/alchemytests/Makefile.am     | 12 -------
 .../smokey/alchemytests/alchemytests_driver.c | 33 -------------------
 testsuite/smokey/psostests/Makefile.am        | 10 ------
 testsuite/smokey/psostests/psostests_driver.c | 33 -------------------
 testsuite/smokey/vxworkstests/Makefile.am     | 10 ------
 .../smokey/vxworkstests/vxworkstests_driver.c | 33 -------------------
 6 files changed, 131 deletions(-)
 delete mode 100644 testsuite/smokey/alchemytests/alchemytests_driver.c
 delete mode 100644 testsuite/smokey/psostests/psostests_driver.c
 delete mode 100644 testsuite/smokey/vxworkstests/vxworkstests_driver.c

diff --git a/testsuite/smokey/alchemytests/Makefile.am b/testsuite/smokey/alchemytests/Makefile.am
index 68255b111..3525dfa09 100644
--- a/testsuite/smokey/alchemytests/Makefile.am
+++ b/testsuite/smokey/alchemytests/Makefile.am
@@ -11,7 +11,6 @@ libalchemytests_a_CPPFLAGS =	\
 CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
 
 test_PROGRAMS =				\
-		alchemytests		\
 		alchemytests_alarm1	\
 		alchemytests_buffer1	\
 		alchemytests_event1	\
@@ -46,17 +45,6 @@ alchemyldadd = 							\
 	@XENO_USER_LDADD@					\
 	-lpthread -lrt -lm
 
-alchemytests_SOURCES = alchemytests_driver.c
-alchemytests_CPPFLAGS =				\
-	$(XENO_USER_CFLAGS)			\
-	-I$(top_srcdir)/include
-alchemytests_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@
-alchemytests_LDADD =				\
-	../../../lib/smokey/libsmokey@CORE@.la	\
-	@XENO_CORE_LDADD@			\
-	@XENO_USER_LDADD@			\
-	-lpthread -lrt
-
 alchemytests_alarm1_SOURCES = alarm-1.c
 alchemytests_alarm1_CPPFLAGS = $(alchemycppflags)
 alchemytests_alarm1_LDADD = $(alchemyldadd)
diff --git a/testsuite/smokey/alchemytests/alchemytests_driver.c b/testsuite/smokey/alchemytests/alchemytests_driver.c
deleted file mode 100644
index 7cacbb399..000000000
--- a/testsuite/smokey/alchemytests/alchemytests_driver.c
+++ /dev/null
@@ -1,33 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-#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>
-
-int main(int argc, char *const argv[])
-{
-	struct smokey_test *t;
-	int ret, fails = 0;
-
-	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;
-}
diff --git a/testsuite/smokey/psostests/Makefile.am b/testsuite/smokey/psostests/Makefile.am
index ef4a23123..10b17d10d 100644
--- a/testsuite/smokey/psostests/Makefile.am
+++ b/testsuite/smokey/psostests/Makefile.am
@@ -11,7 +11,6 @@ libpsostests_a_CPPFLAGS = 	\
 CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
 
 test_PROGRAMS =			\
-		psostests       \
 		psostests_mq1	\
 		psostests_mq2	\
 		psostests_mq3	\
@@ -48,15 +47,6 @@ psosldadd =							\
 	@XENO_USER_LDADD@					\
 	-lpthread -lrt -lm
 
-psostests_SOURCES = psostests_driver.c
-psostests_CPPFLAGS = $(psoscppflags)
-psostests_LDADD =						\
-	../../../lib/smokey/libsmokey@CORE@.la			\
-	@XENO_CORE_LDADD@ 					\
-	@XENO_USER_LDADD@					\
-	-lpthread -lrt
-psostests_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ $(XENO_POSIX_WRAPPERS)
-
 psostests_mq1_SOURCES = mq-1.c
 psostests_mq1_CPPFLAGS = $(psoscppflags)
 psostests_mq1_LDADD = $(psosldadd)
diff --git a/testsuite/smokey/psostests/psostests_driver.c b/testsuite/smokey/psostests/psostests_driver.c
deleted file mode 100644
index c931d196d..000000000
--- a/testsuite/smokey/psostests/psostests_driver.c
+++ /dev/null
@@ -1,33 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-#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>
-
-int main(int argc, char *const argv[])
-{
-       struct smokey_test *t;
-       int ret, fails = 0;
-
-       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;
-}
diff --git a/testsuite/smokey/vxworkstests/Makefile.am b/testsuite/smokey/vxworkstests/Makefile.am
index a0aa9df76..3233cf8c7 100644
--- a/testsuite/smokey/vxworkstests/Makefile.am
+++ b/testsuite/smokey/vxworkstests/Makefile.am
@@ -11,7 +11,6 @@ libvxworkstests_a_CPPFLAGS =	\
 CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
 
 test_PROGRAMS =				\
-		vxworkstests		\
 		vxworkstests_lst1	\
 		vxworkstests_msgQ1	\
 		vxworkstests_msgQ2	\
@@ -36,15 +35,6 @@ vxworksldadd = 							\
 	@XENO_USER_LDADD@					\
 	-lpthread -lrt -lm
 
-vxworkstests_SOURCES = vxworkstests_driver.c
-vxworkstests_CPPFLAGS = $(vxworkscppflags)
-vxworkstests_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ $(XENO_POSIX_WRAPPERS)
-vxworkstests_LDADD =				\
-	../../../lib/smokey/libsmokey@CORE@.la	\
-	@XENO_CORE_LDADD@ 			\
-	@XENO_USER_LDADD@			\
-	-lpthread -lrt
-
 vxworkstests_lst1_SOURCES = lst-1.c
 vxworkstests_lst1_CPPFLAGS = $(vxworkscppflags)
 vxworkstests_lst1_LDADD = $(vxworksldadd)
diff --git a/testsuite/smokey/vxworkstests/vxworkstests_driver.c b/testsuite/smokey/vxworkstests/vxworkstests_driver.c
deleted file mode 100644
index 7cacbb399..000000000
--- a/testsuite/smokey/vxworkstests/vxworkstests_driver.c
+++ /dev/null
@@ -1,33 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-#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>
-
-int main(int argc, char *const argv[])
-{
-	struct smokey_test *t;
-	int ret, fails = 0;
-
-	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


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

* Re: [PATCH 01/10] testsuite: Fully integrate alchemytests into smokey
  2023-09-14  7:41               ` Jan Kiszka
  2023-09-20 13:52                 ` [PATCH 0/5] Improvements for smokey skintests Aaron Marcher
@ 2023-09-20 14:00                 ` Aaron Marcher
  1 sibling, 0 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-09-20 14:00 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: xenomai

Hi Jan,

sent you a patch series on top of `next`, fixing/improving the discussed
points. Let me know what you think of the solution I came up with.

Thanks,
Aaron

-- 
sigma star gmbh | Eduard-Bodem-Gasse 6, 6020 Innsbruck, AUT
UID/VAT Nr: ATU 66964118 | FN: 374287y

On Thu, Sep 14, 2023 at 01:11:02PM +0530, Jan Kiszka wrote:
> Hi Aaron,
> 
> Any news on this?
> 
> Jan
> 
> -- 
> Siemens AG, Technology
> Linux Expert Center

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

* Re: [PATCH 1/5] lib: Add smokey_run_extprog as helper for testsuite
  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
  0 siblings, 2 replies; 112+ messages in thread
From: Jan Kiszka @ 2023-09-22 15:49 UTC (permalink / raw)
  To: Aaron Marcher, xenomai; +Cc: richard

On 20.09.23 15:52, Aaron Marcher wrote:
> Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
> ---
>  include/smokey/smokey.h |  2 ++
>  lib/smokey/helpers.c    | 15 +++++++++++++++
>  2 files changed, 17 insertions(+)
> 
> diff --git a/include/smokey/smokey.h b/include/smokey/smokey.h
> index 0ac1e8df4..4d0fe011f 100644
> --- a/include/smokey/smokey.h
> +++ b/include/smokey/smokey.h
> @@ -259,6 +259,8 @@ int smokey_modprobe(const char *name, bool silent);
>  
>  int smokey_rmmod(const char *name);
>  
> +int smokey_run_extprog(const char *dir, const char *name, int argc, char *const argv[]);
> +
>  #ifdef __cplusplus
>  }
>  #endif
> diff --git a/lib/smokey/helpers.c b/lib/smokey/helpers.c
> index 0fc450ff6..dfd63b409 100644
> --- a/lib/smokey/helpers.c
> +++ b/lib/smokey/helpers.c
> @@ -410,3 +410,18 @@ int smokey_rmmod(const char *name)
>  
>  	return err;
>  }
> +
> +int smokey_run_extprog(const char *dir, const char *name, int argc, char *const argv[])
> +{
> +	int ret;
> +	char *tst_path;
> +
> +	ret = asprintf(&tst_path, "%s/%s --cpu-affinity=0", dir, name);

Why do we need to hard-code an affinity here?

Jan

> +	if (ret == -1)
> +		return -ENOMEM;
> +
> +	ret = system(tst_path);
> +	free(tst_path);
> +
> +	return ret;
> +}

-- 
Siemens AG, Technology
Linux Expert Center


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

* Re: [PATCH 0/5] Improvements for smokey skintests
  2023-09-20 13:52                 ` [PATCH 0/5] Improvements for smokey skintests Aaron Marcher
                                     ` (4 preceding siblings ...)
  2023-09-20 13:52                   ` [PATCH 5/5] testsuite: Drop skin test "drivers" Aaron Marcher
@ 2023-09-22 15:52                   ` Jan Kiszka
  5 siblings, 0 replies; 112+ messages in thread
From: Jan Kiszka @ 2023-09-22 15:52 UTC (permalink / raw)
  To: Aaron Marcher, xenomai; +Cc: richard

On 20.09.23 15:52, Aaron Marcher wrote:
> Merges all skin-related testsuite parts into common top-level smokey testcases,
> which in turn spawn all the related skin tests - as discussed before.
> 
> Additionally cleans up some includes and more.
> 
> Aaron Marcher (5):
>   lib: Add smokey_run_extprog as helper for testsuite
>   testsuite: Merge alchemytests in single smokey case
>   testsuite: Merge psostests in a single smokey case
>   testsuite: Merge vxworkstests in a single smokey case
>   testsuite: Drop skin test "drivers"
> 
>  include/smokey/smokey.h                       |   2 +
>  lib/smokey/helpers.c                          |  15 +++
>  testsuite/smokey/alchemytests/Makefile.am     |  12 --
>  testsuite/smokey/alchemytests/alchemytests.c  |  85 +++++++-------
>  .../smokey/alchemytests/alchemytests_driver.c |  33 ------
>  testsuite/smokey/psostests/Makefile.am        |  10 --
>  testsuite/smokey/psostests/psostests.c        | 111 +++++++++---------
>  testsuite/smokey/psostests/psostests_driver.c |  33 ------
>  testsuite/smokey/vxworkstests/Makefile.am     |  10 --
>  testsuite/smokey/vxworkstests/vxworkstests.c  |  66 ++++++-----
>  .../smokey/vxworkstests/vxworkstests_driver.c |  33 ------
>  11 files changed, 150 insertions(+), 260 deletions(-)
>  delete mode 100644 testsuite/smokey/alchemytests/alchemytests_driver.c
>  delete mode 100644 testsuite/smokey/psostests/psostests_driver.c
>  delete mode 100644 testsuite/smokey/vxworkstests/vxworkstests_driver.c
> 

I'm giving this a spin in 'next' already, but I would still like to hear
an answer on my question on patch 1. Maybe that could be put into commit
message for that patch later on...

Thanks,
Jan

-- 
Siemens AG, Technology
Linux Expert Center


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

* Re: [PATCH 1/5] lib: Add smokey_run_extprog as helper for testsuite
  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
  1 sibling, 0 replies; 112+ messages in thread
From: Richard Weinberger @ 2023-09-22 21:03 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: aaron, xenomai

----- Ursprüngliche Mail -----
> Von: "Jan Kiszka" <jan.kiszka@siemens.com>
>> +int smokey_run_extprog(const char *dir, const char *name, int argc, char *const
>> argv[])
>> +{
>> +	int ret;
>> +	char *tst_path;
>> +
>> +	ret = asprintf(&tst_path, "%s/%s --cpu-affinity=0", dir, name);
> 
> Why do we need to hard-code an affinity here?

We don't. Looks like a copy&paste error from my initial Alchemy test driver.
Aaron, please make it more flexible.

Alchemy, pSos and VxWorks tests assume an CPU affinity of 0, but we cannot
enforce that for smokey in general.

Thanks,
//richard

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

* [PATCH] lib: Drop cpu-affinity=0 from skin-tests helper
  2023-09-22 15:49                     ` Jan Kiszka
  2023-09-22 21:03                       ` Richard Weinberger
@ 2023-09-25 13:03                       ` Aaron Marcher
  2023-09-25 15:04                         ` Philippe Gerum
  2023-09-25 15:12                         ` [PATCH 0/1 V2] " Aaron Marcher
  1 sibling, 2 replies; 112+ messages in thread
From: Aaron Marcher @ 2023-09-25 13:03 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

Alchemy, pSos and VxWorks tests assume zero CPU affinity, but we cannot
enforce that in general.

Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 lib/smokey/helpers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/smokey/helpers.c b/lib/smokey/helpers.c
index dfd63b409..b50d9fbb1 100644
--- a/lib/smokey/helpers.c
+++ b/lib/smokey/helpers.c
@@ -416,7 +416,7 @@ int smokey_run_extprog(const char *dir, const char *name, int argc, char *const
 	int ret;
 	char *tst_path;
 
-	ret = asprintf(&tst_path, "%s/%s --cpu-affinity=0", dir, name);
+	ret = asprintf(&tst_path, "%s/%s", dir, name);
 	if (ret == -1)
 		return -ENOMEM;
 
-- 
2.35.3


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

* Re: [PATCH] lib: Drop cpu-affinity=0 from skin-tests helper
  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
  1 sibling, 0 replies; 112+ messages in thread
From: Philippe Gerum @ 2023-09-25 15:04 UTC (permalink / raw)
  To: Aaron Marcher; +Cc: xenomai, richard, jan.kiszka


Aaron Marcher <aaron@sigma-star.at> writes:

> Alchemy, pSos and VxWorks tests assume zero CPU affinity, but we cannot
> enforce that in general.
>
> Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
> ---
>  lib/smokey/helpers.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/smokey/helpers.c b/lib/smokey/helpers.c
> index dfd63b409..b50d9fbb1 100644
> --- a/lib/smokey/helpers.c
> +++ b/lib/smokey/helpers.c
> @@ -416,7 +416,7 @@ int smokey_run_extprog(const char *dir, const char *name, int argc, char *const
>  	int ret;
>  	char *tst_path;
>  
> -	ret = asprintf(&tst_path, "%s/%s --cpu-affinity=0", dir, name);
> +	ret = asprintf(&tst_path, "%s/%s", dir, name);
>  	if (ret == -1)
>  		return -ENOMEM;

This is going to break the tests on SMP, because the test logic checks
whether some series of actions happen sequentially, in the right
order. Allowing the threads to run in parallel on multiple CPUs would
prevent that.

CPU0 is by design always available as the boot CPU.

-- 
Philippe.

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

* [PATCH 0/1 V2] lib: Drop cpu-affinity=0 from skin-tests helper
  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                         ` Aaron Marcher
  2023-09-25 15:12                           ` [PATCH 1/1] " Aaron Marcher
  1 sibling, 1 reply; 112+ messages in thread
From: Aaron Marcher @ 2023-09-25 15:12 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

Changes since v1:
- Introduce parameter to control arguments on a case-to-case basis

Aaron Marcher (1):
  lib: Drop cpu-affinity=0 from skin-tests helper

 include/smokey/smokey.h                      | 2 +-
 lib/smokey/helpers.c                         | 8 ++++++--
 testsuite/smokey/alchemytests/alchemytests.c | 3 ++-
 testsuite/smokey/psostests/psostests.c       | 3 ++-
 testsuite/smokey/vxworkstests/vxworkstests.c | 3 ++-
 5 files changed, 13 insertions(+), 6 deletions(-)

-- 
2.35.3


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

* [PATCH 1/1] lib: Drop cpu-affinity=0 from skin-tests helper
  2023-09-25 15:12                         ` [PATCH 0/1 V2] " Aaron Marcher
@ 2023-09-25 15:12                           ` Aaron Marcher
  2023-09-25 15:42                             ` Jan Kiszka
  0 siblings, 1 reply; 112+ messages in thread
From: Aaron Marcher @ 2023-09-25 15:12 UTC (permalink / raw)
  To: xenomai; +Cc: richard, jan.kiszka, Aaron Marcher

Alchemy, pSos and VxWorks tests assume zero CPU affinity, but we cannot
enforce that in general.

Introduces a parameter to control the arguments.

Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
---
 include/smokey/smokey.h                      | 2 +-
 lib/smokey/helpers.c                         | 8 ++++++--
 testsuite/smokey/alchemytests/alchemytests.c | 3 ++-
 testsuite/smokey/psostests/psostests.c       | 3 ++-
 testsuite/smokey/vxworkstests/vxworkstests.c | 3 ++-
 5 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/include/smokey/smokey.h b/include/smokey/smokey.h
index 4d0fe011f..3623ba18c 100644
--- a/include/smokey/smokey.h
+++ b/include/smokey/smokey.h
@@ -259,7 +259,7 @@ int smokey_modprobe(const char *name, bool silent);
 
 int smokey_rmmod(const char *name);
 
-int smokey_run_extprog(const char *dir, const char *name, int argc, char *const argv[]);
+int smokey_run_extprog(const char *dir, const char *name, const char *args);
 
 #ifdef __cplusplus
 }
diff --git a/lib/smokey/helpers.c b/lib/smokey/helpers.c
index dfd63b409..99cd019aa 100644
--- a/lib/smokey/helpers.c
+++ b/lib/smokey/helpers.c
@@ -411,12 +411,16 @@ int smokey_rmmod(const char *name)
 	return err;
 }
 
-int smokey_run_extprog(const char *dir, const char *name, int argc, char *const argv[])
+int smokey_run_extprog(const char *dir, const char *name, const char *args)
 {
 	int ret;
 	char *tst_path;
 
-	ret = asprintf(&tst_path, "%s/%s --cpu-affinity=0", dir, name);
+	if (args == NULL)
+		ret = asprintf(&tst_path, "%s/%s", dir, name);
+	else
+		ret = asprintf(&tst_path, "%s/%s %s", dir, name, args);
+
 	if (ret == -1)
 		return -ENOMEM;
 
diff --git a/testsuite/smokey/alchemytests/alchemytests.c b/testsuite/smokey/alchemytests/alchemytests.c
index 5753af423..04f631bac 100644
--- a/testsuite/smokey/alchemytests/alchemytests.c
+++ b/testsuite/smokey/alchemytests/alchemytests.c
@@ -33,12 +33,13 @@ static int run_alchemytests(struct smokey_test *t, int argc, char *const argv[])
 		"alchemytests_task9",
 		"alchemytests_task10"
 	};
+	char *args = "--cpu-affinity=0";
 
 	for (size_t t = 0; t < sizeof(tests) / sizeof(tests[0]); t++)
 	{
 		int fails = 0;
 
-		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], argc, argv);
+		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], args);
 		if (ret) {
 			fails++;
 			if (smokey_keep_going)
diff --git a/testsuite/smokey/psostests/psostests.c b/testsuite/smokey/psostests/psostests.c
index a54e6ea31..f2a75c841 100644
--- a/testsuite/smokey/psostests/psostests.c
+++ b/testsuite/smokey/psostests/psostests.c
@@ -46,12 +46,13 @@ static int run_psostests(struct smokey_test *t, int argc, char *const argv[])
 		"psostests_tm6",
 		"psostests_tm7"
 	};
+	char *args = "--cpu-affinity=0";
 
 	for (size_t t = 0; t < sizeof(tests) / sizeof(tests[0]); t++)
 	{
 		int fails = 0;
 
-		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], argc, argv);
+		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], args);
 		if (ret) {
 			fails++;
 			if (smokey_keep_going)
diff --git a/testsuite/smokey/vxworkstests/vxworkstests.c b/testsuite/smokey/vxworkstests/vxworkstests.c
index d3ac891ae..24ea8f0a1 100644
--- a/testsuite/smokey/vxworkstests/vxworkstests.c
+++ b/testsuite/smokey/vxworkstests/vxworkstests.c
@@ -24,12 +24,13 @@ static int run_vxworkstests(struct smokey_test *t, int argc, char *const argv[])
 		"vxworkstests_task1",
 		"vxworkstests_task2"
 	};
+	char *args = "--cpu-affinity=0";
 
 	for (size_t t = 0; t < sizeof(tests) / sizeof(tests[0]); t++)
 	{
 		int fails = 0;
 
-		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], argc, argv);
+		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], args);
 		if (ret) {
 			fails++;
 			if (smokey_keep_going)
-- 
2.35.3


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

* Re: [PATCH 1/1] lib: Drop cpu-affinity=0 from skin-tests helper
  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-29 12:12                               ` Aaron Marcher
  0 siblings, 2 replies; 112+ messages in thread
From: Jan Kiszka @ 2023-09-25 15:42 UTC (permalink / raw)
  To: Aaron Marcher, xenomai; +Cc: richard

On 25.09.23 17:12, Aaron Marcher wrote:
> Alchemy, pSos and VxWorks tests assume zero CPU affinity, but we cannot
> enforce that in general.
> 
> Introduces a parameter to control the arguments.
> 
> Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
> ---
>  include/smokey/smokey.h                      | 2 +-
>  lib/smokey/helpers.c                         | 8 ++++++--
>  testsuite/smokey/alchemytests/alchemytests.c | 3 ++-
>  testsuite/smokey/psostests/psostests.c       | 3 ++-
>  testsuite/smokey/vxworkstests/vxworkstests.c | 3 ++-
>  5 files changed, 13 insertions(+), 6 deletions(-)
> 
> diff --git a/include/smokey/smokey.h b/include/smokey/smokey.h
> index 4d0fe011f..3623ba18c 100644
> --- a/include/smokey/smokey.h
> +++ b/include/smokey/smokey.h
> @@ -259,7 +259,7 @@ int smokey_modprobe(const char *name, bool silent);
>  
>  int smokey_rmmod(const char *name);
>  
> -int smokey_run_extprog(const char *dir, const char *name, int argc, char *const argv[]);
> +int smokey_run_extprog(const char *dir, const char *name, const char *args);
>  
>  #ifdef __cplusplus
>  }
> diff --git a/lib/smokey/helpers.c b/lib/smokey/helpers.c
> index dfd63b409..99cd019aa 100644
> --- a/lib/smokey/helpers.c
> +++ b/lib/smokey/helpers.c
> @@ -411,12 +411,16 @@ int smokey_rmmod(const char *name)
>  	return err;
>  }
>  
> -int smokey_run_extprog(const char *dir, const char *name, int argc, char *const argv[])
> +int smokey_run_extprog(const char *dir, const char *name, const char *args)

Actually, argc/argv were dead vars before...

>  {
>  	int ret;
>  	char *tst_path;
>  
> -	ret = asprintf(&tst_path, "%s/%s --cpu-affinity=0", dir, name);
> +	if (args == NULL)
> +		ret = asprintf(&tst_path, "%s/%s", dir, name);
> +	else
> +		ret = asprintf(&tst_path, "%s/%s %s", dir, name, args);
> +
>  	if (ret == -1)
>  		return -ENOMEM;
>  
> diff --git a/testsuite/smokey/alchemytests/alchemytests.c b/testsuite/smokey/alchemytests/alchemytests.c
> index 5753af423..04f631bac 100644
> --- a/testsuite/smokey/alchemytests/alchemytests.c
> +++ b/testsuite/smokey/alchemytests/alchemytests.c
> @@ -33,12 +33,13 @@ static int run_alchemytests(struct smokey_test *t, int argc, char *const argv[])
>  		"alchemytests_task9",
>  		"alchemytests_task10"
>  	};
> +	char *args = "--cpu-affinity=0";

const? Maybe even inline into the call?

>  
>  	for (size_t t = 0; t < sizeof(tests) / sizeof(tests[0]); t++)
>  	{
>  		int fails = 0;
>  
> -		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], argc, argv);
> +		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], args);
>  		if (ret) {
>  			fails++;
>  			if (smokey_keep_going)
> diff --git a/testsuite/smokey/psostests/psostests.c b/testsuite/smokey/psostests/psostests.c
> index a54e6ea31..f2a75c841 100644
> --- a/testsuite/smokey/psostests/psostests.c
> +++ b/testsuite/smokey/psostests/psostests.c
> @@ -46,12 +46,13 @@ static int run_psostests(struct smokey_test *t, int argc, char *const argv[])
>  		"psostests_tm6",
>  		"psostests_tm7"
>  	};
> +	char *args = "--cpu-affinity=0";
>  
>  	for (size_t t = 0; t < sizeof(tests) / sizeof(tests[0]); t++)
>  	{
>  		int fails = 0;
>  
> -		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], argc, argv);
> +		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], args);
>  		if (ret) {
>  			fails++;
>  			if (smokey_keep_going)
> diff --git a/testsuite/smokey/vxworkstests/vxworkstests.c b/testsuite/smokey/vxworkstests/vxworkstests.c
> index d3ac891ae..24ea8f0a1 100644
> --- a/testsuite/smokey/vxworkstests/vxworkstests.c
> +++ b/testsuite/smokey/vxworkstests/vxworkstests.c
> @@ -24,12 +24,13 @@ static int run_vxworkstests(struct smokey_test *t, int argc, char *const argv[])
>  		"vxworkstests_task1",
>  		"vxworkstests_task2"
>  	};
> +	char *args = "--cpu-affinity=0";
>  
>  	for (size_t t = 0; t < sizeof(tests) / sizeof(tests[0]); t++)
>  	{
>  		int fails = 0;
>  
> -		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], argc, argv);
> +		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], args);
>  		if (ret) {
>  			fails++;
>  			if (smokey_keep_going)

I'm inclined to ask for v2 of the original series. 'next' is not
'master', we can still update it.

Jan

-- 
Siemens AG, Technology
Linux Expert Center


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

* Re: [PATCH 1/1] lib: Drop cpu-affinity=0 from skin-tests helper
  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
  1 sibling, 1 reply; 112+ messages in thread
From: Jan Kiszka @ 2023-09-28 17:04 UTC (permalink / raw)
  To: Aaron Marcher, xenomai; +Cc: richard

On 25.09.23 17:42, Jan Kiszka wrote:
> On 25.09.23 17:12, Aaron Marcher wrote:
>> Alchemy, pSos and VxWorks tests assume zero CPU affinity, but we cannot
>> enforce that in general.
>>
>> Introduces a parameter to control the arguments.
>>
>> Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
>> ---
>>  include/smokey/smokey.h                      | 2 +-
>>  lib/smokey/helpers.c                         | 8 ++++++--
>>  testsuite/smokey/alchemytests/alchemytests.c | 3 ++-
>>  testsuite/smokey/psostests/psostests.c       | 3 ++-
>>  testsuite/smokey/vxworkstests/vxworkstests.c | 3 ++-
>>  5 files changed, 13 insertions(+), 6 deletions(-)
>>
>> diff --git a/include/smokey/smokey.h b/include/smokey/smokey.h
>> index 4d0fe011f..3623ba18c 100644
>> --- a/include/smokey/smokey.h
>> +++ b/include/smokey/smokey.h
>> @@ -259,7 +259,7 @@ int smokey_modprobe(const char *name, bool silent);
>>  
>>  int smokey_rmmod(const char *name);
>>  
>> -int smokey_run_extprog(const char *dir, const char *name, int argc, char *const argv[]);
>> +int smokey_run_extprog(const char *dir, const char *name, const char *args);
>>  
>>  #ifdef __cplusplus
>>  }
>> diff --git a/lib/smokey/helpers.c b/lib/smokey/helpers.c
>> index dfd63b409..99cd019aa 100644
>> --- a/lib/smokey/helpers.c
>> +++ b/lib/smokey/helpers.c
>> @@ -411,12 +411,16 @@ int smokey_rmmod(const char *name)
>>  	return err;
>>  }
>>  
>> -int smokey_run_extprog(const char *dir, const char *name, int argc, char *const argv[])
>> +int smokey_run_extprog(const char *dir, const char *name, const char *args)
> 
> Actually, argc/argv were dead vars before...
> 
>>  {
>>  	int ret;
>>  	char *tst_path;
>>  
>> -	ret = asprintf(&tst_path, "%s/%s --cpu-affinity=0", dir, name);
>> +	if (args == NULL)
>> +		ret = asprintf(&tst_path, "%s/%s", dir, name);
>> +	else
>> +		ret = asprintf(&tst_path, "%s/%s %s", dir, name, args);
>> +
>>  	if (ret == -1)
>>  		return -ENOMEM;
>>  
>> diff --git a/testsuite/smokey/alchemytests/alchemytests.c b/testsuite/smokey/alchemytests/alchemytests.c
>> index 5753af423..04f631bac 100644
>> --- a/testsuite/smokey/alchemytests/alchemytests.c
>> +++ b/testsuite/smokey/alchemytests/alchemytests.c
>> @@ -33,12 +33,13 @@ static int run_alchemytests(struct smokey_test *t, int argc, char *const argv[])
>>  		"alchemytests_task9",
>>  		"alchemytests_task10"
>>  	};
>> +	char *args = "--cpu-affinity=0";
> 
> const? Maybe even inline into the call?
> 
>>  
>>  	for (size_t t = 0; t < sizeof(tests) / sizeof(tests[0]); t++)
>>  	{
>>  		int fails = 0;
>>  
>> -		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], argc, argv);
>> +		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], args);
>>  		if (ret) {
>>  			fails++;
>>  			if (smokey_keep_going)
>> diff --git a/testsuite/smokey/psostests/psostests.c b/testsuite/smokey/psostests/psostests.c
>> index a54e6ea31..f2a75c841 100644
>> --- a/testsuite/smokey/psostests/psostests.c
>> +++ b/testsuite/smokey/psostests/psostests.c
>> @@ -46,12 +46,13 @@ static int run_psostests(struct smokey_test *t, int argc, char *const argv[])
>>  		"psostests_tm6",
>>  		"psostests_tm7"
>>  	};
>> +	char *args = "--cpu-affinity=0";
>>  
>>  	for (size_t t = 0; t < sizeof(tests) / sizeof(tests[0]); t++)
>>  	{
>>  		int fails = 0;
>>  
>> -		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], argc, argv);
>> +		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], args);
>>  		if (ret) {
>>  			fails++;
>>  			if (smokey_keep_going)
>> diff --git a/testsuite/smokey/vxworkstests/vxworkstests.c b/testsuite/smokey/vxworkstests/vxworkstests.c
>> index d3ac891ae..24ea8f0a1 100644
>> --- a/testsuite/smokey/vxworkstests/vxworkstests.c
>> +++ b/testsuite/smokey/vxworkstests/vxworkstests.c
>> @@ -24,12 +24,13 @@ static int run_vxworkstests(struct smokey_test *t, int argc, char *const argv[])
>>  		"vxworkstests_task1",
>>  		"vxworkstests_task2"
>>  	};
>> +	char *args = "--cpu-affinity=0";
>>  
>>  	for (size_t t = 0; t < sizeof(tests) / sizeof(tests[0]); t++)
>>  	{
>>  		int fails = 0;
>>  
>> -		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], argc, argv);
>> +		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], args);
>>  		if (ret) {
>>  			fails++;
>>  			if (smokey_keep_going)
> 
> I'm inclined to ask for v2 of the original series. 'next' is not
> 'master', we can still update it.
> 

Any chance to get a v2 soon?

Jan

-- 
Siemens AG, Technology
Linux Expert Center


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

* Re: [PATCH 1/1] lib: Drop cpu-affinity=0 from skin-tests helper
  2023-09-28 17:04                               ` Jan Kiszka
@ 2023-09-28 17:30                                 ` Jan Kiszka
  0 siblings, 0 replies; 112+ messages in thread
From: Jan Kiszka @ 2023-09-28 17:30 UTC (permalink / raw)
  To: Aaron Marcher, xenomai; +Cc: richard

On 28.09.23 19:04, Jan Kiszka wrote:
> On 25.09.23 17:42, Jan Kiszka wrote:
>> On 25.09.23 17:12, Aaron Marcher wrote:
>>> Alchemy, pSos and VxWorks tests assume zero CPU affinity, but we cannot
>>> enforce that in general.
>>>
>>> Introduces a parameter to control the arguments.
>>>
>>> Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
>>> ---
>>>  include/smokey/smokey.h                      | 2 +-
>>>  lib/smokey/helpers.c                         | 8 ++++++--
>>>  testsuite/smokey/alchemytests/alchemytests.c | 3 ++-
>>>  testsuite/smokey/psostests/psostests.c       | 3 ++-
>>>  testsuite/smokey/vxworkstests/vxworkstests.c | 3 ++-
>>>  5 files changed, 13 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/include/smokey/smokey.h b/include/smokey/smokey.h
>>> index 4d0fe011f..3623ba18c 100644
>>> --- a/include/smokey/smokey.h
>>> +++ b/include/smokey/smokey.h
>>> @@ -259,7 +259,7 @@ int smokey_modprobe(const char *name, bool silent);
>>>  
>>>  int smokey_rmmod(const char *name);
>>>  
>>> -int smokey_run_extprog(const char *dir, const char *name, int argc, char *const argv[]);
>>> +int smokey_run_extprog(const char *dir, const char *name, const char *args);
>>>  
>>>  #ifdef __cplusplus
>>>  }
>>> diff --git a/lib/smokey/helpers.c b/lib/smokey/helpers.c
>>> index dfd63b409..99cd019aa 100644
>>> --- a/lib/smokey/helpers.c
>>> +++ b/lib/smokey/helpers.c
>>> @@ -411,12 +411,16 @@ int smokey_rmmod(const char *name)
>>>  	return err;
>>>  }
>>>  
>>> -int smokey_run_extprog(const char *dir, const char *name, int argc, char *const argv[])
>>> +int smokey_run_extprog(const char *dir, const char *name, const char *args)
>>
>> Actually, argc/argv were dead vars before...
>>
>>>  {
>>>  	int ret;
>>>  	char *tst_path;
>>>  
>>> -	ret = asprintf(&tst_path, "%s/%s --cpu-affinity=0", dir, name);
>>> +	if (args == NULL)
>>> +		ret = asprintf(&tst_path, "%s/%s", dir, name);
>>> +	else
>>> +		ret = asprintf(&tst_path, "%s/%s %s", dir, name, args);
>>> +
>>>  	if (ret == -1)
>>>  		return -ENOMEM;
>>>  
>>> diff --git a/testsuite/smokey/alchemytests/alchemytests.c b/testsuite/smokey/alchemytests/alchemytests.c
>>> index 5753af423..04f631bac 100644
>>> --- a/testsuite/smokey/alchemytests/alchemytests.c
>>> +++ b/testsuite/smokey/alchemytests/alchemytests.c
>>> @@ -33,12 +33,13 @@ static int run_alchemytests(struct smokey_test *t, int argc, char *const argv[])
>>>  		"alchemytests_task9",
>>>  		"alchemytests_task10"
>>>  	};
>>> +	char *args = "--cpu-affinity=0";
>>
>> const? Maybe even inline into the call?
>>
>>>  
>>>  	for (size_t t = 0; t < sizeof(tests) / sizeof(tests[0]); t++)
>>>  	{
>>>  		int fails = 0;
>>>  
>>> -		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], argc, argv);
>>> +		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], args);
>>>  		if (ret) {
>>>  			fails++;
>>>  			if (smokey_keep_going)
>>> diff --git a/testsuite/smokey/psostests/psostests.c b/testsuite/smokey/psostests/psostests.c
>>> index a54e6ea31..f2a75c841 100644
>>> --- a/testsuite/smokey/psostests/psostests.c
>>> +++ b/testsuite/smokey/psostests/psostests.c
>>> @@ -46,12 +46,13 @@ static int run_psostests(struct smokey_test *t, int argc, char *const argv[])
>>>  		"psostests_tm6",
>>>  		"psostests_tm7"
>>>  	};
>>> +	char *args = "--cpu-affinity=0";
>>>  
>>>  	for (size_t t = 0; t < sizeof(tests) / sizeof(tests[0]); t++)
>>>  	{
>>>  		int fails = 0;
>>>  
>>> -		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], argc, argv);
>>> +		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], args);
>>>  		if (ret) {
>>>  			fails++;
>>>  			if (smokey_keep_going)
>>> diff --git a/testsuite/smokey/vxworkstests/vxworkstests.c b/testsuite/smokey/vxworkstests/vxworkstests.c
>>> index d3ac891ae..24ea8f0a1 100644
>>> --- a/testsuite/smokey/vxworkstests/vxworkstests.c
>>> +++ b/testsuite/smokey/vxworkstests/vxworkstests.c
>>> @@ -24,12 +24,13 @@ static int run_vxworkstests(struct smokey_test *t, int argc, char *const argv[])
>>>  		"vxworkstests_task1",
>>>  		"vxworkstests_task2"
>>>  	};
>>> +	char *args = "--cpu-affinity=0";
>>>  
>>>  	for (size_t t = 0; t < sizeof(tests) / sizeof(tests[0]); t++)
>>>  	{
>>>  		int fails = 0;
>>>  
>>> -		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], argc, argv);
>>> +		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], args);
>>>  		if (ret) {
>>>  			fails++;
>>>  			if (smokey_keep_going)
>>
>> I'm inclined to ask for v2 of the original series. 'next' is not
>> 'master', we can still update it.
>>
> 
> Any chance to get a v2 soon?
> 

Just looked into this again and decided to update in-place:

diff --git a/include/smokey/smokey.h b/include/smokey/smokey.h
index 4d0fe011fa..3623ba18c2 100644
--- a/include/smokey/smokey.h
+++ b/include/smokey/smokey.h
@@ -259,7 +259,7 @@ int smokey_modprobe(const char *name, bool silent);
 
 int smokey_rmmod(const char *name);
 
-int smokey_run_extprog(const char *dir, const char *name, int argc, char *const argv[]);
+int smokey_run_extprog(const char *dir, const char *name, const char *args);
 
 #ifdef __cplusplus
 }
diff --git a/lib/smokey/helpers.c b/lib/smokey/helpers.c
index dfd63b4092..4c90a513d4 100644
--- a/lib/smokey/helpers.c
+++ b/lib/smokey/helpers.c
@@ -411,12 +411,12 @@ int smokey_rmmod(const char *name)
 	return err;
 }
 
-int smokey_run_extprog(const char *dir, const char *name, int argc, char *const argv[])
+int smokey_run_extprog(const char *dir, const char *name, const char *args)
 {
 	int ret;
 	char *tst_path;
 
-	ret = asprintf(&tst_path, "%s/%s --cpu-affinity=0", dir, name);
+	ret = asprintf(&tst_path, "%s/%s %s", dir, name, args ? : "");
 	if (ret == -1)
 		return -ENOMEM;
 
diff --git a/testsuite/smokey/alchemytests/alchemytests.c b/testsuite/smokey/alchemytests/alchemytests.c
index 5753af4233..b9e84ac1e4 100644
--- a/testsuite/smokey/alchemytests/alchemytests.c
+++ b/testsuite/smokey/alchemytests/alchemytests.c
@@ -38,7 +38,8 @@ static int run_alchemytests(struct smokey_test *t, int argc, char *const argv[])
 	{
 		int fails = 0;
 
-		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], argc, argv);
+		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t],
+					 "--cpu-affinity=0");
 		if (ret) {
 			fails++;
 			if (smokey_keep_going)
diff --git a/testsuite/smokey/psostests/psostests.c b/testsuite/smokey/psostests/psostests.c
index a54e6ea316..e35dd82c59 100644
--- a/testsuite/smokey/psostests/psostests.c
+++ b/testsuite/smokey/psostests/psostests.c
@@ -51,7 +51,8 @@ static int run_psostests(struct smokey_test *t, int argc, char *const argv[])
 	{
 		int fails = 0;
 
-		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], argc, argv);
+		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t],
+					 "--cpu-affinity=0");
 		if (ret) {
 			fails++;
 			if (smokey_keep_going)
diff --git a/testsuite/smokey/vxworkstests/vxworkstests.c b/testsuite/smokey/vxworkstests/vxworkstests.c
index d3ac891ae3..4b694b30bb 100644
--- a/testsuite/smokey/vxworkstests/vxworkstests.c
+++ b/testsuite/smokey/vxworkstests/vxworkstests.c
@@ -29,7 +29,8 @@ static int run_vxworkstests(struct smokey_test *t, int argc, char *const argv[])
 	{
 		int fails = 0;
 
-		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], argc, argv);
+		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t],
+					 "--cpu-affinity=0");
 		if (ret) {
 			fails++;
 			if (smokey_keep_going)

Jan

-- 
Siemens AG, Technology
Linux Expert Center


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

* Re: [PATCH 1/1] lib: Drop cpu-affinity=0 from skin-tests helper
  2023-09-25 15:42                             ` Jan Kiszka
  2023-09-28 17:04                               ` Jan Kiszka
@ 2023-09-29 12:12                               ` Aaron Marcher
  2023-09-29 12:34                                 ` Jan Kiszka
  1 sibling, 1 reply; 112+ messages in thread
From: Aaron Marcher @ 2023-09-29 12:12 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: xenomai

Hi Jan,

should I still rebase the original series into clean commits we can
re-apply to `next` then or do you want to keep it like that?

Aaron

-- 
sigma star gmbh | Eduard-Bodem-Gasse 6, 6020 Innsbruck, AUT
UID/VAT Nr: ATU 66964118 | FN: 374287y

On Mon, Sep 25, 2023 at 05:42:47PM +0200, Jan Kiszka wrote:
> On 25.09.23 17:12, Aaron Marcher wrote:
> > Alchemy, pSos and VxWorks tests assume zero CPU affinity, but we cannot
> > enforce that in general.
> > 
> > Introduces a parameter to control the arguments.
> > 
> > Signed-off-by: Aaron Marcher <aaron@sigma-star.at>
> > ---
> >  include/smokey/smokey.h                      | 2 +-
> >  lib/smokey/helpers.c                         | 8 ++++++--
> >  testsuite/smokey/alchemytests/alchemytests.c | 3 ++-
> >  testsuite/smokey/psostests/psostests.c       | 3 ++-
> >  testsuite/smokey/vxworkstests/vxworkstests.c | 3 ++-
> >  5 files changed, 13 insertions(+), 6 deletions(-)
> > 
> > diff --git a/include/smokey/smokey.h b/include/smokey/smokey.h
> > index 4d0fe011f..3623ba18c 100644
> > --- a/include/smokey/smokey.h
> > +++ b/include/smokey/smokey.h
> > @@ -259,7 +259,7 @@ int smokey_modprobe(const char *name, bool silent);
> >  
> >  int smokey_rmmod(const char *name);
> >  
> > -int smokey_run_extprog(const char *dir, const char *name, int argc, char *const argv[]);
> > +int smokey_run_extprog(const char *dir, const char *name, const char *args);
> >  
> >  #ifdef __cplusplus
> >  }
> > diff --git a/lib/smokey/helpers.c b/lib/smokey/helpers.c
> > index dfd63b409..99cd019aa 100644
> > --- a/lib/smokey/helpers.c
> > +++ b/lib/smokey/helpers.c
> > @@ -411,12 +411,16 @@ int smokey_rmmod(const char *name)
> >  	return err;
> >  }
> >  
> > -int smokey_run_extprog(const char *dir, const char *name, int argc, char *const argv[])
> > +int smokey_run_extprog(const char *dir, const char *name, const char *args)
> 
> Actually, argc/argv were dead vars before...
> 
> >  {
> >  	int ret;
> >  	char *tst_path;
> >  
> > -	ret = asprintf(&tst_path, "%s/%s --cpu-affinity=0", dir, name);
> > +	if (args == NULL)
> > +		ret = asprintf(&tst_path, "%s/%s", dir, name);
> > +	else
> > +		ret = asprintf(&tst_path, "%s/%s %s", dir, name, args);
> > +
> >  	if (ret == -1)
> >  		return -ENOMEM;
> >  
> > diff --git a/testsuite/smokey/alchemytests/alchemytests.c b/testsuite/smokey/alchemytests/alchemytests.c
> > index 5753af423..04f631bac 100644
> > --- a/testsuite/smokey/alchemytests/alchemytests.c
> > +++ b/testsuite/smokey/alchemytests/alchemytests.c
> > @@ -33,12 +33,13 @@ static int run_alchemytests(struct smokey_test *t, int argc, char *const argv[])
> >  		"alchemytests_task9",
> >  		"alchemytests_task10"
> >  	};
> > +	char *args = "--cpu-affinity=0";
> 
> const? Maybe even inline into the call?
> 
> >  
> >  	for (size_t t = 0; t < sizeof(tests) / sizeof(tests[0]); t++)
> >  	{
> >  		int fails = 0;
> >  
> > -		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], argc, argv);
> > +		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], args);
> >  		if (ret) {
> >  			fails++;
> >  			if (smokey_keep_going)
> > diff --git a/testsuite/smokey/psostests/psostests.c b/testsuite/smokey/psostests/psostests.c
> > index a54e6ea31..f2a75c841 100644
> > --- a/testsuite/smokey/psostests/psostests.c
> > +++ b/testsuite/smokey/psostests/psostests.c
> > @@ -46,12 +46,13 @@ static int run_psostests(struct smokey_test *t, int argc, char *const argv[])
> >  		"psostests_tm6",
> >  		"psostests_tm7"
> >  	};
> > +	char *args = "--cpu-affinity=0";
> >  
> >  	for (size_t t = 0; t < sizeof(tests) / sizeof(tests[0]); t++)
> >  	{
> >  		int fails = 0;
> >  
> > -		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], argc, argv);
> > +		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], args);
> >  		if (ret) {
> >  			fails++;
> >  			if (smokey_keep_going)
> > diff --git a/testsuite/smokey/vxworkstests/vxworkstests.c b/testsuite/smokey/vxworkstests/vxworkstests.c
> > index d3ac891ae..24ea8f0a1 100644
> > --- a/testsuite/smokey/vxworkstests/vxworkstests.c
> > +++ b/testsuite/smokey/vxworkstests/vxworkstests.c
> > @@ -24,12 +24,13 @@ static int run_vxworkstests(struct smokey_test *t, int argc, char *const argv[])
> >  		"vxworkstests_task1",
> >  		"vxworkstests_task2"
> >  	};
> > +	char *args = "--cpu-affinity=0";
> >  
> >  	for (size_t t = 0; t < sizeof(tests) / sizeof(tests[0]); t++)
> >  	{
> >  		int fails = 0;
> >  
> > -		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], argc, argv);
> > +		ret = smokey_run_extprog(XENO_TEST_DIR, tests[t], args);
> >  		if (ret) {
> >  			fails++;
> >  			if (smokey_keep_going)
> 
> I'm inclined to ask for v2 of the original series. 'next' is not
> 'master', we can still update it.
> 
> Jan
> 
> -- 
> Siemens AG, Technology
> Linux Expert Center

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

* Re: [PATCH 1/1] lib: Drop cpu-affinity=0 from skin-tests helper
  2023-09-29 12:12                               ` Aaron Marcher
@ 2023-09-29 12:34                                 ` Jan Kiszka
  0 siblings, 0 replies; 112+ messages in thread
From: Jan Kiszka @ 2023-09-29 12:34 UTC (permalink / raw)
  To: Aaron Marcher, xenomai

On 29.09.23 14:12, Aaron Marcher wrote:
> Hi Jan,
> 
> should I still rebase the original series into clean commits we can
> re-apply to `next` then or do you want to keep it like that?
> 

Next should be clean now, but please cross check if you like to add
something.

Thanks,
Jan

-- 
Siemens AG, Technology
Linux Expert Center


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

end of thread, other threads:[~2023-09-29 12:34 UTC | newest]

Thread overview: 112+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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   ` [PATCH 08/11] testsuite: Add a simple test driver for psostests Aaron Marcher
2023-04-06 10:33   ` [PATCH 09/11] testsuite: Integrate vwworks tests into testsuite/ 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

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).