povray: new test API (#45174)

* povray: new test API
* capture output and test name change
* povray: add v3.7.0.10, deprecate 3.7.0.8

---------

Co-authored-by: Tamara Dahlgren <dahlgren1@llnl.gov>
This commit is contained in:
AcriusWinter 2024-07-25 17:51:34 -07:00 committed by GitHub
parent f371b6f06c
commit 564155fd1a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -23,16 +23,19 @@ class Povray(AutotoolsPackage):
realistic reflections, shading, perspective and other effects.
"""
# Add a proper url for your package's homepage here.
homepage = "http://povray.org/download/"
url = "https://github.com/POV-Ray/povray/archive/v3.7.0.8.tar.gz"
git = "https://github.com/POV-Ray/povray.git"
# maintainers('payerle' )
license("AGPL-3.0-or-later")
version("3.7.0.8", sha256="53d11ebd2972fc452af168a00eb83aefb61387662c10784e81b63e44aa575de4")
version("3.7.0.10", sha256="7bee83d9296b98b7956eb94210cf30aa5c1bbeada8ef6b93bb52228bbc83abff")
# The following version no longer builds
version(
"3.7.0.8",
sha256="53d11ebd2972fc452af168a00eb83aefb61387662c10784e81b63e44aa575de4",
deprecated=True,
)
depends_on("c", type="build") # generated
depends_on("cxx", type="build") # generated
@ -105,8 +108,8 @@ def configure_args(self):
# We generate a generic using process owner and fqdn of build host.
fqdn = socket.getfqdn()
uname = getpass.getuser()
compiled_by = "Installed by spack <{0}@{1}>".format(uname, fqdn)
extra_args.append("COMPILED_BY={0}".format(compiled_by))
compiled_by = f"Installed by spack <{uname}@{fqdn}>"
extra_args.append(f"COMPILED_BY={compiled_by}")
extra_args.append("--disable-silent-rules") # Verbose make output
extra_args += self.enable_or_disable("debug")
@ -115,32 +118,32 @@ def configure_args(self):
extra_args += self.enable_or_disable("static")
if "+boost" in self.spec:
extra_args.append("--with-boost={0}".format(self.spec["boost"].prefix))
extra_args.append(f"--with-boost={self.spec['boost'].prefix}")
else:
extra_args.append("--without-boost")
if "+jpeg" in self.spec:
extra_args.append("--with-libjpeg={0}".format(self.spec["jpeg"].prefix))
extra_args.append(f"--with-libjpeg={self.spec['jpeg'].prefix}")
else:
extra_args.append("--without-libjpeg")
if "+libpng" in self.spec:
extra_args.append("--with-libpng={0}".format(self.spec["libpng"].prefix))
extra_args.append(f"--with-libpng={self.spec['libpng'].prefix}")
else:
extra_args.append("--without-libpng")
if "+libtiff" in self.spec:
extra_args.append("--with-libtiff={0}".format(self.spec["libtiff"].prefix))
extra_args.append(f"--with-libtiff={self.spec['libtiff'].prefix}")
else:
extra_args.append("--without-libtiff")
if "+mkl" in self.spec:
extra_args.append("--with-libmkl={0}".format(self.spec["mkl"].prefix))
extra_args.append(f"--with-libmkl={self.spec['mkl'].prefix}")
else:
extra_args.append("--without-libmkl")
if "+openexr" in self.spec:
extra_args.append("--with-openexr={0}".format(self.spec["openexr"].prefix))
extra_args.append(f"--with-openexr={self.spec['openexr'].prefix}")
else:
extra_args.append("--without-openexr")
@ -151,12 +154,11 @@ def configure_args(self):
return extra_args
def test(self):
def test_render_sample(self):
"""Render sample file"""
povs = find(self.prefix.share, "biscuit.pov")[0]
copy(povs, ".")
self.run_test(
"povray",
options=["biscuit.pov"],
purpose="test: render sample file",
expected=["POV-Ray finished"],
)
exe = which("povray")
out = exe("biscuit.pov", output=str.split, error=str.split)
expected = "POV-Ray finished"
assert expected in out