summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>2023-05-29 02:49:28 -0700
committerGitHub <noreply@github.com>2023-05-29 11:49:28 +0200
commit031af84e90655d654b461a5a47860f2058d2014f (patch)
treee05cdb8c60536921a8c69590d94a79c49974ac1b
parent7d4b65491d261bca3b37eb2370bdb8f97b21f01f (diff)
downloadspack-031af84e90655d654b461a5a47860f2058d2014f.tar.gz
spack-031af84e90655d654b461a5a47860f2058d2014f.tar.bz2
spack-031af84e90655d654b461a5a47860f2058d2014f.tar.xz
spack-031af84e90655d654b461a5a47860f2058d2014f.zip
m4: convert to new stand-alone test process (#37723)
-rw-r--r--var/spack/repos/builtin/packages/m4/package.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/var/spack/repos/builtin/packages/m4/package.py b/var/spack/repos/builtin/packages/m4/package.py
index dede047da1..7e665557dc 100644
--- a/var/spack/repos/builtin/packages/m4/package.py
+++ b/var/spack/repos/builtin/packages/m4/package.py
@@ -118,17 +118,18 @@ class M4(AutotoolsPackage, GNUMirrorPackage):
return args
- def test(self):
- spec_vers = str(self.spec.version)
- reason = "test: ensuring m4 version is {0}".format(spec_vers)
- self.run_test(
- "m4", "--version", spec_vers, installed=True, purpose=reason, skip_missing=False
- )
-
- reason = "test: ensuring m4 example succeeds"
+ def test_version(self):
+ """ensure m4 version matches installed spec"""
+ m4 = which(self.prefix.bin.m4)
+ out = m4("--version", output=str.split, error=str.split)
+ assert str(self.spec.version) in out
+
+ def test_hello(self):
+ """ensure m4 hello example runs"""
test_data_dir = self.test_suite.current_test_data_dir
hello_file = test_data_dir.join("hello.m4")
+ m4 = which(self.prefix.bin.m4)
+ out = m4(hello_file, output=str.split, error=str.split)
+
expected = get_escaped_text_output(test_data_dir.join("hello.out"))
- self.run_test(
- "m4", hello_file, expected, installed=True, purpose=reason, skip_missing=False
- )
+ check_outputs(expected, out)