Browse Source

Test case for macos building

V2Ray 10 years ago
parent
commit
602afca3e3
1 changed files with 23 additions and 0 deletions
  1. 23 0
      tools/build/build_test.go

+ 23 - 0
tools/build/build_test.go

@@ -0,0 +1,23 @@
+package main
+
+import (
+	"os"
+	"testing"
+
+	"github.com/v2ray/v2ray-core/testing/unit"
+)
+
+func TestBuildMacOS(t *testing.T) {
+	assert := unit.Assert(t)
+
+	targetFile := os.ExpandEnv("$GOPATH/bin/v2ray-macos.zip")
+	os.Remove(targetFile)
+
+	*targetOS = "macos"
+	*targetArch = "amd64"
+	*archive = true
+	main()
+
+	_, err := os.Stat(targetFile)
+	assert.Error(err).IsNil()
+}