Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
arene::base::testing::filesystem Namespace Reference

Function Documentation

◆ create_temporary_directory()

auto arene::base::testing::filesystem::create_temporary_directory ( ) -> arene::base::filesystem::temporary_directory
inline

construct a temporary directory within the test runtime

Constructs a temporary directory with special handling when the test binary is invoked with Bazel.

When a test is run under Bazel, Bazel defines the environment variable TEST_TMPDIR. This is guaranteed by Bazel to be unique for each invocation of bazel test and the directory where tests should create files.

This function creates a temporary directory under a root path where:

  • the root path is TEST_TMPDIR if it is defined;
  • otherwise, the root path is TMPDIR if it is defined;
  • otherwise, the default root path used by temporary_directory
Returns
the created temporary_directory value