Next: , Up: program   [Contents][Index]


11.1 Testing a script and running programs

MBFL allows a script to execute a “dry run”, that is: do not perform any operation on the system, just print messages describing what will happen if the script is executed with the selected options. This implies, in the MBFL model, that no external program is executed.

When this feature is turned on: mbfl_program_exec() does not execute the program, instead it prints the command line on standard error and it returns true.

Function: mbfl_set_option_test

Enable the script test option. After this: a script must not mutate the system in any way, it should just print messages describing the operations.

However, the script is allowed to acquire informations from the system; for example it can acquire the list of files in a directory or load the contents of a file.

This function is invoked when the predefined option --test is used on the command line.

Function: mbfl_unset_option_test

Disable the script test option. After this a script must perform normal operations.

Function: mbfl_option_test

Return true if test execution is enabled, else return false.


Next: , Up: program   [Contents][Index]

This document describes version 3.0.0-devel.0 of Marcos Bash Functions Library.