From 0f804cb7a289fd1872dd699498761b5f7370dacb Mon Sep 17 00:00:00 2001 From: mseth10 Date: Wed, 7 Aug 2019 08:43:40 +0000 Subject: [PATCH] setting folder for windows binares --- tests/python/unittest/test_library_loading.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/python/unittest/test_library_loading.py b/tests/python/unittest/test_library_loading.py index 9c1bbe09dd34..596d124c89d6 100644 --- a/tests/python/unittest/test_library_loading.py +++ b/tests/python/unittest/test_library_loading.py @@ -31,16 +31,18 @@ def check_platform(): def test_library_loading(): if (os.name=='posix'): lib = 'libsample_lib.so' + if os.path.exists(lib): + fname = lib + elif os.path.exists('build/'+lib): + fname = 'build/'+lib + else: + raise MXNetError("library %s not found " % lib) elif (os.name=='nt'): lib = 'libsample_lib.dll' + if os.path.exists('windows_package\\lib\\'+lib): + fname = 'windows_package\\lib\\'+lib + else: + raise MXNetError("library %s not found " % lib) - if os.path.exists(lib): - libdir = '' - elif os.path.exists('build/'+lib): - libdir = 'build/' - else: - raise MXNetError("library %s not found " % lib) - - fname = libdir + lib fname = os.path.abspath(fname) mx.library.load(fname)