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 } diff --git a/internal/rosa/glslang.go b/internal/rosa/glslang.go index f05a1a62..a2600ea3 100644 --- a/internal/rosa/glslang.go +++ b/internal/rosa/glslang.go @@ -20,6 +20,9 @@ func (t Toolchain) newSPIRVHeaders() (pkg.Artifact, string) { Cache: []KV{ {"CMAKE_BUILD_TYPE", "Release"}, }, + + // upstream has no tests + SkipTest: true, }), version } func init() { @@ -110,7 +113,6 @@ func (t Toolchain) newGlslang() (pkg.Artifact, string) { {"BUILD_SHARED_LIBS", "ON"}, {"ALLOW_EXTERNAL_SPIRV_TOOLS", "ON"}, }, - Script: "ctest", }, Python, Bash, diff --git a/internal/rosa/zlib.go b/internal/rosa/zlib.go index ab1ae7ea..4f6591b0 100644 --- a/internal/rosa/zlib.go +++ b/internal/rosa/zlib.go @@ -16,7 +16,7 @@ func (t Toolchain) newZlib() (pkg.Artifact, string) { {"CMAKE_BUILD_TYPE", "Release"}, {"CMAKE_C_FLAGS", "-fPIC"}, - {"ZLIB_BUILD_TESTING", "OFF"}, + {"ZLIB_BUILD_TESTING", "ON"}, {"ZLIB_BUILD_SHARED", "ON"}, {"ZLIB_BUILD_STATIC", "ON"}, {"ZLIB_BUILD_MINIZIP", "OFF"}, diff --git a/internal/rosa/zstd.go b/internal/rosa/zstd.go index 0a3043df..52a74e35 100644 --- a/internal/rosa/zstd.go +++ b/internal/rosa/zstd.go @@ -13,12 +13,23 @@ func (t Toolchain) newZstd() (pkg.Artifact, string) { "zstd-"+version+".tar.gz", checksum, pkg.TarGzip, - ), nil, &CMakeHelper{ + ), &PackageAttr{ + // tests Makefile assumes writable source + Writable: true, + Chmod: true, + }, &CMakeHelper{ Append: []string{"build", "cmake"}, Cache: []KV{ {"CMAKE_BUILD_TYPE", "Release"}, }, - }), version + Test: ` +make -C /usr/src/zstd/tests datagen +ZSTD_BIN=/cure/programs/zstd /usr/src/zstd/tests/playTests.sh +`, + }, + Make, + Diffutils, + ), version } func init() { artifactsM[Zstd] = Metadata{