Main Site Contents Up Previous Next

Testing and Diagnosing Problems

Problems with packaged executables can be difficult to diagnose especially if the executable is packaged with gui flags or the problem happens within the Cava Packager loader before any of your code is run.

Cava Packager includes diagnostic options that can help to track down problems and inludes test options that can help maintain the quality of your running code by allowing test scripts to run against your packaged modules.


Diagnostics

From the Diagnostics and Tests node in the project tree, you can run your executables in a diagnostic mode. This will ensure that any output from your scripts appears in a visible terminal, whether or not gui flags are set.

You can also choose to see verbose output from the Cava Loader which will provide diagnostic information about your executable environment, paths and all modules loaded by your executable.

On Linux if you have created a Cava Linux Installer, you will see 'do-install' listed as one of your executables. You can run 'do-install' from this testing panel to run your packaged install scripts but without actually running your full install executable.

If you wish, you may also select options on the Project Build tab that will cause Cava Packager to include an additional executable - 'diagnostic' within your realease that can run your executables in diagnostic mode when they are distributed.

In a distributed release that includes a diagnostic executable, if you wished to run an executable named 'helloworld.exe' in diagnostic mode you would run from the command line:

diagnostic.exe helloworld.exe

You must give a resolvable path to the executable you wish to run. e.g. the following will all work

C:\MyProg\bin\diagnostic.exe C:\MyProg\bin\helloworld.exe
..\..\bin\diagnostic.exe ..\..\bin\helloworld.exe
diagnostic.exe helloworld.exe

but the following will not:

..\..\bin\diagnostic.exe helloworld.exe

If you selected 'Allow loader verbose output in release executables' as a build option, then verbose Cava Loader information will also be output in diagnostic mode.


Including and Running Tests

Cava Packager allows you to create test scripts in the standard way and run these against your packaged modules.

From the Diagnostics and Tests node in the project tree, you can define a test folder.

Cava Packager will scan and include all scripts in the top level of this folder that end with the extension '.t'. The folder itself will also be added to the list of locations scanned for modules so that any test modules you create will be included. Unless you have selected to package tests with your release in the Project Node, the tests scripts and all modules required by those scripts alone will not be included in your release project.

Scripts and modules included solely for tests are listed after a scan in the Test Folder (@INC) node of the project tree.

Cava Packager runs all tests by passing a sorted list of the test scripts to:

Test::Harness::runtests(@testlist);

If you wish, you may also select to package a test executable on the Project Build tab that will cause Cava Packager to include an additional test executable - 'runtest' within your realease that can run your tests when your project is distributed.

If you have selected this option, then all your test code is, of course, packaged with your release distribution.

In a distributed release that includes a test executable to run tests from the command line, simply do:

runtest.exe





Contents Up Previous Next


Cava Packager Copyright © 2006-2012 Mark Dootson