Next: , Previous: , Up: testing files   [Contents][Index]


23.8.2 Files

Function: dotest-mkfile pathname
Function: dotest-mkfile pathname prefix

Create an empty file. The optional prefix is a relative pathname that is prepended to pathname: It is useful to prepend the name of a parent directory. Print to stdout the full pathname of the file.

Function: dotest-clean-files

Remove the temporary directory and all its children. Should be invoked at the end of each function that creates temporary files or directories.

Return the value of the last command executed before the invocation, that way it can be used right after dotest-output() and dotest-equal() without loosing the return value of the function.

Function: dotest-mkpathname pathname
Function: dotest-mkpathname pathname prefix

Compose a pathname under the temporary testing directory. The optional prefix is a relative pathname that is prepended to pathname: It is useful to prepend the name of a parent directory. Print to stdout the full pathname of the file.

This function invokes dotest-mktmpdir().

Testing conditions

Function: dotest-assert-file-exists file error_message

Test that file exists: If true returns with code zero; else print error_message, invoke dotest-clean-files() and return with code one.

Function: dotest-assert-file-unexists file error_message

Test that file does not exist: If true return with code zero; else print error_message, invoke dotest-clean-files() and return with code one.


Next: , Previous: , Up: testing files   [Contents][Index]

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