Skip to content

Commit

Permalink
selftests/nolibc: skip tests for unimplemented syscalls
Browse files Browse the repository at this point in the history
The riscv32 architecture is missing many of the older syscalls.
Instead of providing wrappers for everything at once, introducing a lot
of complexity, skip the tests for those syscalls for now.

Link: https://lore.kernel.org/r/20241221-nolibc-rv32-v1-4-d9ef6dab7c63@weissschuh.net
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
  • Loading branch information
Thomas Weißschuh committed Jan 13, 2025
1 parent 4c7f09a commit 349afc8
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tools/testing/selftests/nolibc/nolibc-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,10 @@ int expect_syszr(int expr, int llen)
{
int ret = 0;

if (expr) {
if (errno == ENOSYS) {
llen += printf(" = ENOSYS");
result(llen, SKIPPED);
} else if (expr) {
ret = 1;
llen += printf(" = %d %s ", expr, errorname(errno));
result(llen, FAIL);
Expand Down Expand Up @@ -342,7 +345,10 @@ int expect_sysne(int expr, int llen, int val)
{
int ret = 0;

if (expr == val) {
if (errno == ENOSYS) {
llen += printf(" = ENOSYS");
result(llen, SKIPPED);
} else if (expr == val) {
ret = 1;
llen += printf(" = %d %s ", expr, errorname(errno));
result(llen, FAIL);
Expand All @@ -367,7 +373,9 @@ int expect_syserr2(int expr, int expret, int experr1, int experr2, int llen)
int _errno = errno;

llen += printf(" = %d %s ", expr, errorname(_errno));
if (expr != expret || (_errno != experr1 && _errno != experr2)) {
if (errno == ENOSYS) {
result(llen, SKIPPED);
} else if (expr != expret || (_errno != experr1 && _errno != experr2)) {
ret = 1;
if (experr2 == 0)
llen += printf(" != (%d %s) ", expret, errorname(experr1));
Expand Down

0 comments on commit 349afc8

Please sign in to comment.