tests/relic: move from unittests to regular test#10189
Conversation
|
Question, the |
tests/pkg_relic/Makefile
Outdated
| nucleo-l053r8 \ | ||
| # | ||
|
|
||
| TEST_BOARDS_LLVM_COMPILE := native \ |
There was a problem hiding this comment.
This should be done in the relic package to blacklist llvm if it is not compatible using TOOLCHAIN_BLACKLIST += llvm with the correct conditionals.
There was a problem hiding this comment.
ah thanks, that line didn't work anyway
There was a problem hiding this comment.
ah thanks, that line didn't work anyway
tests/pkg_relic/Makefile
Outdated
| TEST_BOARDS_LLVM_COMPILE := native \ | ||
| # | ||
|
|
||
| CFLAGS += -DTHREAD_STACKSIZE_MAIN=\(4*THREAD_STACKSIZE_DEFAULT\) |
There was a problem hiding this comment.
This was not set for this test in unittests why now ?
There was a problem hiding this comment.
First this test was blacklisted for all platforms other than native in the unittests. I tried to run it on different boards, and I got a hard fault + reboot with increased stack size that is fixed but the test gets stuck anyway.
cladmi
left a comment
There was a problem hiding this comment.
Some big changes from what was in unittests that are not currently justified.
If the update is correct, it should be specified in the migration commit message.
|
The test currently fails on With a stack size of |
tests/pkg_relic/Makefile
Outdated
| # | ||
|
|
||
| export TEST_BOARDS_LLVM_COMPILE := native | ||
| TOOLCHAIN_BLACKLIST += llvm |
There was a problem hiding this comment.
This should be in the relic package as it is a package issue, not from the application (like others packages using it). git grep TOOLCHAINS_BLACKLIST
And sorry it was TOOLCHAINS_BLACKLIST I was missing the S. Btw, the documentation uses the wrong name… will update it.
And currently, building in native works for ubuntu 18.04
/home/harter/work/git/RIOT/tests/pkg_relic/bin/native/tests_pkg_relic.elf
RIOT native interrupts/signals initialized.
LED_RED_OFF
LED_GREEN_ON
RIOT native board initialized.
RIOT native hardware initialization complete.
main(): This is RIOT! (Version: 2018.10-devel-1204-g19e1b-inetm02-pr/riot/10189/move_from_unittests_to_regular_test)
.
OK (1 tests)
so should only disable for arm like in
RIOT/pkg/jerryscript/Makefile.include
Lines 4 to 9 in f5379c0
I suspect the issue with llvm to be the same as jerryscript by the way #9821
There was a problem hiding this comment.
Indeed it is the same issue, so you can reuse the same comment as jerryscript.
It compiles with llvm with this fix, I can do a PR for the fix:
diff --git a/pkg/relic/Makefile b/pkg/relic/Makefile
index 7e2466c9d..d73aecbee 100644
--- a/pkg/relic/Makefile
+++ b/pkg/relic/Makefile
@@ -18,7 +18,7 @@ all: $(PKG_BUILDDIR)/Makefile
$(PKG_BUILDDIR)/Makefile: $(TOOLCHAIN_FILE)
cd $(PKG_BUILDDIR) && \
- COMP="$(filter-out -Werror -Werror=old-style-definition -Werror=strict-prototypes -std=gnu99, $(CFLAGS) ) " \
+ COMP="$(INCLUDES) $(filter-out -Werror -Werror=old-style-definition -Werror=strict-prototypes -std=gnu99, $(CFLAGS) ) " \
cmake -DCMAKE_TOOLCHAIN_FILE=$(TOOLCHAIN_FILE) \
-DCHECK=off -DTESTS=0 -DBENCH=0 -DSHLIB=off -Wno-dev $(RELIC_CONFIG_FLAGS) .
There was a problem hiding this comment.
so just to clarify: its either blacklisting llvm for the relic package or applying your fix for jerryscript to make it work with llvm? Or is both somehow needed?
There was a problem hiding this comment.
I would say it is now blacklisting because it does not work for llvm and cortex-m, it is a fact, and it is an immediate solution.
Making it work for llvm is an improvement that needs work, so a new feature somehow with specific review. So can come in a second step.
I do not delay this PR because of something that was broken for years.
I was just adding details so the blacklisting comment would be accurate.
pkg/relic/Makefile.include
Outdated
| INCLUDES += -I$(PKGDIRBASE)/relic/include | ||
|
|
||
| ifneq (,$(filter cortex-m%,$(CPU_ARCH))) | ||
| # jerryscript package package is not using system includes right now, so |
There was a problem hiding this comment.
Same but with relic instead of jerryscript. :p
d9bbda4 to
569f542
Compare
|
I added the |
|
I will finish reviewing after murdock. |
There was a problem hiding this comment.
I successfully tested with IoT-LAB nodes with the following board and command:
BOARDS="samr21-xpro pba-d-01-kw2x b-l475e-iot01a nrf52dk arduino-zero nrf52840dk iotlab-m3 microbit frdm-kw41z"
for board in ${BOARDS}; do BOARD=${board} RIOT_CI_BUILD=1 IOTLAB_NODE=auto-ssh BUILD_IN_DOCKER=1 DOCKER="sudo docker" make --no-print-directory -C tests/pkg_relic clean all flash test || break; done
Additional compile tests that I ran:
It does not compile on wsn430-v1_3b due to missing time.h.
With the latest update of riotdocker image (ubuntu bionic), it does not fail for arduino-mega2560 anymore as time.h is available, but does not have enough memory to link.
It failed In the xenial image it fails because of missing time.h.
So ok to keep them blacklisted.
Python flake8 error
travis is complaining because the regexp for the test is not a python regex string so r'match_string'. By rebasing to riot/master it would be using the same environment as murdock, not sure it it would still be detected.
Change for the python test described inlined.
After this it would be ok to go
tests/pkg_relic/tests/01-run.py
Outdated
|
|
||
|
|
||
| def testfunc(child): | ||
| child.expect('OK \(\d+ tests\)', timeout=120) |
There was a problem hiding this comment.
flake8 is correctly complaining about this one, this should be a regex string
| child.expect('OK \(\d+ tests\)', timeout=120) | |
| child.expect(r'OK \(\d+ tests\)', timeout=120) |
When rebasing to riot/master it will not be detected anymore as it will be using riotdocker image that uses the repository flake8 version but the error is still valid.
This moves tests for the relic package from unittests to a regular test, which should help to decrease binary size of unittests.
569f542 to
618fd16
Compare
|
@smlng Please tell when you force push, github does not send any notification about it |
cladmi
left a comment
There was a problem hiding this comment.
Diff is the same as before the rebase/squash except the regex fix.
Tested the rebase again with the same boards as before.
Also a recent version of flake8 does not complain anymore about the test script.
|
Just waiting for murdock and it will be good to merge. |
|
@cladmi sorry about the force-push. On another note: the regex is wrong in some other tests in master too. |
|
I know, it was already mentioned in another test migration out of tests/unittests, but |
|
Thank you for doing the migration, I find it magic all the issues there can be with simple tasks like this. |
Contribution description
This moves tests for the relic package from unittests to a regular
test, which should help to decrease binary size of unittests.
Testing procedure
run the tests, i.e.
BOARD=<your-favourite> make -C tests/pkg_relic flash testIssues/PRs references