m4: convert to new stand-alone test process (#37723)

This commit is contained in:
Tamara Dahlgren 2023-05-29 02:49:28 -07:00 committed by GitHub
parent 7d4b65491d
commit 031af84e90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -118,17 +118,18 @@ def configure_args(self):
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
)
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
reason = "test: ensuring m4 example succeeds"
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)