diff options
Diffstat (limited to 'internal/rosa/cmake.go')
| -rw-r--r-- | internal/rosa/cmake.go | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/internal/rosa/cmake.go b/internal/rosa/cmake.go index 1226f5ae..802a0b30 100644 --- a/internal/rosa/cmake.go +++ b/internal/rosa/cmake.go @@ -127,6 +127,11 @@ type CMakeHelper struct { // Runs after install. Script string + // Replaces the default test command. + Test string + // Whether to skip running tests. + SkipTest bool + // Whether to generate Makefile instead. Make bool } @@ -170,8 +175,18 @@ func (attr *CMakeHelper) script(name string) string { } generate := "Ninja" + test := "ninja " + jobsFlagE + " test" if attr.Make { generate = "'Unix Makefiles'" + test = "make " + jobsFlagE + " test" + } + if attr.Test != "" { + test = attr.Test + } + + script := attr.Script + if !attr.SkipTest { + script += "\n" + test } return ` @@ -191,5 +206,5 @@ cmake -G ` + generate + ` \ '/usr/src/` + name + `/` + filepath.Join(attr.Append...) + `' cmake --build . --parallel=` + jobsE + ` cmake --install . --prefix=/work/system -` + attr.Script +` + script } |
