1
0
Fork 0
mirror of https://github.com/vbatts/go-mtree.git synced 2025-06-29 20:58:29 +00:00

test: Allow using an environment variable to override the test dir

Some build systems may not permit writing to . during build, so allow
that path to be overridden with an environment variable.
This commit is contained in:
Matthew Garrett 2017-04-13 11:35:01 -07:00
parent 93776cd69e
commit cb1fb5dded
3 changed files with 22 additions and 7 deletions

View file

@ -10,7 +10,11 @@ import (
)
func TestXattr(t *testing.T) {
fh, err := ioutil.TempFile(".", "xattr.")
testDir, present := os.LookupEnv("MTREE_TESTDIR")
if present == false {
testDir = "."
}
fh, err := ioutil.TempFile(testDir, "xattr.")
if err != nil {
t.Fatal(err)
}