How to run the recipe Go tests on Yocto


Javier Tia
 

Hi,

Is there a way to run the recipe Go tests in Yocto?

I have tried several ways (1. Manually and 2. ptest) with unsuccess.

1. Manually exporting all the toolchain variables:

GOARCH="${BUILD_GOARCH}"
CGO_ENABLED="1"
CFLAGS="${BUILD_CFLAGS}"
LDFLAGS="${BUILD_LDFLAGS}"
CGO_CFLAGS="${BUILD_CFLAGS}"
CGO_LDFLAGS="${BUILD_LDFLAGS}"
CC="${BUILD_CC}"
LD="${BUILD_LD}"

and run it with the Go test native version.


2. Using ptest, and adding to the Go recipe:

do_compile_ptest() {
${GO} test -vet off $(go_list_package_tests)
}

In both cases the error messages are like this:

fork/exec .../recipe_name/1.0-r0/go-tmp/go-build7113/b338/util.test: no
such file or directory
FAIL util 0.000s

It's happening with Yocto Zeus (v3.0.4) and Go v1.4.17


Regards,

▷ Javier's 🖊

Join yocto@lists.yoctoproject.org to automatically receive all group messages.