diff options
author | John MacFarlane <jgm@berkeley.edu> | 2016-05-17 13:16:16 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2016-05-17 13:16:16 -0700 |
commit | 82ea9598bf55320d1161d8ec672c2ac678e2d0f4 (patch) | |
tree | 6e861b2525f0f05890b4a04410288213bc3113c6 /test/cmark.py | |
parent | f8271ed0f523f61dae39b2c9edcda7758af2b84d (diff) | |
parent | 6ac50ca5f3edc478a9593f721c8f1b095a5cdb18 (diff) |
Merge pull request #126 from nwellnhof/mingw-tests
Fix tests under MinGW
Diffstat (limited to 'test/cmark.py')
-rw-r--r-- | test/cmark.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/test/cmark.py b/test/cmark.py index 1110860..787c310 100644 --- a/test/cmark.py +++ b/test/cmark.py @@ -24,15 +24,18 @@ class CMark: else: sysname = platform.system() if sysname == 'Darwin': - libname = "libcmark.dylib" + libnames = [ "libcmark.dylib" ] elif sysname == 'Windows': - libname = "cmark.dll" + libnames = [ "cmark.dll", "libcmark.dll" ] else: - libname = "libcmark.so" - if library_dir: - libpath = os.path.join(library_dir, libname) - else: - libpath = os.path.join("build", "src", libname) + libnames = [ "libcmark.so" ] + if not library_dir: + library_dir = os.path.join("build", "src") + for libname in libnames: + candidate = os.path.join(library_dir, libname) + if os.path.isfile(candidate): + libpath = candidate + break cmark = CDLL(libpath) markdown = cmark.cmark_markdown_to_html markdown.restype = c_char_p |