Add check() to sp recipe (#40005)

This commit is contained in:
Alex Richert 2023-09-13 18:14:07 -04:00 committed by GitHub
parent a25a910ba0
commit a0622a2ee0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,7 +15,7 @@ class Sp(CMakePackage):
url = "https://github.com/NOAA-EMC/NCEPLIBS-sp/archive/refs/tags/v2.3.3.tar.gz"
git = "https://github.com/NOAA-EMC/NCEPLIBS-sp"
maintainers("t-brown", "AlexanderRichert-NOAA", "edwardhartnett", "Hang-Lei-NOAA")
maintainers("AlexanderRichert-NOAA", "edwardhartnett", "Hang-Lei-NOAA")
version("develop", branch="develop")
version("2.4.0", sha256="dbb4280e622d2683b68a28f8e3837744adf9bbbb1e7940856e8f4597f481c708")
@ -26,8 +26,8 @@ class Sp(CMakePackage):
variant("pic", default=False, description="Enable position-independent code (PIC)")
variant(
"precision",
default=["4", "d"],
values=["4", "d", "8"],
default=("4", "d"),
values=("4", "d", "8"),
multi=True,
description="Library versions: 4=4-byte reals, d=8-byte reals, 8=8-byte ints and reals",
when="@2.4:",
@ -37,7 +37,7 @@ def setup_run_environment(self, env):
if self.spec.satisfies("@2.4:"):
suffixes = self.spec.variants["precision"].value
else:
suffixes = ["4", "d", "8"]
suffixes = ("4", "d", "8")
for suffix in suffixes:
lib = find_libraries(
@ -58,4 +58,10 @@ def cmake_args(self):
args.append(self.define("BUILD_D", self.spec.satisfies("precision=d")))
args.append(self.define("BUILD_8", self.spec.satisfies("precision=8")))
args.append(self.define("BUILD_DEPRECATED", False))
if self.spec.satisfies("@2.4:"):
args.append(self.define("BUILD_TESTING", self.run_tests))
return args
def check(self):
with working_dir(self.builder.build_directory):
make("test")