MCPcopy Create free account
hub / github.com/crownengine/crown / ScopedUniqueWorkingDir

Method ScopedUniqueWorkingDir

src/core/unit_tests.cpp:1983–1999  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1981 char _workdir[1024];
1982
1983 ScopedUniqueWorkingDir()
1984 {
1985 TempAllocator256 ta;
1986 DynamicString tmpdir(ta);
1987 char buf[GUID_BUF_LEN];
1988
1989 os::getcwd(_workdir, sizeof(_workdir)); // Save current work dir.
1990
1991 // Create unique working dir.
1992 environment::tmp_dir(tmpdir);
1993 tmpdir += "/crown_unit_tests/";
1994 os::create_directory(tmpdir.c_str());
1995 tmpdir += guid::to_string(buf, sizeof(buf), guid::new_guid());
1996 os::create_directory(tmpdir.c_str());
1997
1998 os::setcwd(tmpdir.c_str());
1999 }
2000
2001 ~ScopedUniqueWorkingDir()
2002 {

Callers

nothing calls this directly

Calls 7

tmp_dirFunction · 0.85
create_directoryFunction · 0.85
new_guidFunction · 0.85
setcwdFunction · 0.85
getcwdFunction · 0.70
to_stringFunction · 0.70
c_strMethod · 0.45

Tested by

no test coverage detected