forked from rosa/hakurei
internal/rosa/cmake: run tests
This uses the standard CMake test target. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user