This allows us to take advantage of the `testing` package. It also gives the resulting test binary common command line arguments (same as `go test`). Tests need to be compiled with `go test -c`, which injects a `Main()` that calls the Test* functions. This is not supported by the golang rpm macros. Thus, build this binary by calling `go test -c` directly, but taking care to pass the same linker flags as the `%gobuild` macro. Mark the test binary with the `integration` build constraint, so that `go test ./...` doesn't pick them up. That's only for unit tests. The idea is to move all other test binaries to this scheme as well. Spec file changes by Lars Karlitski <lars@karlitski.net> |
||
|---|---|---|
| .. | ||
| osbuild-composer | ||
| osbuild-dnf-json-tests | ||
| osbuild-image-tests | ||
| osbuild-pipeline | ||
| osbuild-rcm-tests | ||
| osbuild-tests | ||
| osbuild-upload-aws | ||
| osbuild-upload-azure | ||
| osbuild-weldr-tests | ||
| osbuild-worker | ||