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:
parent
93776cd69e
commit
cb1fb5dded
3 changed files with 22 additions and 7 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue