(t *testing.T, workingDirPath string, testAppsToLink map[string]string)
| 202 | } |
| 203 | |
| 204 | func LinkTestApps(t *testing.T, workingDirPath string, testAppsToLink map[string]string) func() { |
| 205 | MakeDirectoryOrFail(t, workingDirPath) |
| 206 | |
| 207 | for appLinkName, etcAppDir := range testAppsToLink { |
| 208 | appPath := filepath.Join(ProjectRoot, "etc", etcAppDir) |
| 209 | linkPath := filepath.Join(homedir.MustExpand(workingDirPath), appLinkName) |
| 210 | |
| 211 | if err := os.Symlink(appPath, linkPath); err != nil { |
| 212 | assert.FailNow(t, err.Error()) |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | return func() { |
| 217 | RemoveDirectoryOrFail(t, workingDirPath) |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | func LinkAllTestApps(t *testing.T, workingDirPath string) func() { |
| 222 | testAppsToLink := map[string]string{ |
no test coverage detected