setupTestEnv creates a unique test directory for parallel test execution
(t *testing.T)
| 35 | |
| 36 | // setupTestEnv creates a unique test directory for parallel test execution |
| 37 | func setupTestEnv(t *testing.T) (string, testutils.RunDnoteCmdOptions) { |
| 38 | testDir := t.TempDir() |
| 39 | opts := testutils.RunDnoteCmdOptions{ |
| 40 | Env: []string{ |
| 41 | fmt.Sprintf("XDG_CONFIG_HOME=%s", testDir), |
| 42 | fmt.Sprintf("XDG_DATA_HOME=%s", testDir), |
| 43 | fmt.Sprintf("XDG_CACHE_HOME=%s", testDir), |
| 44 | }, |
| 45 | } |
| 46 | return testDir, opts |
| 47 | } |
| 48 | |
| 49 | func TestMain(m *testing.M) { |
| 50 | if err := exec.Command("go", "build", "--tags", "fts5", "-o", binaryName).Run(); err != nil { |
no outgoing calls
no test coverage detected