Re: [PATCH 2/6] testsuite: Hook up alchemytests

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

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

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



Re: [PATCH 2/6] testsuite: Hook up alchemytests

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

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

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

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

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

Ah, that is the reason.

Jan

-- 
Siemens AG, Technology
Competence Center Embedded Linux



Re: [PATCH 2/6] testsuite: Hook up alchemytests

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

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

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

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

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

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

-- 
Thanks,
//richard



Re: [PATCH 2/6] testsuite: Hook up alchemytests

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

With only up to here applied:

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

> diff --git a/configure.ac b/configure.ac
> index 019453793..8fd86e5a1 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1046,6 +1046,7 @@ AC_CONFIG_FILES([ \
>   testsuite/smokey/can/Makefile
>   testsuite/clocktest/Makefile \
>   testsuite/xeno-test/Makefile \
> + testsuite/alchemytests/Makefile \
>   utils/Makefile \
>   utils/hdb/Makefile \
>   utils/can/Makefile \
> diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
> index 4932f6d33..e027485fb 100644
> --- a/testsuite/Makefile.am
> +++ b/testsuite/Makefile.am
> @@ -7,7 +7,8 @@ SUBDIRS +=\
>   gpiotest\
>   spitest \
>   switchtest  \
> - xeno-test
> + xeno-test   \
> + alchemytests
>  endif
>  
>  DIST_SUBDIRS =   \
> @@ -18,4 +19,5 @@ DIST_SUBDIRS =  \
>   smokey  \
>   spitest \
>   switchtest  \
> - xeno-test
> + xeno-test   \
> + alchemytests
> diff --git a/testsuite/alchemytests/Makefile.am 
> b/testsuite/alchemytests/Makefile.am
> new file mode 100644
> index 0..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 =