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

   
   ## Summary
   
   Support running `ostest` when `CONFIG_DISABLE_ALL_SIGNALS` is enabled.       
   
                                                                                
   
   The normal `ostest` entry path starts `user_main` as a separate task and,    
   
   when result collection is enabled, waits for it with `waitpid()`. That path  
   
   depends on `SIGCHLD`, so it is not available in configurations that remove 
all  
   signal support.                                                              
   
                                                                                
   
   This change adds a synchronous execution path for non-kernel builds when     
   
   `CONFIG_DISABLE_ALL_SIGNALS` is enabled. In that case, `ostest_main` calls   
   
   `user_main()` directly and uses the return value as the test result. This 
keeps 
   the existing test coverage available without relying on `task_create()` plus 
   
   `waitpid()`/`SIGCHLD`.                                                       
   
                                                                                
   
   It also allows `CONFIG_TESTING_OSTEST_POWEROFF` when                         
   
   `CONFIG_DISABLE_ALL_SIGNALS` is enabled. The no-signal synchronous path 
already 
   has the `user_main()` result directly, so simulator poweroff can still 
propagate
   the test status without requiring `CONFIG_TESTING_OSTEST_WAITRESULT`.        
   
                                                                                
   
   ## Why this is needed                                                        
   
                                                                                
   
   `CONFIG_DISABLE_ALL_SIGNALS` intentionally removes signal-related behavior,  
   
   including `SIGCHLD`-based child status notification. Without this change,    
   
   `ostest` cannot be used as a validation workload for no-signal 
configurations   
   because its default execution model assumes async task startup and 
signal-based 
   result collection.                                                           
   
                                                                                
   
   ## Testing                                                                   
   
                                                                                
   
   Tested with a local simulator configuration using 
`CONFIG_DISABLE_ALL_SIGNALS`  
   and NSH as the init entry point.                                             
   
                                                                                
   
   Build:                                                                       
   
                                                                                
   
   ```sh                                                                        
   
   make distclean                                                               
   
   ./tools/configure.sh -l sim:nsh                                     
   make -j$(nproc)                                                              
   
   
   
   ## Impact
   
   *Update this section, where applicable, on how change affects users,
    build process, hardware, documentation, security, compatibility, etc.*
   
   ## Testing
   
   *Update this section with details on how did you verify the change,
    what Host was used for build (OS, CPU, compiler, ..), what Target was
    used for verification (arch, board:config, ..), etc. Providing build
    and runtime logs from before and after change is highly appreciated.*
   
   
   


-- 
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