Add cross-platform tests for libmetal - #335
Conversation
|
Hello @lntaf, Thank you for your contribution! If I understand your objective correctly, you propose adding independent libmetal tests that are separate from the system/machine, by using only the generic API. To help us understand your work better, it would be helpful if you could share:
As an initial review, if your tests are platform-independent, I would suggest placing them directly at the root level of the test directory, with system and machine directories for specific implementations. |
|
Hello, Ubuntu 22.04.3 LTS (Linux 5.15.153.1-microsoft-standard-WSL2 x86_64) All of these systems compiled natively using the provided makefile which currently builds as shown: test_all.h includes all the individual testfiles and a small struct with the name of each one (for printing purposes) as well as storing the return value of each. I'll work on getting you a hierarchy soon because I'm still working on a couple that may be closer to completion so they could be included. When I submit my followup edit with possibly a few more tests and changing the hierarchy should I add a CMake rule that falls under the -DWITH_TESTS flag? Any other feedback is much appreciated! |
That seems coherent to me to build with the -DWITH_TESTS flag.
Yes , I would also be interested by more feedback especially concerning current AMD implementation: |
|
@lntaf It seems you have added a merge commit to your pull request but did not update the code. You may need to push your updates again. 😃 |
|
Indeed @arnopo, it seems syncing my fork to libmetal put an empty commit into this request, I'll push my changes shortly. |
|
As far as I can tell, my commits cover all the feedback given, let me know if anything else needs tweaking! |
|
This pull request has been marked as a stale pull request because it has been open (more than) 45 days with no activity. |
|
Let me know if there's anything else required! |
|
pushed again for compliance and formatting, no extra changes made |
arnopo
left a comment
There was a problem hiding this comment.
I run it on a Linux PC using following command:
cmake . -WITH_TESTS -Bbuild
make -C build/
./build/test/test-all-metal-static
The result is:
------utilities.c------
metal: warning: skipped page size 2097152 - invalid args
metal: warning: skipped page size 1073741824 - invalid args
metal: error: -10 divided by 3 rounded down is -3 instead of -4 and rounded up is -2 instead of -3
alloc.c [PASS]
assert.c [PASS]
cache.c [PASS]
config.c [PASS]
cpu.c [PASS]
init.c [PASS]
log.c [PASS]
mutex.c [PASS]
shmem.c [PASS]
sleep.c [PASS]
spinlock.c [PASS]
utilities.c [FAIL] (code 8)
In addition of my comments, please, could you :
- fix test utilities issue
- Squash your commits to ease the reviews. we use to fix directly the commits instead of adding fix commit on top of.
|
I'll look into the changes you've mentioned @arnopo but regarding the utilities test, Also regarding squashing commits, would you like me to just squash all the fixes here or go back to whatever commit is responsible for the proposed changes and change it there? Just to confirm. |
right After cross check the macros are only support positive values. That show the utility of the test 😃
I don't remember the initial split but the idea is to go back to the initial commit split, integrating fixup when possible, else with a dedicated commit (if for instance you rename existing functions). |
|
Hi @lntaf , I do program management for the OpenAMP project. No pressure, just making you aware in case you are not on the openamp-rp mailing list: The feature freeze is on Oct 18 for the October release of OpenAMP, if you wish to catch this release. https://lists.openampproject.org/archives/list/openamp-rp@lists.openampproject.org/thread/SO54TZBU4AG7UPHKYLCR6YTVG6YCVMVP/ |
|
Hello @nathalie-ckc , thanks for letting me know! I'll see what I can do about wrapping this up as soon as possible to allow time for any last input before the freeze! |
|
I believe that's everything, should be ready to merge as far as I can tell and I just squashed every fix commit to my initial commit, seperating out the two commits that modified existing testing api files. |
arnopo
left a comment
There was a problem hiding this comment.
Seems that there is some merge conflict replicate in you code
| endif (WITH_TESTS_EXEC) | ||
| endif (WITH_STATIC_LIB) | ||
|
|
||
| >>>>>>> 24d62ba (Remove dead code and fix for placeholder system threads.c testing file) |
metal_run has been renamed to metal_test_run metal_run_noblock has been renamed to metal_test_run_noblock metal_finish_threads has been renamed to metal_test_finish_threads Signed-off-by: Lefteris Ntafotis <lntaf@ics.forth.gr>
Zephyr systems will print an error for unimplemented testing API calls Signed-off-by: Lefteris Ntafotis <lntaf@ics.forth.gr>
To-be-expanded suite of tests for libmetal using system-agnostic API instead of system specific tests. Signed-off-by: Lefteris Ntafotis <lntaf@ics.forth.gr>
|
Apologies for the delay, I believe everything is in order now |
|
@lntaf Thanks for your work. Following enhancement I suggest, but we don't have to address it immediately. we can initialize metal log handler common for all the tests. This can be common for all the tests. So can be initialized in @arnopo , are you okay if we merge current patch as it is and do above enhancement after the release? Thanks. |
To-be-expanded suite of tests for libmetal using system-agnostic interfaces instead of system specific tests.
There's more tests coming to expand the suite to other interfaces the library provides for completeness.
As much as possible tests isolate their libmetal usage to the filename of the interface they're testing.
When unavoidable, as is the case with init, an extra test is provided testing just that interface to help narrow down any issues.
Known issues:
mutex and shmem testing are pthread based, this will be changed to metal_run in a followup patch.
Interfaces: device, irq, threads, atomics are missing and will also be added later if there's interest in this.
As such this directory doesn't yet tamper with any pre-existing files and uses a simple Makefile for building, after libmetal is built.