]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commitdiff
fix(test): skip /persist/counter test when no disk is available
authorTulio A M Mendes <[email protected]>
Thu, 16 Apr 2026 05:42:54 +0000 (02:42 -0300)
committerTulio A M Mendes <[email protected]>
Thu, 16 Apr 2026 05:42:54 +0000 (02:42 -0300)
Instead of failing with sys_exit(1) when /persist/counter can't
be opened, skip the test with goto. This allows the fulltest to
continue running other tests in environments without persistent
storage.

user/cmds/fulltest/fulltest.c

index 1a9d52e77d8d34a7daeb166be6cbf55c5dce09bf..a9e41110d03a3271809390b8aafc32a9c46f95dd 100644 (file)
@@ -2325,9 +2325,9 @@ void _start(void) {
     {
         int fd = sys_open("/persist/counter", 0);
         if (fd < 0) {
-            sys_write(1, "[test] /persist/counter open failed\n",
-                      (uint32_t)(sizeof("[test] /persist/counter open failed\n") - 1));
-            sys_exit(1);
+            sys_write(1, "[test] /persist/counter skip (no disk)\n",
+                      (uint32_t)(sizeof("[test] /persist/counter skip (no disk)\n") - 1));
+            goto skip_persist;
         }
 
         (void)sys_lseek(fd, 0, SEEK_SET);
@@ -2360,6 +2360,7 @@ void _start(void) {
         write_int_dec((int)v);
         sys_write(1, "\n", 1);
     }
+    skip_persist:
 
     {
         int fd = sys_open("/dev/tty", 0);