I’m trying to create a test directory in the setup_file() function and delete it in the teardown_file() function. However, the variable that contains the name of the directory created is empty in the teardown_file function. As I understand from the documentation variables declared in the setup_file are still available in the teardown_file function. I’m currently doing:
setup_file() {
declare -rx TEST_DIRECTORY_NAME="${0##*/}-${RANDOM}"
…
}
Is there something else I need to do or should I approach it differently?