dropbox / goebpf

Library to work with eBPF programs from Go
Other
1.14k stars 85 forks source link

Fix test executable name in itest/kprobe_test.go #69

Closed fuhry closed 2 years ago

fuhry commented 2 years ago

When newer go test runs, it writes the executable to a temporary path (under /tmp) under the name itest.test. However, if the same test executable is compiled and executed from the project directory the executable name has an underscore.

This PR updates the itest to accept both.

Signed-off-by: Dan Fuhry fuhry@dropbox.com

fuhry commented 2 years ago

As I understand it this one needs some work figuring out what's actually happening, because the file created both is and was itest_test, but the string in the test is itest.test.

I root caused this, and it's quite silly: go test writes the test executable to a file named <subpackage>.test, while compiling it with go test -c ... writes the executable to <subpackage>_test. I've added a source comment and updated the PR description to explain this.