Skip to content

Commit

Permalink
Add WithCoveredCommands alias
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Koch <[email protected]>
  • Loading branch information
hugelgupf committed Feb 16, 2024
1 parent e3faa6a commit 3a0424a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions uimage/uimage.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,14 @@ func WithBinaryCommandsOpts(gbOpts *golang.BuildOpts, cmd ...string) Modifier {
return WithCommands(gbOpts, builder.Binary, cmd...)
}

// WithCoveredCommands adds Go commands to compile as individual binaries with
// -cover and -covermode=atomic for integration test coverage.
//
// Allowed formats for cmd are documented in [WithCommands].
func WithCoveredCommands(cmd ...string) Modifier {
return WithCommands(&golang.BuildOpts{ExtraArgs: []string{"-cover", "covermode=atomic"}}, builder.Binary, cmd...)

Check warning on line 394 in uimage/uimage.go

View check run for this annotation

Codecov / codecov/patch

uimage/uimage.go#L393-L394

Added lines #L393 - L394 were not covered by tests
}

// WithOutput sets the archive output file.
func WithOutput(w initramfs.WriteOpener) Modifier {
return func(o *Opts) error {
Expand Down

0 comments on commit 3a0424a

Please sign in to comment.