Move testing utils to its own package
So as not to pollute command-line flags with test.* options. It appears that importing "testing" (from stdlib) will add flags. To avoid this, we need code to not depend on testing. But, since testing_utils was previously in the same package as the rest of the code, it dragged testing in. Renaming testing_util.go to e.g., util_for_test.go might be enough to avoid it being compiled with the regular code. We may want it to be available to tests for other packages -- after all it is utilities for testing -- so it goes in its own package.
This commit is contained in:
1 parent
f70dfe9de8
commit
97bece2d7b
6 files changed
+6
-6
No files matched your search
@@ -21,7 +21,7 @@ all: $(WEAVER_EXPORT) $(WEAVEDNS_EXPORT) $(WEAVETOOLS_EXPORT)
|
|||||||
update:
|
update:
|
||||||
go get -u -f -v -tags -netgo ./$(dir $(WEAVER_EXE)) ./$(dir $(WEAVEDNS_EXE))
|
go get -u -f -v -tags -netgo ./$(dir $(WEAVER_EXE)) ./$(dir $(WEAVEDNS_EXE))
|
||||||
|
|
||||||
$(WEAVER_EXE) $(WEAVEDNS_EXE):
|
$(WEAVER_EXE) $(WEAVEDNS_EXE): common/*.go
|
||||||
go get -tags netgo ./$(@D)
|
go get -tags netgo ./$(@D)
|
||||||
go build -ldflags "-extldflags \"-static\" -X main.version $(WEAVE_VERSION)" -tags netgo -o $@ ./$(shell dirname $@)
|
go build -ldflags "-extldflags \"-static\" -X main.version $(WEAVE_VERSION)" -tags netgo -o $@ ./$(shell dirname $@)
|
||||||
@strings $@ | grep cgo_stub\\\.go >/dev/null || { \
|
@strings $@ | grep cgo_stub\\\.go >/dev/null || { \
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package nameserver
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
wt "github.com/zettio/weave/common"
|
wt "github.com/zettio/weave/testing"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package nameserver
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/miekg/dns"
|
"github.com/miekg/dns"
|
||||||
wt "github.com/zettio/weave/common"
|
wt "github.com/zettio/weave/testing"
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
"testing"
|
"testing"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package nameserver
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/miekg/dns"
|
"github.com/miekg/dns"
|
||||||
wt "github.com/zettio/weave/common"
|
wt "github.com/zettio/weave/testing"
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
"testing"
|
"testing"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package nameserver
|
package nameserver
|
||||||
|
|
||||||
import (
|
import (
|
||||||
wt "github.com/zettio/weave/common"
|
wt "github.com/zettio/weave/testing"
|
||||||
"net"
|
"net"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package common
|
package testing
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
Reference in new issue
Block a user