[Pkg-privacy-commits] [pond] 01/03: enable client_test with the dummy gui

Ximin Luo infinity0 at debian.org
Tue Oct 6 10:55:46 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository pond.

commit 0ee5a1104b00c43b26f9374efd32ad89b19f975a
Author: Ximin Luo <infinity0 at debian.org>
Date:   Tue Oct 6 11:24:19 2015 +0200

    enable client_test with the dummy gui
---
 ...ble-some-tests.patch => disable-tpm-test.patch} | 10 +---
 debian/patches/fix-nogtk-gui.patch                 | 66 ++++++++++++++++++++++
 debian/patches/series                              |  3 +-
 debian/rules                                       |  6 +-
 4 files changed, 72 insertions(+), 13 deletions(-)

diff --git a/debian/patches/disable-some-tests.patch b/debian/patches/disable-tpm-test.patch
similarity index 61%
rename from debian/patches/disable-some-tests.patch
rename to debian/patches/disable-tpm-test.patch
index b0b7c84..083e30f 100644
--- a/debian/patches/disable-some-tests.patch
+++ b/debian/patches/disable-tpm-test.patch
@@ -1,16 +1,8 @@
-Description: Disable inappropriate tests
+Description: Disable TPM tests
 Author: Ximin Luo <infinity0 at debian.org>
 Forwarded: not-needed
 ---
 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---- a/client/client_test.go
-+++ b/client/client_test.go
-@@ -1,3 +1,5 @@
-+// +build !nogui
-+
- package main
- 
- import (
 --- a/client/tpm/tpm_test.go
 +++ b/client/tpm/tpm_test.go
 @@ -1,3 +1,5 @@
diff --git a/debian/patches/fix-nogtk-gui.patch b/debian/patches/fix-nogtk-gui.patch
new file mode 100644
index 0000000..c2f8ce0
--- /dev/null
+++ b/debian/patches/fix-nogtk-gui.patch
@@ -0,0 +1,66 @@
+Description: Fix client_test and gui+nogtk to set haveGUI = false
+ client_test runs with a dummy GUI but this should not be effective at runtime
+Author: Ximin Luo <infinity0 at debian.org>
+Bug: https://github.com/agl/pond/issues/204
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/client/client_test.go
++++ b/client/client_test.go
+@@ -44,6 +44,15 @@
+ 	stateDir string
+ }
+ 
++func GetServerBin() string {
++	gopath := os.Getenv("GOPATH")
++	if gopath != "" {
++		return gopath + "/bin/server"
++	} else {
++		return "../server/server"
++	}
++}
++
+ func NewTestServer(t *testing.T) (*TestServer, error) {
+ 	var err error
+ 	server := new(TestServer)
+@@ -66,7 +75,7 @@
+ 	serverLifeline := os.NewFile(uintptr(pipeFds[0]), "server lifeline fd")
+ 	defer serverLifeline.Close()
+ 
+-	server.cmd = exec.Command("../server/server",
++	server.cmd = exec.Command( GetServerBin(),
+ 		"--init",
+ 		"--base-directory", server.stateDir,
+ 		"--port", "0",
+--- a/client/gtk.go
++++ b/client/gtk.go
+@@ -14,6 +14,8 @@
+ 	"github.com/agl/go-gtk/gtkspell"
+ )
+ 
++const haveGUI = true
++
+ type GTKUI struct {
+ 	window      *gtk.GtkWindow
+ 	actions     chan interface{}
+--- a/client/gui.go
++++ b/client/gui.go
+@@ -21,8 +21,6 @@
+ 	"github.com/golang/protobuf/proto"
+ )
+ 
+-const haveGUI = true
+-
+ const (
+ 	colorDefault               = 0
+ 	colorWhite                 = 0xffffff
+--- a/client/nogtk.go
++++ b/client/nogtk.go
+@@ -2,6 +2,8 @@
+ 
+ package main
+ 
++const haveGUI = false
++
+ type GTKUI struct{}
+ 
+ func NewGTKUI() *GTKUI { return &GTKUI{} }
diff --git a/debian/patches/series b/debian/patches/series
index 0242313..64cf9d1 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
-disable-some-tests.patch
+disable-tpm-test.patch
+fix-nogtk-gui.patch
diff --git a/debian/rules b/debian/rules
index 24bff98..daa4805 100755
--- a/debian/rules
+++ b/debian/rules
@@ -21,20 +21,20 @@ include /usr/share/dpkg/default.mk
 
 DH_BUILDDIR = obj-$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DH_INSTALLDIR = debian/pond
-GOFLAGS = -tags 'nogui'
+GOFLAGS = -tags 'nogtk'
 # have to disable GTK because of https://github.com/agl/pond/issues/143
 
 POND_BIN_RENAME = client server editstate
 
 export DH_GOPKG := github.com/agl/pond
 export DH_GOPKG_SUBDIRS := $(shell find . \
-  -path ./$(DH_BUILDDIR) -prune -o \
+  -path "./$(DH_BUILDDIR)" -prune -o \
   -path './.*' -prune -o \
   -type f -a -name '*_test.go' -print | \
   xargs -n1 dirname | sort -u | sed -e 's,^\./,,g' | \
   grep -v bn256cgo)
 # https://cryptojedi.org/crypto/#dclxvi not yet in Debian, so disable bn256cgo
-export DH_GOPKG_TESTDATA := editstate
+export DH_GOPKG_TESTDATA := client editstate
 
 %:
 	dh $@ --buildsystem=golang --with=golang

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/pond.git



More information about the Pkg-privacy-commits mailing list