diff --git a/circle.yml b/circle.yml index de1672a4b..7a00efbcf 100644 --- a/circle.yml +++ b/circle.yml @@ -13,4 +13,4 @@ dependencies: test: override: - gopherjs test --short --minify github.com/gopherjs/gopherjs/tests github.com/gopherjs/gopherjs/tests/main github.com/gopherjs/gopherjs/js archive/tar archive/zip bufio bytes compress/bzip2 compress/flate compress/gzip compress/lzw compress/zlib container/heap container/list container/ring crypto/aes crypto/cipher crypto/des crypto/dsa crypto/ecdsa crypto/elliptic crypto/hmac crypto/md5 crypto/rand crypto/rc4 crypto/rsa crypto/sha1 crypto/sha256 crypto/sha512 crypto/subtle crypto/x509 database/sql database/sql/driver debug/dwarf debug/elf debug/gosym debug/macho debug/pe encoding/ascii85 encoding/asn1 encoding/base32 encoding/base64 encoding/binary encoding/csv encoding/gob encoding/hex encoding/json encoding/pem encoding/xml errors expvar flag fmt go/ast go/constant go/doc go/format go/parser go/printer go/scanner go/token hash/adler32 hash/crc32 hash/crc64 hash/fnv html html/template image image/color image/draw image/gif image/jpeg image/png index/suffixarray io io/ioutil math math/big math/cmplx math/rand mime mime/multipart mime/quotedprintable net/http/cookiejar net/http/fcgi net/mail net/rpc/jsonrpc net/textproto net/url path path/filepath reflect regexp regexp/syntax sort strconv strings sync sync/atomic testing/quick text/scanner text/tabwriter text/template text/template/parse time unicode unicode/utf16 unicode/utf8 - - go test -v -race ./... + - GOPHERJS_TEMPDIR=/tmp go test -v -race ./... diff --git a/tool.go b/tool.go index 821b2d47b..731b99ec1 100644 --- a/tool.go +++ b/tool.go @@ -31,6 +31,7 @@ import ( ) var currentDirectory string +var temporaryDirectory string func init() { var err error @@ -44,6 +45,10 @@ func init() { fmt.Fprintln(os.Stderr, err) os.Exit(1) } + temporaryDirectory = os.Getenv("GOPHERJS_TEMPDIR") + if temporaryDirectory == "" { + temporaryDirectory = currentDirectory + } } func main() { @@ -222,7 +227,7 @@ func main() { return fmt.Errorf("gopherjs run: no go files listed") } - tempfile, err := ioutil.TempFile("", filepath.Base(args[0])+".") + tempfile, err := ioutil.TempFile(temporaryDirectory, filepath.Base(args[0])+".") if err != nil { return err } @@ -356,7 +361,7 @@ func main() { return err } - tempfile, err := ioutil.TempFile("", "test.") + tempfile, err := ioutil.TempFile(temporaryDirectory, "test.") if err != nil { return err }