summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>2023-06-06 11:56:40 -0700
committerGitHub <noreply@github.com>2023-06-06 11:56:40 -0700
commite5d5efb4c10a57b5564b1ebc084a173e638c9966 (patch)
tree40c35e1648d93bc1a18aef1e1e7f12315d211fb4
parent0aa4b4d99024628c6c9d847995e03614c29ab137 (diff)
downloadspack-e5d5efb4c10a57b5564b1ebc084a173e638c9966.tar.gz
spack-e5d5efb4c10a57b5564b1ebc084a173e638c9966.tar.bz2
spack-e5d5efb4c10a57b5564b1ebc084a173e638c9966.tar.xz
spack-e5d5efb4c10a57b5564b1ebc084a173e638c9966.zip
tests/darshan-util: convert to new stand-alone test process (#37836)
-rw-r--r--var/spack/repos/builtin/packages/darshan-util/package.py35
1 files changed, 11 insertions, 24 deletions
diff --git a/var/spack/repos/builtin/packages/darshan-util/package.py b/var/spack/repos/builtin/packages/darshan-util/package.py
index f66504765d..badd27b6f1 100644
--- a/var/spack/repos/builtin/packages/darshan-util/package.py
+++ b/var/spack/repos/builtin/packages/darshan-util/package.py
@@ -91,7 +91,7 @@ class DarshanUtil(AutotoolsPackage):
return extra_args
@property
- def test_log_path(self):
+ def tests_log_path(self):
if self.version < Version("3.4.1"):
return join_path(
"darshan-test",
@@ -105,36 +105,23 @@ class DarshanUtil(AutotoolsPackage):
@run_after("install")
def _copy_test_inputs(self):
- test_inputs = [self.test_log_path]
+ test_inputs = [self.tests_log_path]
self.cache_extra_test_sources(test_inputs)
- def _test_parser(self):
- purpose = "Verify darshan-parser can parse an example log \
- and check some expected counter values"
- # Switch to loading the expected strings from the darshan source in future
+ def test_parser(self):
+ """process example log and check counters"""
+
+ # TODO: Switch to loading the expected strings from the darshan source in future
# filename = self.test_suite.current_test_cache_dir.
# join(join_path(self.basepath, "mpi-io-test-spack-expected.txt"))
# expected_output = self.get_escaped_text_output(filename)
+
expected_output = [
r"POSIX\s+-1\s+\w+\s+POSIX_OPENS\s+\d+",
r"MPI-IO\s+-1\s+\w+\s+MPIIO_INDEP_OPENS\s+\d+",
r"STDIO\s+0\s+\w+\s+STDIO_OPENS\s+\d+",
]
- logname = self.test_suite.current_test_cache_dir.join(self.test_log_path)
- exe = "darshan-parser"
- options = [logname]
- status = [0]
- installed = True
- self.run_test(
- exe,
- options,
- expected_output,
- status,
- installed,
- purpose,
- skip_missing=False,
- work_dir=None,
- )
-
- def test(self):
- self._test_parser()
+ logname = self.test_suite.current_test_cache_dir.join(self.tests_log_path)
+ parser = which(join_path(self.prefix.bin, "darshan-parser"))
+ out = parser(logname, output=str.split, error=str.split)
+ check_outputs(expected_output, out)