Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
modifying unittest to use CI built binary
Browse files Browse the repository at this point in the history
  • Loading branch information
mseth10 committed Aug 7, 2019
1 parent 42fda42 commit bb12267
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions tests/python/unittest/test_library_loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import platform
import unittest
import mxnet as mx
from mxnet.base import MXNetError
from mxnet.test_utils import download

def check_platform():
Expand All @@ -29,10 +30,19 @@ def check_platform():
@unittest.skipIf(check_platform(), "not all machine types supported")
def test_library_loading():
if (os.name=='posix'):
lib = 'mylib.so'
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 = 'mylib.dll'
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)

fname = mx.test_utils.download('https://mxnet-demo-models.s3.amazonaws.com/lib_binary/'+lib)
fname = os.path.abspath(fname)
mx.library.load(fname)

0 comments on commit bb12267

Please sign in to comment.