[Darshan-commits] [Git][darshan/darshan][master] 2 commits: TST: test for get_lib_version()

Shane Snyder xgitlab at cels.anl.gov
Tue May 11 15:58:01 CDT 2021



Shane Snyder pushed to branch master at darshan / darshan


Commits:
7c9df6ae by Tyler Reddy at 2021-04-21T17:22:13-06:00
TST: test for get_lib_version()

* add a regression test for `get_lib_version()`, which is
not covered by tests in `master` branch

* incidentally, instead of actually using `get_lib_version()`
the code base currently repeats the code inside the function

- - - - -
da63fe1a by Shane Snyder at 2021-05-11T15:57:59-05:00
Merge branch 'treddy_test_get_lib_version' into 'master'

TST: test for get_lib_version()

See merge request darshan/darshan!104
- - - - -


1 changed file:

- + darshan-util/pydarshan/tests/test_cffi_misc.py


Changes:

=====================================
darshan-util/pydarshan/tests/test_cffi_misc.py
=====================================
@@ -0,0 +1,23 @@
+# miscellaneous tests for the CFFI backend
+# that are not specific to any particular
+# mod
+
+import re
+
+import pytest
+import darshan.backend.cffi_backend as backend
+
+def test_get_lib_version():
+    # check for a reasonable version string
+    # returned by get_lib_version()
+    actual_version = backend.get_lib_version()
+    # must be a string
+    assert isinstance(actual_version, str)
+    # two periods in semantic version num
+    assert actual_version.count('.') == 2
+    # stricter regular expression match on
+    # the semantic version number
+    prog = re.compile(r"^\d+\.\d+\.\d+(-.+)?$")
+    match = prog.fullmatch(actual_version)
+    assert match is not None
+    assert match.group(0) == actual_version



View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/-/compare/f471874fa92d9e6a7061429cc0cf4e1ff9da5188...da63fe1abb47c51da5d119ecbe1851e3a05d28f1

-- 
View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/-/compare/f471874fa92d9e6a7061429cc0cf4e1ff9da5188...da63fe1abb47c51da5d119ecbe1851e3a05d28f1
You're receiving this email because of your account on xgitlab.cels.anl.gov.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/darshan-commits/attachments/20210511/795f2423/attachment.html>


More information about the Darshan-commits mailing list