30.7.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.


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