test: fix recursive rm test to actually use tmpdir
Previously folders were created in the root of the project and would
therefore stay there in case of errors. This changes the test to create
all directories in the temp directory (tmpdir.path
).
Also a small refactor to contain the directory counter in one place.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines