darshan-util: fix location of input for darshan-util tests (#34245)
* fix location of input for darshan-util tests Darshan log file used for test input was removed from the Darshan repo after the 3.4.0 release. This commit adds logic to use a different log file as test input for later Darshan versions.
This commit is contained in:
parent
35aa875762
commit
884123b7ce
@ -93,20 +93,26 @@ def configure_args(self):
|
|||||||
return extra_args
|
return extra_args
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def basepath(self):
|
def test_log_path(self):
|
||||||
return join_path("darshan-test", "example-output")
|
if self.version < Version("3.4.1"):
|
||||||
|
return join_path(
|
||||||
|
"darshan-test",
|
||||||
|
"example-output",
|
||||||
|
"mpi-io-test-x86_64-{0}.darshan".format(self.version),
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
return join_path(
|
||||||
|
"darshan-util", "pydarshan", "darshan", "tests", "input", "sample.darshan"
|
||||||
|
)
|
||||||
|
|
||||||
@run_after("install")
|
@run_after("install")
|
||||||
def _copy_test_inputs(self):
|
def _copy_test_inputs(self):
|
||||||
# add darshan-test/example-output/mpi-io-test-spack-expected.txt"
|
test_inputs = [self.test_log_path]
|
||||||
test_inputs = [
|
|
||||||
join_path(self.basepath, "mpi-io-test-x86_64-{0}.darshan".format(self.spec.version))
|
|
||||||
]
|
|
||||||
self.cache_extra_test_sources(test_inputs)
|
self.cache_extra_test_sources(test_inputs)
|
||||||
|
|
||||||
def _test_parser(self):
|
def _test_parser(self):
|
||||||
purpose = "Verify darshan-parser can parse an example log \
|
purpose = "Verify darshan-parser can parse an example log \
|
||||||
from the current version and check some expected counter values"
|
and check some expected counter values"
|
||||||
# Switch to loading the expected strings from the darshan source in future
|
# Switch to loading the expected strings from the darshan source in future
|
||||||
# filename = self.test_suite.current_test_cache_dir.
|
# filename = self.test_suite.current_test_cache_dir.
|
||||||
# join(join_path(self.basepath, "mpi-io-test-spack-expected.txt"))
|
# join(join_path(self.basepath, "mpi-io-test-spack-expected.txt"))
|
||||||
@ -116,9 +122,7 @@ def _test_parser(self):
|
|||||||
r"MPI-IO\s+-1\s+\w+\s+MPIIO_INDEP_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+",
|
r"STDIO\s+0\s+\w+\s+STDIO_OPENS\s+\d+",
|
||||||
]
|
]
|
||||||
logname = self.test_suite.current_test_cache_dir.join(
|
logname = self.test_suite.current_test_cache_dir.join(self.test_log_path)
|
||||||
join_path(self.basepath, "mpi-io-test-x86_64-{0}.darshan".format(self.spec.version))
|
|
||||||
)
|
|
||||||
exe = "darshan-parser"
|
exe = "darshan-parser"
|
||||||
options = [logname]
|
options = [logname]
|
||||||
status = [0]
|
status = [0]
|
||||||
|
Loading…
Reference in New Issue
Block a user