This commit is contained in:
parent
7772fcdb16
commit
0780cdb04f
|
@ -0,0 +1 @@
|
||||||
|
This directory is used to unit-test.
|
|
@ -20,8 +20,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
var tempDir = "../"
|
var testDir = "../tmp"
|
||||||
var testDir = filepath.Join(tempDir, "wide-test")
|
|
||||||
var packageName = filepath.Join(testDir, "test_zip")
|
var packageName = filepath.Join(testDir, "test_zip")
|
||||||
|
|
||||||
func TestCreate(t *testing.T) {
|
func TestCreate(t *testing.T) {
|
||||||
|
@ -57,19 +56,15 @@ func TestUnzip(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestMain(m *testing.M) {
|
func TestMain(m *testing.M) {
|
||||||
err := os.Mkdir(testDir, 0644)
|
|
||||||
if err != nil {
|
|
||||||
logger.Error(err)
|
|
||||||
|
|
||||||
os.Exit(-1)
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.Info(testDir)
|
logger.Info(testDir)
|
||||||
|
|
||||||
retCode := m.Run()
|
retCode := m.Run()
|
||||||
|
|
||||||
// clean test data
|
// clean test data
|
||||||
os.RemoveAll(testDir)
|
os.RemoveAll(testDir + "/test_zip")
|
||||||
|
os.RemoveAll(testDir + "/util")
|
||||||
|
os.RemoveAll(testDir + "/file.go")
|
||||||
|
os.RemoveAll(testDir + "/test_zip.zip")
|
||||||
|
|
||||||
os.Exit(retCode)
|
os.Exit(retCode)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue