config.unsupported = True
inputs = os.path.join(os.path.dirname(__file__), 'Inputs', 'static_test_env')
-config.test_format.addCompileFlags(config, '-DLIBCXX_FILESYSTEM_STATIC_TEST_ROOT="{}"'.format(inputs))
+config.test_format.addCompileFlags(config, '-DLIBCXX_FILESYSTEM_STATIC_TEST_ROOT={}'.format(inputs))
dynamic_helper = os.path.join(config.test_source_root, 'support', 'filesystem_dynamic_test_helper.py')
assert os.path.isfile(dynamic_helper)
namespace StaticEnv {
+static const fs::path Root = TEST_STRINGIZE(LIBCXX_FILESYSTEM_STATIC_TEST_ROOT);
+
inline fs::path makePath(fs::path const& p) {
// env_path is expected not to contain symlinks.
- static const fs::path env_path = LIBCXX_FILESYSTEM_STATIC_TEST_ROOT;
+ fs::path const& env_path = Root;
return env_path / p;
}
-static const fs::path Root = LIBCXX_FILESYSTEM_STATIC_TEST_ROOT;
-
static const fs::path TestFileList[] = {
makePath("empty_file"),
makePath("non_empty_file"),
#pragma GCC diagnostic ignored "-Wvariadic-macros"
#endif
+#define TEST_STRINGIZE_IMPL(x) #x
+#define TEST_STRINGIZE(x) TEST_STRINGIZE_IMPL(x)
+
#define TEST_CONCAT1(X, Y) X##Y
#define TEST_CONCAT(X, Y) TEST_CONCAT1(X, Y)