category-group: quickdirt
layer(s): 0, 1, 2

header file(s): z_menuloop.h

classes in this group: rundriver_o, testdriver_o, menuloop_o, progconf_o

function groups: layer 00 functions group

description.
Various "quick & dirty" components are here. What would a program be without some quick & dirty solution? This group is similar to "etc" in that it is an agglomoration of different items, but most of the focus is on getting input from the user, for command-line driven solutions.

The "driver" series (rundriver, testdriver) presents a menu of choices for the user, gets input via command-line, and runs the task corresponding to the menu selection. The "test" version differs by being oriented for 'test' programs, whereas rundriver is for actual (final, completed) programs.

Layer 0 subroutines consist of a singleton function: z_quick_popup_message(). This function displays a windows-based popup message, and whether it works is highly dependent on the operating system.

Vettrasoft-standard command-line parameters:

argument variable notes
-h | -? | /?   help (short form)
-help   help (long - more detail)
-V, -version   show version info
-e, -validate, -validation   run validation test(s). This is a self-test / unit-test, which outputs a terse, 1-line result message to the console (Microsoft: "command") window. This message announces whether the test passed, failed, or could not be done. . There are various reasons why a test might not be able to be performed. This is discussed below.
-kbd | -stdin   allow console input
-vol | -volume [n] set volume level (n in [0..100])
-database | -db [name] set database name
-server [name] set database server
-host [name] set database host name
testdriver_o class command-line arguments
-i, -interactive   run in 'interactive' mode
-batch, -auto   run in 'batch' mode

"Volume" is intended to be used for debugging programs. The Z Directory standard is to use an integer number from 0 to 100. A higher number automatically includes any messges set at lower numbers. So, if volume is set at 70, messages at volume level 10, 20, or 50 will be displayed. Here are some guidelines for setting level control:
05 - show panics, program failures
10 -show errors only
20 - very light messaging: errors, and top-level program events
30 - show errors and severe warning messages
40 - show all warnings
50 - show errors, warnings, and other messages
60 - more messages
70 - heavy message tracing. Show 1 data within outer loops, terse format
80 - very deep message tracing. All data in nested loops is dumped.
90 - show massive dumps of all message types. For heavy-duty debugging.
100 - show absolutely everything. This is targeted for serious debugging or emergency repairs.

For doing validation of functionality of components (functions and classes - intended to be performed by the testdriver class ), the protocol for testing each component is to run a program that automatically performs various tests of the unit. The exit code of the program determines the overall [pass/fail] result. The values of these exit codes are:

value meaning description
0 test passed all features of the component that were tested passed.
1 test failed at least 1 test of the component failed.
2 validation has not been implemented Vettrasoft programmers have not yet got around to writing code to test the object.
3 validation cannot be implemented no automatic testing is available for the component. This is typically because there is no way to programmatically check the correctness of an operation. For example, with the 'barecomputer' or 'baredisk' class, there is no way to automatically check if the name of the computer is correct, or that the amount of memory or disk space is correct. The user may be able to confirm these things, but these tests must be able to run fully automated.
4 a configuration problem exists Something prevents the test from running. This often applies to database-type tests; perhaps the database is down, or has not been installed.
5 dry mode Actual validation is not performed if the program is in "dry mode".
Note that the values above are program exit codes, not return values from the validate() function of a testdriver object.

bugs.
z_quick_popup_message() is currently only available on Microsoft-type operating systems.