mirror of
https://github.com/restic/restic.git
synced 2026-06-17 14:14:19 +00:00
test: remove unused exports
This commit is contained in:
@@ -164,10 +164,10 @@ func isFile(fi os.FileInfo) bool {
|
||||
return fi.Mode()&(os.ModeType|os.ModeCharDevice) == 0
|
||||
}
|
||||
|
||||
// ResetReadOnly recursively resets the read-only flag recursively for dir.
|
||||
// resetReadOnly recursively resets the read-only flag recursively for dir.
|
||||
// This is mainly used for tests on Windows, which is unable to delete a file
|
||||
// set read-only.
|
||||
func ResetReadOnly(t testing.TB, dir string) {
|
||||
func resetReadOnly(t testing.TB, dir string) {
|
||||
t.Helper()
|
||||
err := filepath.Walk(dir, func(path string, fi os.FileInfo, err error) error {
|
||||
if fi == nil {
|
||||
@@ -194,7 +194,7 @@ func ResetReadOnly(t testing.TB, dir string) {
|
||||
// afterwards uses os.RemoveAll() to remove the path.
|
||||
func RemoveAll(t testing.TB, path string) {
|
||||
t.Helper()
|
||||
ResetReadOnly(t, path)
|
||||
resetReadOnly(t, path)
|
||||
err := os.RemoveAll(path)
|
||||
if errors.Is(err, os.ErrNotExist) {
|
||||
err = nil
|
||||
|
||||
@@ -14,11 +14,8 @@ var (
|
||||
RunIntegrationTest = getBoolVar("RESTIC_TEST_INTEGRATION", true)
|
||||
RunFuseTest = getBoolVar("RESTIC_TEST_FUSE", true)
|
||||
TestSFTPPath = getStringVar("RESTIC_TEST_SFTPPATH", "/usr/lib/ssh:/usr/lib/openssh:/usr/libexec")
|
||||
TestWalkerPath = getStringVar("RESTIC_TEST_PATH", ".")
|
||||
BenchArchiveDirectory = getStringVar("RESTIC_BENCH_DIR", ".")
|
||||
TestS3Server = getStringVar("RESTIC_TEST_S3_SERVER", "")
|
||||
TestRESTServer = getStringVar("RESTIC_TEST_REST_SERVER", "")
|
||||
TestIntegrationDisallowSkip = getStringVar("RESTIC_TEST_DISALLOW_SKIP", "")
|
||||
testIntegrationDisallowSkip = getStringVar("RESTIC_TEST_DISALLOW_SKIP", "")
|
||||
)
|
||||
|
||||
func getStringVar(name, defaultValue string) string {
|
||||
@@ -49,7 +46,7 @@ func getBoolVar(name string, defaultValue bool) bool {
|
||||
// names that must be run. If name is in this list, the test is marked as
|
||||
// failed.
|
||||
func SkipDisallowed(t testing.TB, name string) {
|
||||
for _, s := range strings.Split(TestIntegrationDisallowSkip, ",") {
|
||||
for _, s := range strings.Split(testIntegrationDisallowSkip, ",") {
|
||||
if s == name {
|
||||
t.Fatalf("test %v is in list of tests that need to run ($RESTIC_TEST_DISALLOW_SKIP)", name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user