From ae57d1fb3596330c17bb21ef30681a1b51ecfaec Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 18 Sep 2023 22:00:33 -0700 Subject: [PATCH] Updated AppDebug (markdown) --- AppDebug.md | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/AppDebug.md b/AppDebug.md index c28d95f..45a63a3 100644 --- a/AppDebug.md +++ b/AppDebug.md @@ -1,5 +1,6 @@ -# Application debugging -In debugging a BOINC application, +# Application testing and debugging + +In developing a BOINC application, you need to make sure that it interfaces properly with the BOINC client. You can do this in stages, as follows: @@ -29,7 +30,7 @@ To do this: * Run your app. * To suspend your app, write "\" to msgs.txt. You need to do this atomically, e.g. write "\" to another file, - then copy that file to msgs.txt. + then rename that file to msgs.txt. "cat > msgs.txt" doesn't work. * Similar for \ and \. Verify that they all work. @@ -38,7 +39,21 @@ To do this: Once your application works in standalone mode, you can test it under the BOINC client, but without a project server. -This will exercise the various forms of interaction with the client. +This will exercise the interaction with the client. + +### Simple way (no XML files) + +* Put a copy of the BOINC client and your application in a directory. +* Create a subdirectory ```slots/app_test```. Put your app's input files there (logical names). +* Run ```boinc --app_test foo``` where ```foo``` is the application filename. +* The client will run your application. + When it's done, the output files (and stderr.txt) will be in ```slots/app_test```. + +Note: if you want, the directory can be a BOINC data directory. +In that case your application will coexist with existing jobs +(it might not run right away). + +### Less simple way This example assumes that your executable name is **test.exe**, and that it has an input file with logical name **in** and physical name **input.txt**, @@ -82,6 +97,8 @@ When the job is done, check **projects/test.test/output.txt** to verify that it worked. Your app's stderr output will be somewhere in client_state.xml. +### Running under a debugger + If your app isn't working, there are two ways to debug it. First, if you put ```xml