Thanks, Stephen it works. Now, I'm gettng the "executable file not found in $PATH" error, despite that I'm having the following line in rules:
export PATH := $(CURDIR)/$(BUILD_DIR)/bin:$(PATH) What's wrong? Here are details: - - - - - - - - - - - - - - - -- - - - - - - -- - - - - - - -- - - - - dh_auto_test -O--buildsystem=golang cd obj-x86_64-linux-gnu && go test -vet=off -v -p 2 github.com/go-easygen/easygen github.com/go-easygen/easygen/cmd/easygen github.com/go-easygen/easygen/egCal github.com/go-easygen/easygen/egVar === RUN TestStringManipulation --- PASS: TestStringManipulation (0.00s) === RUN ExampleProcess0_list0StrTemplate --- PASS: ExampleProcess0_list0StrTemplate (0.00s) . . . PASS ok github.com/go-easygen/easygen 0.006s === RUN TestExec --- FAIL: TestExec (0.05s) main_test.go:27: Testing list0: easygen list0 main_test.go:39: start error [list0: [list0]] exec: "easygen": executable file not found in $PATH. main_test.go:43: exit error [list0: [list0]] exec: not started. main_test.go:55: cmp error exit status 1 [list0: [list0]] - - - - - - - - - - - - - - - -- - - - - - - -- - - - - - - -- - - - - The `easygen` is my newly built executable: $ ls obj-x86_64-linux-gnu/bin/easygen obj-x86_64-linux-gnu/bin/easygen and looks to me it is under $(CURDIR)/$(BUILD_DIR)/bin just fine. Note that, `TestExec` is from github.com/go-easygen/easygen/cmd/easygen/main_test.go Is there anything special about it? What else should I do? Here is my debian/rules file BTW: - - - - - - - - - - - - - - - -- - - - - - - -- - - - - - - -- - - - - #!/usr/bin/make -f BINPKG := easygen LIBPKG := golang-github-go-easygen-easygen-dev export DH_GOLANG_INSTALL_EXTRA := test export PATH := $(CURDIR)/$(BUILD_DIR)/bin:$(PATH) override_dh_auto_install: dh_auto_install # -- --no-source dh_install -p$(BINPKG) usr/bin/easygen dh_install -p$(LIBPKG) usr/share/gocode %: dh $@ --buildsystem=golang --with=golang - - - - - - - - - - - - - - - -- - - - - - - -- - - - - - - -- - - - - thx! On Mon, Mar 18, 2019 at 11:32 PM Stephen Gelman wrote: > > You want DH_GOLANG_INSTALL_EXTRA. See > https://salsa.debian.org/go-team/packages/git-lfs/blob/master/debian/rules#L8 > for an example. > > Stephen > > On Mon, Mar 18, 2019 at 9:55 PM Tong Sun wrote: > > > > Hi, > > > > My Go code builds fine under travis-ci > > > > However, when I'm building it (with gbp buildpackage) within my > > packaging process, `dh_auto_test` failed, and I think it's because > > `dh_auto_test` change dir from my default code place first: