function get program path
- get_program_path <program_name> [<extra_dirs>]
So the overall search order is:
- alternate directories (if specified)
- PATH directories
If the program is not found, then a default path is returned, of $BOARD_TESTDIR/fuego.$TESTDIR/<program_name>
This function sets an environment variable with with the path to the program, which can be used to execute it. The variable name is the program name, in upper case, prefixed with the string 'PROGRAM_'.
For example, if the following call were made:
and 'ls' was found on the target board in the PATH (specifically, at /bin/ls), then get_program_path would return with the shell environment variable PROGRAM_LS with the value '/bin/ls'.
If the program is not found, then a path is returned that would execute the program if it were located in the test's directory on the target board.
The purpose of this function is to allow tests to use previously installed test programs on the target board. Some labs install test programs prior to running Fuego tests, and skip the 'deploy' phase when running each test. This function allows tests to run more easily in those labs.
If found, the environment variable PROGRAM_CYCLICTEST will be set, with the path on the target board where 'cyclictest' is found.
Search with an alternate directory:
In this example, search directories in the following order:
- directories on the board's PATH
If found, the environment variable PROGRAM_RUNLTP will be set, with the path on the target board where 'runltp' is found.
- $1 - the filename of the program to get the path for
- $2 - (optional) a colon-separated list of additional directories to check
PROGRAM_<prog_name> is set to the path on the target board where the program should be expected. Note that when the program is not found, the default value of '$BOARD_TESTDIR/fuego.$TESTDIR/<program>' is returned. Thus, just because the program returns with the PROGRAM_* variable set, the program has not been verified to be present at the indicated path. In that case, the report or report_append function will report an error.