1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// src/test_support.rs
//
// Tests that touch process-global state -- the session's open project, the
// debug/hot-reload statics, and the engine's development flags -- must not run
// concurrently, because Cargo runs a binary's tests in parallel threads within
// one process.
//
// The guard is the workspace's one process-global lock, so a test here writing
// a development flag excludes the engine's own readers of that same flag
// rather than racing them under a second, private lock.
pub
// What every guard here sets up before taking the lock.
// Open a project away from the working directory, with the caches on a root of
// their own.
//
// The cache root persists, so a shader that has not changed is compiled once
// for the machine rather than once per test. The content and writable roots are
// a separate stable directory emptied once per process: the blobs, the editor's
// session store, the saves and the settings are state, not cache, and a run
// that inherited them would assert against what the last one left.
pub