[riot-notifications] [RIOT-OS/RIOT] build system: add machine-readable RIOT_VERSION_CODE macro (#16765)

Karl Fessel notifications at github.com
Mon Sep 20 14:34:57 CEST 2021


```
$ git pr o 16765

$ tests/unittests$ make tests-kernel_defines
```
Fails with this error
```
"make" -C <RIOT>/tests/unittests/tests-kernel_defines
In file included from <RIOT>/sys/include/embUnit/embUnit.h:47,
                 from <RIOT>/sys/include/embUnit.h:24,
                 from <RIOT>/tests/unittests/tests-kernel_defines/tests-kernel_defines.c:14:
<RIOT>/tests/unittests/tests-kernel_defines/tests-kernel_defines.c: In function ‘test_kernel_version’:
<RIOT>/tests/unittests/bin/native/riotbuild/riotbuild.h:15:27: error: ‘m’ undeclared (first use in this function)
   15 | #define RIOT_VERSION_CODE m-sched-KERNEL_VERSION(12,4,0)
      |                           ^
<RIOT>/sys/include/embUnit/AssertImpl.h:82:20: note: in definition of macro ‘TEST_ASSERT_MESSAGE’
   82 |         __typeof__(condition_) ____condition__ = (condition_); \
      |                    ^~~~~~~~~~
<RIOT>/tests/unittests/tests-kernel_defines/tests-kernel_defines.c:30:5: note: in expansion of macro ‘TEST_ASSERT’
   30 |     TEST_ASSERT(RIOT_VERSION_CODE);
      |     ^~~~~~~~~~~
<RIOT>/tests/unittests/tests-kernel_defines/tests-kernel_defines.c:30:17: note: in expansion of macro ‘RIOT_VERSION_CODE’
   30 |     TEST_ASSERT(RIOT_VERSION_CODE);
      |                 ^~~~~~~~~~~~~~~~~
<RIOT>/tests/unittests/bin/native/riotbuild/riotbuild.h:15:27: note: each undeclared identifier is reported only once for each function it appears in
   15 | #define RIOT_VERSION_CODE m-sched-KERNEL_VERSION(12,4,0)
      |                           ^
<RIOT>/sys/include/embUnit/AssertImpl.h:82:20: note: in definition of macro ‘TEST_ASSERT_MESSAGE’
   82 |         __typeof__(condition_) ____condition__ = (condition_); \
      |                    ^~~~~~~~~~
<RIOT>/tests/unittests/tests-kernel_defines/tests-kernel_defines.c:30:5: note: in expansion of macro ‘TEST_ASSERT’
   30 |     TEST_ASSERT(RIOT_VERSION_CODE);
      |     ^~~~~~~~~~~
<RIOT>/tests/unittests/tests-kernel_defines/tests-kernel_defines.c:30:17: note: in expansion of macro ‘RIOT_VERSION_CODE’
   30 |     TEST_ASSERT(RIOT_VERSION_CODE);
      |                 ^~~~~~~~~~~~~~~~~
<RIOT>/tests/unittests/bin/native/riotbuild/riotbuild.h:15:29: error: ‘sched’ undeclared (first use in this function)
   15 | #define RIOT_VERSION_CODE m-sched-KERNEL_VERSION(12,4,0)
      |                             ^~~~~
<RIOT>/sys/include/embUnit/AssertImpl.h:82:20: note: in definition of macro ‘TEST_ASSERT_MESSAGE’
   82 |         __typeof__(condition_) ____condition__ = (condition_); \
      |                    ^~~~~~~~~~
<RIOT>/tests/unittests/tests-kernel_defines/tests-kernel_defines.c:30:5: note: in expansion of macro ‘TEST_ASSERT’
   30 |     TEST_ASSERT(RIOT_VERSION_CODE);
      |     ^~~~~~~~~~~
<RIOT>/tests/unittests/tests-kernel_defines/tests-kernel_defines.c:30:17: note: in expansion of macro ‘RIOT_VERSION_CODE’
   30 |     TEST_ASSERT(RIOT_VERSION_CODE);
```

```
$ make tests-rtc
$ make term
```
shows this riot version information
```
main(): This is RIOT! (Version: m-sched-1224-gd343b0-test-version-code)
```

Maybe a check if `RIOT_VERSION` matches the scheme `20YY.MM.RR` is needed and a default like `2099.99.99` if that check fails is needed

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16765#issuecomment-922887468
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210920/0f9908b2/attachment-0001.htm>


More information about the notifications mailing list