simplify testing

This commit is contained in:
v2ray committed 2016-05-24 21:55:46 +02:00
1 parent 3582b9d869
commit fc63f0432c
99 files changed
+726 -817

No files matched your search

+1 -2
View File
@@ -6,7 +6,6 @@ import (
"path/filepath"
"testing"
v2testing "github.com/v2ray/v2ray-core/testing"
"github.com/v2ray/v2ray-core/testing/assert"
)
@@ -32,7 +31,7 @@ func allFilesExists(files ...string) bool {
}
func TestBuildMacOS(t *testing.T) {
v2testing.Current(t)
assert := assert.On(t)
binPath = filepath.Join(os.Getenv("GOPATH"), "testing")
cleanBinPath()
+2 -3
View File
@@ -3,12 +3,11 @@ package main
import (
"testing"
v2testing "github.com/v2ray/v2ray-core/testing"
"github.com/v2ray/v2ray-core/testing/assert"
)
func TestParseOS(t *testing.T) {
v2testing.Current(t)
assert := assert.On(t)
assert.Pointer(parseOS("windows")).Equals(Windows)
assert.Pointer(parseOS("macos")).Equals(MacOS)
@@ -17,7 +16,7 @@ func TestParseOS(t *testing.T) {
}
func TestParseArch(t *testing.T) {
v2testing.Current(t)
assert := assert.On(t)
assert.Pointer(parseArch("x86")).Equals(X86)
assert.Pointer(parseArch("x64")).Equals(Amd64)
+2 -3
View File
@@ -10,12 +10,11 @@ import (
"testing"
"time"
v2testing "github.com/v2ray/v2ray-core/testing"
"github.com/v2ray/v2ray-core/testing/assert"
)
func TestBuildAndRun(t *testing.T) {
v2testing.Current(t)
assert := assert.On(t)
gopath := os.Getenv("GOPATH")
goOS := parseOS(runtime.GOOS)
@@ -42,7 +41,7 @@ func TestBuildAndRun(t *testing.T) {
errStr := string(errBuffer.Bytes())
assert.Bool(strings.Contains(outStr, "v1.0")).IsTrue()
assert.StringLiteral(errStr).Equals("")
assert.String(errStr).Equals("")
os.Remove(target)
}