From edbdfe820ddeea2373c4c7d8a53c987bf690d7f3 Mon Sep 17 00:00:00 2001 From: Dan Witte Date: Fri, 6 Nov 2009 09:48:07 -0800 Subject: [PATCH] enable ctypes unit tests on all platforms. b=522118, r=bsmedberg --- js/ctypes/tests/Makefile.in | 2 +- js/ctypes/tests/unit/test_jsctypes.js.in | 13 +++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/js/ctypes/tests/Makefile.in b/js/ctypes/tests/Makefile.in index 64b57e0a629c..e933a32c01ee 100644 --- a/js/ctypes/tests/Makefile.in +++ b/js/ctypes/tests/Makefile.in @@ -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 diff --git a/js/ctypes/tests/unit/test_jsctypes.js.in b/js/ctypes/tests/unit/test_jsctypes.js.in index c1a9cb0deae5..f3f06ef6c6d9 100644 --- a/js/ctypes/tests/unit/test_jsctypes.js.in +++ b/js/ctypes/tests/unit/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);