зеркало из https://github.com/mozilla/gecko-dev.git
enable ctypes unit tests on all platforms. b=522118, r=bsmedberg
This commit is contained in:
Родитель
bfc3c2eecc
Коммит
edbdfe820d
|
@ -66,7 +66,7 @@ xpctestdir = $(testxpcobjdir)/$(MODULE)/unit
|
|||
# install the .js.in from the tests srcdir, so remove it when we're done.
|
||||
libs:: unit/test_jsctypes.js.in
|
||||
$(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) \
|
||||
$^ > $(xpctestdir)/test_jsctypes.js
|
||||
-DCTYPES_TEST_LIB=\"$(SHARED_LIBRARY)\" $^ > $(xpctestdir)/test_jsctypes.js
|
||||
$(TEST_INSTALLER) $(SHARED_LIBRARY) $(xpctestdir)
|
||||
$(RM) $(xpctestdir)/test_jsctypes.js.in
|
||||
|
||||
|
|
|
@ -43,6 +43,8 @@ Components.utils.import("resource://gre/modules/ctypes.jsm");
|
|||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
|
||||
#expand const CTYPES_TEST_LIB = __CTYPES_TEST_LIB__;
|
||||
|
||||
function do_check_throws(f, type, stack)
|
||||
{
|
||||
if (!stack)
|
||||
|
@ -60,16 +62,7 @@ function do_check_throws(f, type, stack)
|
|||
|
||||
function run_test()
|
||||
{
|
||||
#ifdef XP_WIN
|
||||
var libfile = do_get_file("jsctypes-test.dll");
|
||||
#elifdef XP_MACOSX
|
||||
var libfile = do_get_file("libjsctypes-test.dylib");
|
||||
#elifdef XP_UNIX
|
||||
var libfile = do_get_file("libjsctypes-test.so");
|
||||
#else
|
||||
// unsupported OS - don't run the test
|
||||
return;
|
||||
#endif
|
||||
var libfile = do_get_file(CTYPES_TEST_LIB);
|
||||
|
||||
// open the library with an nsILocalFile
|
||||
var library = ctypes.open(libfile);
|
||||
|
|
Загрузка…
Ссылка в новой задаче