casaroli opened a new pull request, #4080:
URL: https://github.com/apache/nuttx-apps/pull/4080

   ## Summary
   
   `cmocka_fs_test` (`CONFIG_CM_FS_TEST`) does not build in a protected or a 
kernel build. The case `test_nuttx_fs_file_get01` calls `file_get()` and 
`file_put()` and reads `struct file`. These are kernel functions, not system 
calls, so a user program cannot use them.
   
   - Kernel build: `stdio.h` does not include `nuttx/fs/fs.h` for programs, so 
`fs_file_get_test.c` does not compile: "implicit declaration of function 
'file_get'", "implicit declaration of function 'file_put'", "invalid use of 
undefined type 'struct file'".
   - Protected build: the user blob does not link: "undefined reference to 
`file_get2'", "undefined reference to `file_put'".
   
   This PR builds the case and its entry in the test list only with 
`CONFIG_BUILD_FLAT`, as the suite already does with `CONFIG_ARCH_SIM` for other 
cases. The other 45 cases use only the POSIX interface and do not change.
   
   ## Impact
   
   Flat builds: no change, `test_nuttx_fs_file_get01` still runs. Protected and 
kernel builds: `cmocka_fs_test` builds and runs without this one case. The 
change is in the C sources only, so the Make and the CMake builds both get it.
   
   CI runs the fs cases one by one from apache/nuttx-ntfc-testing 
(`fs/fs/test_fs_integration.py`, which names `test_nuttx_fs_file_get01`). The 
configurations with `CONFIG_CM_FS_TEST` (`rv-virt:citest`, `sim:citest`) are 
flat builds, so the CI run does not change.
   
   ## Testing
   
   `CONFIG_TESTS_TESTSUITES`, `CONFIG_CM_FS_TEST`, 
`CONFIG_TESTS_TESTSUITES_MOUNT_DIR="/tmp"` (tmpfs), nuttx master e9eefaa0e9a:
   
   | Configuration | apps master 72937e7f8 | this PR |
   |---|---|---|
   | `qemu-armv8a:nsh` (flat, arm64, QEMU HVF) | 46 of 46 pass | 46 of 46 pass, 
`file_get01` included |
   | `qemu-armv8a:knsh` (kernel, arm64, QEMU HVF) | does not compile (errors 
above) | 45 of 45 pass |
   | `rv-virt:knsh64` (kernel, rv64) | does not compile (errors above) | builds 
|
   | `rv-virt:pnsh64` (protected, rv64) | does not link (errors above) | builds 
|
   
   On `qemu-armv8a:knsh` the run used `CONFIG_TLS_LOG2_MAXSTACK=14`, because 
the default stack of the suite (16384) is larger than the 8 KiB limit of that 
configuration and exec fails with `EINVAL`. The table uses the Make build. The 
CMake build of `qemu-armv8a:nsh` and `rv-virt:pnsh64` with this PR passes too. 
ostest passes on `qemu-armv8a:knsh` and `qemu-armv8a:nsh`.
   
   `tools/checkpatch.sh -c -u -m -g` passes.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to