diff options
Diffstat (limited to 'Examples/test-suite/javascript')
55 files changed, 263 insertions, 77 deletions
diff --git a/Examples/test-suite/javascript/Makefile.in b/Examples/test-suite/javascript/Makefile.in index 7368ea9a3..83b15f822 100755..100644 --- a/Examples/test-suite/javascript/Makefile.in +++ b/Examples/test-suite/javascript/Makefile.in @@ -4,10 +4,15 @@ LANGUAGE = javascript NODEGYP = @NODEGYP@ +NODEJS = @NODEJS@ SCRIPTSUFFIX = _runme.js +OBJEXT = @OBJEXT@ +SO = @SO@ + srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ + SWIG = $(top_builddir)/preinst_swig ifneq (, $(ENGINE)) @@ -16,23 +21,23 @@ else JSENGINE=node endif +ifneq (, $(V8_VERSION)) + JSV8_VERSION=$(V8_VERSION) +else + JSV8_VERSION=0x031110 +endif + include $(srcdir)/../common.mk +SWIGOPT += -DV8_VERSION=$(JSV8_VERSION) + _setup = \ - if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ + if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \ echo "$(ACTION)ing $(LANGUAGE) ($(JSENGINE)) testcase $* (with run test)" ; \ else \ echo "$(ACTION)ing $(LANGUAGE) ($(JSENGINE)) testcase $*" ; \ fi; -ifneq (jsc,$(ENGINE)) - - # This test can not be run with v8 as it uses v8 API incompatible output typemaps - typemap_variables.cpptest: - echo "skipping $(LANGUAGE) ($(JSENGINE)) testcase typemap_variables" ; - -endif - ifeq (node,$(JSENGINE)) SWIGOPT += -v8 -DBUILDING_NODE_EXTENSION=1 @@ -47,20 +52,27 @@ ifeq (node,$(JSENGINE)) constant_pointers.cpptest: GYP_CFLAGS = \"-Wno-ignored-qualifiers\" enum_thorough.cpptest: GYP_CFLAGS = \"-Wno-ignored-qualifiers\" + setup_node = \ + test -d $* || mkdir $*; \ + sed -e 's|$$testcase|$*|g; s|$$cflags|$(GYP_CFLAGS)|g; s|$$srcdir|$(srcdir)|g' \ + $(srcdir)/node_template/binding.gyp.in > $*/binding.gyp; \ + sed -e 's|$$testcase|$*|g;' \ + $(srcdir)/node_template/index.js.in > $*/index.js + # Note: we need to use swig in C parse mode, but make node-gyp believe it is c++ (via file extension) swig_and_compile_c = \ - sh ./setup_test.sh $* $(GYP_CFLAGS); \ - $(SWIG) -javascript $(SWIGOPT) -o $*_wrap.cxx ../$*.i; \ + $(setup_node); \ + $(SWIG) -javascript $(SWIGOPT) -o $*_wrap.cxx $(srcdir)/../$*.i; \ $(NODEGYP) --loglevel=silent --directory $* configure build 1>>/dev/null swig_and_compile_cpp = \ - sh ./setup_test.sh $* $(GYP_CFLAGS); \ - $(SWIG) -c++ -javascript $(SWIGOPT) ../$*.i; \ + $(setup_node); \ + $(SWIG) -c++ -javascript $(SWIGOPT) $(srcdir)/../$*.i; \ $(NODEGYP) --loglevel=silent --directory $* configure build 1>>/dev/null run_testcase = \ if [ -f $(srcdir)/$*$(SCRIPTSUFFIX) ]; then \ - node $(srcdir)/$*$(SCRIPTSUFFIX); \ + env NODE_PATH=$$PWD:$(srcdir) $(NODEJS) $(srcdir)/$*$(SCRIPTSUFFIX); \ fi @@ -83,7 +95,7 @@ else run_testcase = \ if [ -f $(srcdir)/$*$(SCRIPTSUFFIX) ]; then \ - $(top_srcdir)/Tools/javascript/javascript -$(JSENGINE) $(srcdir)/$*$(SCRIPTSUFFIX); \ + $(RUNTOOL) $(top_builddir)/Tools/javascript/javascript -$(JSENGINE) $(srcdir)/$*$(SCRIPTSUFFIX); \ fi %.ctest: @@ -105,10 +117,15 @@ endif %.clean: - rm -rf $* + @rm -rf $* + @rm -f $*_wrap.* $*$(SO) $*.$(OBJEXT) clean: - rm -f *_wrap.cxx - rm -f *_wrap.c - rm -f *.so - rm -f *.o + for ext in _wrap.cxx _wrap.$(OBJEXT) $(SO); do \ + rm -f clientdata_prop_a$${ext} clientdata_prop_b$${ext}; \ + rm -f imports_a$${ext} imports_b$${ext}; \ + rm -f import_stl_a$${ext} import_stl_b$${ext}; \ + rm -f mod_a$${ext} mod_b$${ext}; \ + rm -f multi_import_a$${ext} multi_import_b$${ext}; \ + rm -f packageoption_a$${ext} packageoption_b$${ext} packageoption_c$${ext}; \ + done diff --git a/Examples/test-suite/javascript/abstract_access_runme.js b/Examples/test-suite/javascript/abstract_access_runme.js index 8f87d2105..f61bb4358 100644 --- a/Examples/test-suite/javascript/abstract_access_runme.js +++ b/Examples/test-suite/javascript/abstract_access_runme.js @@ -1,4 +1,4 @@ -var abstract_access = require("./abstract_access"); +var abstract_access = require("abstract_access"); var d = new abstract_access.D() if (d.do_x() != 1) { diff --git a/Examples/test-suite/javascript/abstract_inherit_runme.js b/Examples/test-suite/javascript/abstract_inherit_runme.js index 3af2eae74..f732e8767 100644 --- a/Examples/test-suite/javascript/abstract_inherit_runme.js +++ b/Examples/test-suite/javascript/abstract_inherit_runme.js @@ -1,4 +1,4 @@ -var abstract_inherit = require("./abstract_inherit"); +var abstract_inherit = require("abstract_inherit"); // Shouldn't be able to instantiate any of these classes // since none of them implements the pure virtual function diff --git a/Examples/test-suite/javascript/abstract_typedef2_runme.js b/Examples/test-suite/javascript/abstract_typedef2_runme.js index c177e49c3..d8a533ab1 100644 --- a/Examples/test-suite/javascript/abstract_typedef2_runme.js +++ b/Examples/test-suite/javascript/abstract_typedef2_runme.js @@ -1,4 +1,4 @@ -var abstract_typedef2 = require("./abstract_typedef2"); +var abstract_typedef2 = require("abstract_typedef2"); var a = new abstract_typedef2.A_UF(); diff --git a/Examples/test-suite/javascript/abstract_typedef_runme.js b/Examples/test-suite/javascript/abstract_typedef_runme.js index abcfc581d..286328fa8 100644 --- a/Examples/test-suite/javascript/abstract_typedef_runme.js +++ b/Examples/test-suite/javascript/abstract_typedef_runme.js @@ -1,4 +1,4 @@ -var abstract_typedef = require("./abstract_typedef"); +var abstract_typedef = require("abstract_typedef"); var e = new abstract_typedef.Engine(); var a = new abstract_typedef.A() diff --git a/Examples/test-suite/javascript/abstract_virtual_runme.js b/Examples/test-suite/javascript/abstract_virtual_runme.js index 9e2814e41..9a9ce9988 100644 --- a/Examples/test-suite/javascript/abstract_virtual_runme.js +++ b/Examples/test-suite/javascript/abstract_virtual_runme.js @@ -1,4 +1,4 @@ -var abstract_virtual = require("./abstract_virtual"); +var abstract_virtual = require("abstract_virtual"); d = new abstract_virtual.D() diff --git a/Examples/test-suite/javascript/array_member_runme.js b/Examples/test-suite/javascript/array_member_runme.js index 8c4ef1da5..3d9bb0e5b 100644 --- a/Examples/test-suite/javascript/array_member_runme.js +++ b/Examples/test-suite/javascript/array_member_runme.js @@ -1,4 +1,4 @@ -var array_member = require("./array_member"); +var array_member = require("array_member"); var f = new array_member.Foo(); f.data = array_member.global_data; diff --git a/Examples/test-suite/javascript/arrays_global_runme.js b/Examples/test-suite/javascript/arrays_global_runme.js index fdb365f83..0cbb28efb 100644 --- a/Examples/test-suite/javascript/arrays_global_runme.js +++ b/Examples/test-suite/javascript/arrays_global_runme.js @@ -1,4 +1,4 @@ -var arrays_global = require("./arrays_global"); +var arrays_global = require("arrays_global"); arrays_global.array_i = arrays_global.array_const_i; diff --git a/Examples/test-suite/javascript/callback_runme.js b/Examples/test-suite/javascript/callback_runme.js index 9b1ef01a3..021888641 100644 --- a/Examples/test-suite/javascript/callback_runme.js +++ b/Examples/test-suite/javascript/callback_runme.js @@ -1,4 +1,4 @@ -var callback = require("./callback"); +var callback = require("callback"); if (callback.foo(2) !== 2) { throw new Error("Failed."); diff --git a/Examples/test-suite/javascript/char_binary_runme.js b/Examples/test-suite/javascript/char_binary_runme.js index 42abe6060..b2aac920c 100644 --- a/Examples/test-suite/javascript/char_binary_runme.js +++ b/Examples/test-suite/javascript/char_binary_runme.js @@ -1,4 +1,4 @@ -var char_binary = require("./char_binary"); +var char_binary = require("char_binary"); var t = new char_binary.Test(); if (t.strlen('hile') != 4) { diff --git a/Examples/test-suite/javascript/char_strings_runme.js b/Examples/test-suite/javascript/char_strings_runme.js index cca50d851..fe17cb982 100644 --- a/Examples/test-suite/javascript/char_strings_runme.js +++ b/Examples/test-suite/javascript/char_strings_runme.js @@ -1,4 +1,4 @@ -var char_strings = require("./char_strings"); +var char_strings = require("char_strings"); var assertIsEqual = function(expected, actual) { if (expected !== actual) { diff --git a/Examples/test-suite/javascript/class_ignore_runme.js b/Examples/test-suite/javascript/class_ignore_runme.js index f0a32a1c4..ffbe021c7 100644 --- a/Examples/test-suite/javascript/class_ignore_runme.js +++ b/Examples/test-suite/javascript/class_ignore_runme.js @@ -1,4 +1,4 @@ -var class_ignore = require("./class_ignore"); +var class_ignore = require("class_ignore"); a = new class_ignore.Bar(); diff --git a/Examples/test-suite/javascript/class_scope_weird_runme.js b/Examples/test-suite/javascript/class_scope_weird_runme.js index ac745d023..73c118d61 100644 --- a/Examples/test-suite/javascript/class_scope_weird_runme.js +++ b/Examples/test-suite/javascript/class_scope_weird_runme.js @@ -1,4 +1,4 @@ -var class_scope_weird = require("./class_scope_weird"); +var class_scope_weird = require("class_scope_weird"); f = new class_scope_weird.Foo(); g = new class_scope_weird.Foo(3); diff --git a/Examples/test-suite/javascript/complextest_runme.js b/Examples/test-suite/javascript/complextest_runme.js index 1fcc97648..b87d6bffa 100644 --- a/Examples/test-suite/javascript/complextest_runme.js +++ b/Examples/test-suite/javascript/complextest_runme.js @@ -1,4 +1,4 @@ -var complextest = require("./complextest"); +var complextest = require("complextest"); a = [-1,2]; diff --git a/Examples/test-suite/javascript/constover_runme.js b/Examples/test-suite/javascript/constover_runme.js index 764d8b328..9b192b5ff 100644 --- a/Examples/test-suite/javascript/constover_runme.js +++ b/Examples/test-suite/javascript/constover_runme.js @@ -1,4 +1,4 @@ -var constover = require("./constover"); +var constover = require("constover"); p = constover.test("test"); if (p != "test") { diff --git a/Examples/test-suite/javascript/constructor_copy_runme.js b/Examples/test-suite/javascript/constructor_copy_runme.js index 39dce52ce..179b9fb40 100644 --- a/Examples/test-suite/javascript/constructor_copy_runme.js +++ b/Examples/test-suite/javascript/constructor_copy_runme.js @@ -1,4 +1,4 @@ -var constructor_copy = require("./constructor_copy"); +var constructor_copy = require("constructor_copy"); f1 = new constructor_copy.Foo1(3); f11 = new constructor_copy.Foo1(f1); diff --git a/Examples/test-suite/javascript/cpp11_strongly_typed_enumerations_runme.js b/Examples/test-suite/javascript/cpp11_strongly_typed_enumerations_runme.js new file mode 100644 index 000000000..ad9d4e883 --- /dev/null +++ b/Examples/test-suite/javascript/cpp11_strongly_typed_enumerations_runme.js @@ -0,0 +1,165 @@ +var cpp11_strongly_typed_enumerations = require("cpp11_strongly_typed_enumerations"); + +function enumCheck(actual, expected) { + if (actual != expected) { + throw new Error("Enum value mismatch. Expected: " + expected + " Actual: " + actual); + } + return expected + 1; +} + +val = 0; +val = enumCheck(cpp11_strongly_typed_enumerations.Enum1_Val1, val); +val = enumCheck(cpp11_strongly_typed_enumerations.Enum1_Val2, val); +val = enumCheck(cpp11_strongly_typed_enumerations.Enum1_Val3, 13); +val = enumCheck(cpp11_strongly_typed_enumerations.Enum1_Val4, val); +val = enumCheck(cpp11_strongly_typed_enumerations.Enum1_Val5a, 13); +val = enumCheck(cpp11_strongly_typed_enumerations.Enum1_Val6a, val); + +val = 0; +val = enumCheck(cpp11_strongly_typed_enumerations.Enum2_Val1, val); +val = enumCheck(cpp11_strongly_typed_enumerations.Enum2_Val2, val); +val = enumCheck(cpp11_strongly_typed_enumerations.Enum2_Val3, 23); +val = enumCheck(cpp11_strongly_typed_enumerations.Enum2_Val4, val); +val = enumCheck(cpp11_strongly_typed_enumerations.Enum2_Val5b, 23); +val = enumCheck(cpp11_strongly_typed_enumerations.Enum2_Val6b, val); + +val = 0; +val = enumCheck(cpp11_strongly_typed_enumerations.Val1, val); +val = enumCheck(cpp11_strongly_typed_enumerations.Val2, val); +val = enumCheck(cpp11_strongly_typed_enumerations.Val3, 43); +val = enumCheck(cpp11_strongly_typed_enumerations.Val4, val); + +val = 0; +val = enumCheck(cpp11_strongly_typed_enumerations.Enum5_Val1, val); +val = enumCheck(cpp11_strongly_typed_enumerations.Enum5_Val2, val); +val = enumCheck(cpp11_strongly_typed_enumerations.Enum5_Val3, 53); +val = enumCheck(cpp11_strongly_typed_enumerations.Enum5_Val4, val); + +val = 0; +val = enumCheck(cpp11_strongly_typed_enumerations.Enum6_Val1, val); +val = enumCheck(cpp11_strongly_typed_enumerations.Enum6_Val2, val); +val = enumCheck(cpp11_strongly_typed_enumerations.Enum6_Val3, 63); +val = enumCheck(cpp11_strongly_typed_enumerations.Enum6_Val4, val); + +val = 0; +val = enumCheck(cpp11_strongly_typed_enumerations.Enum7td_Val1, val); +val = enumCheck(cpp11_strongly_typed_enumerations.Enum7td_Val2, val); +val = enumCheck(cpp11_strongly_typed_enumerations.Enum7td_Val3, 73); +val = enumCheck(cpp11_strongly_typed_enumerations.Enum7td_Val4, val); + +val = 0; +val = enumCheck(cpp11_strongly_typed_enumerations.Enum8_Val1, val); +val = enumCheck(cpp11_strongly_typed_enumerations.Enum8_Val2, val); +val = enumCheck(cpp11_strongly_typed_enumerations.Enum8_Val3, 83); +val = enumCheck(cpp11_strongly_typed_enumerations.Enum8_Val4, val); + +val = 0; +val = enumCheck(cpp11_strongly_typed_enumerations.Enum10_Val1, val); +val = enumCheck(cpp11_strongly_typed_enumerations.Enum10_Val2, val); +val = enumCheck(cpp11_strongly_typed_enumerations.Enum10_Val3, 103); +val = enumCheck(cpp11_strongly_typed_enumerations.Enum10_Val4, val); + +val = 0; +val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Enum12_Val1, 1121); +val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Enum12_Val2, 1122); +val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Enum12_Val3, val); +val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Enum12_Val4, val); +val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Enum12_Val5c, 1121); +val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Enum12_Val6c, val); + +val = 0; +val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Val1, 1131); +val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Val2, 1132); +val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Val3, val); +val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Val4, val); +val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Val5d, 1131); +val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Val6d, val); + +val = 0; +val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Enum14_Val1, 1141); +val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Enum14_Val2, 1142); +val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Enum14_Val3, val); +val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Enum14_Val4, val); +val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Enum14_Val5e, 1141); +val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Enum14_Val6e, val); + +// Requires nested class support to work +//val = 0; +//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Enum12_Val1, 3121); +//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Enum12_Val2, 3122); +//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Enum12_Val3, val); +//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Enum12_Val4, val); +//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Enum12_Val5f, 3121); +//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Enum12_Val6f, val); +// +//val = 0; +//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Val1, 3131); +//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Val2, 3132); +//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Val3, val); +//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Val4, val); +// +//val = 0; +//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Enum14_Val1, 3141); +//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Enum14_Val2, 3142); +//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Enum14_Val3, val); +//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Enum14_Val4, val); +//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Enum14_Val5g, 3141); +//val = enumCheck(cpp11_strongly_typed_enumerations.Class1.Struct1.Enum14_Val6g, val); + +val = 0; +val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Enum12_Val1, 2121); +val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Enum12_Val2, 2122); +val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Enum12_Val3, val); +val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Enum12_Val4, val); +val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Enum12_Val5h, 2121); +val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Enum12_Val6h, val); + +val = 0; +val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Val1, 2131); +val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Val2, 2132); +val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Val3, val); +val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Val4, val); +val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Val5i, 2131); +val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Val6i, val); + +val = 0; +val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Enum14_Val1, 2141); +val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Enum14_Val2, 2142); +val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Enum14_Val3, val); +val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Enum14_Val4, val); +val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Enum14_Val5j, 2141); +val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Enum14_Val6j, val); + +// Requires nested class support to work +//val = 0; +//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Enum12_Val1, 4121); +//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Enum12_Val2, 4122); +//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Enum12_Val3, val); +//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Enum12_Val4, val); +//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Enum12_Val5k, 4121); +//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Enum12_Val6k, val); +// +//val = 0; +//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Val1, 4131); +//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Val2, 4132); +//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Val3, val); +//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Val4, val); +//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Val5l, 4131); +//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Val6l, val); +// +//val = 0; +//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Enum14_Val1, 4141); +//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Enum14_Val2, 4142); +//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Enum14_Val3, val); +//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Enum14_Val4, val); +//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Enum14_Val5m, 4141); +//val = enumCheck(cpp11_strongly_typed_enumerations.Class2.Struct1_Enum14_Val6m, val); + +class1 = new cpp11_strongly_typed_enumerations.Class1(); +enumCheck(class1.class1Test1(cpp11_strongly_typed_enumerations.Enum1_Val5a), 13); +enumCheck(class1.class1Test2(cpp11_strongly_typed_enumerations.Class1.Enum12_Val5c), 1121); +//enumCheck(class1.class1Test3(cpp11_strongly_typed_enumerations.Class1.Struct1_Enum12_Val5f), 3121); + +enumCheck(cpp11_strongly_typed_enumerations.globalTest1(cpp11_strongly_typed_enumerations.Enum1_Val5a), 13); +enumCheck(cpp11_strongly_typed_enumerations.globalTest2(cpp11_strongly_typed_enumerations.Class1.Enum12_Val5c), 1121); +//enumCheck(globalTest3(cpp11_strongly_typed_enumerations.Class1.Struct1_Enum12_Val5f), 3121); diff --git a/Examples/test-suite/javascript/cpp_enum_runme.js b/Examples/test-suite/javascript/cpp_enum_runme.js index 35f7c60ac..8a248c372 100644 --- a/Examples/test-suite/javascript/cpp_enum_runme.js +++ b/Examples/test-suite/javascript/cpp_enum_runme.js @@ -1,4 +1,4 @@ -var cpp_enum = require("./cpp_enum"); +var cpp_enum = require("cpp_enum"); var f = new cpp_enum.Foo() diff --git a/Examples/test-suite/javascript/cpp_namespace_runme.js b/Examples/test-suite/javascript/cpp_namespace_runme.js index 3bdfef3e9..a6ab79964 100644 --- a/Examples/test-suite/javascript/cpp_namespace_runme.js +++ b/Examples/test-suite/javascript/cpp_namespace_runme.js @@ -1,4 +1,4 @@ -var cpp_namespace = require("./cpp_namespace"); +var cpp_namespace = require("cpp_namespace"); var n = cpp_namespace.fact(4); if (n != 24){ diff --git a/Examples/test-suite/javascript/cpp_static_runme.js b/Examples/test-suite/javascript/cpp_static_runme.js index 2579aeafe..c7917e12e 100644 --- a/Examples/test-suite/javascript/cpp_static_runme.js +++ b/Examples/test-suite/javascript/cpp_static_runme.js @@ -1,4 +1,4 @@ -var cpp_static = require("./cpp_static"); +var cpp_static = require("cpp_static"); cpp_static.StaticFunctionTest.static_func(); cpp_static.StaticFunctionTest.static_func_2(1); diff --git a/Examples/test-suite/javascript/director_alternating_runme.js b/Examples/test-suite/javascript/director_alternating_runme.js index a0411eace..cff288d35 100644 --- a/Examples/test-suite/javascript/director_alternating_runme.js +++ b/Examples/test-suite/javascript/director_alternating_runme.js @@ -1,4 +1,4 @@ -var director_alternating = require("./director_alternating"); +var director_alternating = require("director_alternating"); id = director_alternating.getBar().id(); if (id != director_alternating.idFromGetBar()) diff --git a/Examples/test-suite/javascript/disown_runme.js b/Examples/test-suite/javascript/disown_runme.js index a4a6fd880..ea742b51e 100644 --- a/Examples/test-suite/javascript/disown_runme.js +++ b/Examples/test-suite/javascript/disown_runme.js @@ -1,4 +1,4 @@ -var disown = require("./disown"); +var disown = require("disown"); var a = new disown.A(); var tmp = a.thisown; diff --git a/Examples/test-suite/javascript/dynamic_cast_runme.js b/Examples/test-suite/javascript/dynamic_cast_runme.js index 0029cb0f8..32eabcf8b 100644 --- a/Examples/test-suite/javascript/dynamic_cast_runme.js +++ b/Examples/test-suite/javascript/dynamic_cast_runme.js @@ -1,4 +1,4 @@ -var dynamic_cast = require("./dynamic_cast"); +var dynamic_cast = require("dynamic_cast"); var f = new dynamic_cast.Foo(); var b = new dynamic_cast.Bar(); diff --git a/Examples/test-suite/javascript/empty_runme.js b/Examples/test-suite/javascript/empty_runme.js index db06b3902..7894379be 100644 --- a/Examples/test-suite/javascript/empty_runme.js +++ b/Examples/test-suite/javascript/empty_runme.js @@ -1 +1 @@ -var empty = require("./empty");
\ No newline at end of file +var empty = require("empty");
\ No newline at end of file diff --git a/Examples/test-suite/javascript/enum_template_runme.js b/Examples/test-suite/javascript/enum_template_runme.js index 20f8c3482..1e71e5f64 100644 --- a/Examples/test-suite/javascript/enum_template_runme.js +++ b/Examples/test-suite/javascript/enum_template_runme.js @@ -1,4 +1,4 @@ -var enum_template = require("./enum_template"); +var enum_template = require("enum_template"); if (enum_template.MakeETest() != 1) throw "RuntimeError"; diff --git a/Examples/test-suite/javascript/infinity_runme.js b/Examples/test-suite/javascript/infinity_runme.js index 7b5182ff6..8ebe496a6 100644 --- a/Examples/test-suite/javascript/infinity_runme.js +++ b/Examples/test-suite/javascript/infinity_runme.js @@ -1,4 +1,5 @@ -var infinity = require("./infinity"); +var infinity = require("infinity"); +infinity.initialise_MYINFINITY(); var my_infinity = infinity.INFINITY; var ret_val = infinity.use_infinity(my_infinity); diff --git a/Examples/test-suite/javascript/namespace_virtual_method_runme.js b/Examples/test-suite/javascript/namespace_virtual_method_runme.js index 24d3bd487..4f1e05c84 100644 --- a/Examples/test-suite/javascript/namespace_virtual_method_runme.js +++ b/Examples/test-suite/javascript/namespace_virtual_method_runme.js @@ -1,3 +1,3 @@ -var namespace_virtual_method = require("./namespace_virtual_method"); +var namespace_virtual_method = require("namespace_virtual_method"); x = new namespace_virtual_method.Spam(); diff --git a/Examples/test-suite/javascript/node_template/binding.gyp.in b/Examples/test-suite/javascript/node_template/binding.gyp.in index 209774ae0..a82ac2f3e 100644 --- a/Examples/test-suite/javascript/node_template/binding.gyp.in +++ b/Examples/test-suite/javascript/node_template/binding.gyp.in @@ -3,7 +3,7 @@ { "target_name": "$testcase", "sources":[ "../$testcase_wrap.cxx" ], - "include_dirs": ["../.."], + "include_dirs": ["../$srcdir/.."], 'defines': [ 'BUILDING_NODE_EXTENSION=1', ], diff --git a/Examples/test-suite/javascript/nspace_extend_runme.js b/Examples/test-suite/javascript/nspace_extend_runme.js index ab81c19d3..8cabfe945 100644 --- a/Examples/test-suite/javascript/nspace_extend_runme.js +++ b/Examples/test-suite/javascript/nspace_extend_runme.js @@ -1,4 +1,4 @@ -var nspace_extend = require("./nspace_extend"); +var nspace_extend = require("nspace_extend"); // constructors and destructors var color1 = new nspace_extend.Outer.Inner1.Color(); diff --git a/Examples/test-suite/javascript/nspace_runme.js b/Examples/test-suite/javascript/nspace_runme.js index f1afff428..993610dd6 100644 --- a/Examples/test-suite/javascript/nspace_runme.js +++ b/Examples/test-suite/javascript/nspace_runme.js @@ -1,4 +1,4 @@ -var nspace = require("./nspace"); +var nspace = require("nspace"); var color1 = new nspace.Outer.Inner1.Color(); var color = new nspace.Outer.Inner1.Color(color1); diff --git a/Examples/test-suite/javascript/null_pointer_runme.js b/Examples/test-suite/javascript/null_pointer_runme.js new file mode 100644 index 000000000..7c0d61244 --- /dev/null +++ b/Examples/test-suite/javascript/null_pointer_runme.js @@ -0,0 +1,9 @@ +var null_pointer = require("null_pointer"); + +if (!null_pointer.func(null)) { + throw new Error("Javascript 'null' should be converted into NULL."); +} + +if (null_pointer.getnull() != null) { + throw new Error("NULL should be converted into Javascript 'null'."); +} diff --git a/Examples/test-suite/javascript/overload_copy_runme.js b/Examples/test-suite/javascript/overload_copy_runme.js index 1039ffda1..e2f610788 100644 --- a/Examples/test-suite/javascript/overload_copy_runme.js +++ b/Examples/test-suite/javascript/overload_copy_runme.js @@ -1,4 +1,4 @@ -var overload_copy = require("./overload_copy"); +var overload_copy = require("overload_copy"); f = new overload_copy.Foo(); g = new overload_copy.Foo(f); diff --git a/Examples/test-suite/javascript/preproc_include_runme.js b/Examples/test-suite/javascript/preproc_include_runme.js index 4b827fbcc..5ec72b842 100644 --- a/Examples/test-suite/javascript/preproc_include_runme.js +++ b/Examples/test-suite/javascript/preproc_include_runme.js @@ -1,4 +1,4 @@ -var preproc_include = require("./preproc_include"); +var preproc_include = require("preproc_include"); if (preproc_include.multiply10(10) != 100) throw "RuntimeError"; diff --git a/Examples/test-suite/javascript/preproc_runme.js b/Examples/test-suite/javascript/preproc_runme.js index 669f9d1f0..167ca5ac1 100644 --- a/Examples/test-suite/javascript/preproc_runme.js +++ b/Examples/test-suite/javascript/preproc_runme.js @@ -1,4 +1,4 @@ -var preproc = require("./preproc"); +var preproc = require("preproc"); if (preproc.endif != 1) throw "RuntimeError"; diff --git a/Examples/test-suite/javascript/rename1_runme.js b/Examples/test-suite/javascript/rename1_runme.js index 8374e6a89..68ecc11b6 100644 --- a/Examples/test-suite/javascript/rename1_runme.js +++ b/Examples/test-suite/javascript/rename1_runme.js @@ -1,4 +1,4 @@ -var rename = require("./rename1"); +var rename = require("rename1"); function part1() { var xyz = new rename.XYZInt(); diff --git a/Examples/test-suite/javascript/rename2_runme.js b/Examples/test-suite/javascript/rename2_runme.js index bc6a95a59..99f478596 100644 --- a/Examples/test-suite/javascript/rename2_runme.js +++ b/Examples/test-suite/javascript/rename2_runme.js @@ -1,4 +1,4 @@ -var rename = require("./rename2"); +var rename = require("rename2"); function part1() { var xyz = new rename.XYZInt(); diff --git a/Examples/test-suite/javascript/rename3_runme.js b/Examples/test-suite/javascript/rename3_runme.js index 9e57e80ea..237029fbb 100644 --- a/Examples/test-suite/javascript/rename3_runme.js +++ b/Examples/test-suite/javascript/rename3_runme.js @@ -1,4 +1,4 @@ -var rename = require("./rename3"); +var rename = require("rename3"); function part1() { var xyz = new rename.XYZInt(); diff --git a/Examples/test-suite/javascript/rename4_runme.js b/Examples/test-suite/javascript/rename4_runme.js index d651fc7a1..fed50dceb 100644 --- a/Examples/test-suite/javascript/rename4_runme.js +++ b/Examples/test-suite/javascript/rename4_runme.js @@ -1,4 +1,4 @@ -var rename = require("./rename4"); +var rename = require("rename4"); function part1() { var xyz = new rename.XYZInt(); diff --git a/Examples/test-suite/javascript/rename_scope_runme.js b/Examples/test-suite/javascript/rename_scope_runme.js index c0226df69..fea4d2ca9 100644 --- a/Examples/test-suite/javascript/rename_scope_runme.js +++ b/Examples/test-suite/javascript/rename_scope_runme.js @@ -1,4 +1,4 @@ -var rename_scope = require("./rename_scope"); +var rename_scope = require("rename_scope"); var a = new rename_scope.Natural_UP(); var b = new rename_scope.Natural_BP(); diff --git a/Examples/test-suite/javascript/rename_simple_runme.js b/Examples/test-suite/javascript/rename_simple_runme.js index 918dd68a5..21350cd3e 100644 --- a/Examples/test-suite/javascript/rename_simple_runme.js +++ b/Examples/test-suite/javascript/rename_simple_runme.js @@ -1,4 +1,4 @@ -var rename_simple = require("./rename_simple"); +var rename_simple = require("rename_simple"); var NewStruct = rename_simple.NewStruct; var s = new NewStruct(); diff --git a/Examples/test-suite/javascript/ret_by_value_runme.js b/Examples/test-suite/javascript/ret_by_value_runme.js index d9a77a20b..9d0840602 100644 --- a/Examples/test-suite/javascript/ret_by_value_runme.js +++ b/Examples/test-suite/javascript/ret_by_value_runme.js @@ -1,4 +1,4 @@ -var ret_by_value = require("./ret_by_value"); +var ret_by_value = require("ret_by_value"); a = ret_by_value.get_test(); if (a.myInt != 100) diff --git a/Examples/test-suite/javascript/setup_test.sh b/Examples/test-suite/javascript/setup_test.sh deleted file mode 100644 index 913a74c4b..000000000 --- a/Examples/test-suite/javascript/setup_test.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -if [ ! -d $1 ]; then - mkdir $1; -fi -sed -e "s/\$testcase/$1/" -e "s/\$cflags/$2/" < node_template/binding.gyp.in > $1/binding.gyp -sed s/\$testcase/$1/ node_template/index.js.in > $1/index.js diff --git a/Examples/test-suite/javascript/string_simple_runme.js b/Examples/test-suite/javascript/string_simple_runme.js index dbdd4136d..39ae84e9e 100644 --- a/Examples/test-suite/javascript/string_simple_runme.js +++ b/Examples/test-suite/javascript/string_simple_runme.js @@ -1,4 +1,4 @@ -var string_simple = require("./string_simple"); +var string_simple = require("string_simple"); // Test unicode string var str = "olé"; diff --git a/Examples/test-suite/javascript/struct_value_runme.js b/Examples/test-suite/javascript/struct_value_runme.js index d6b26f726..5b171b8fe 100644 --- a/Examples/test-suite/javascript/struct_value_runme.js +++ b/Examples/test-suite/javascript/struct_value_runme.js @@ -1,4 +1,4 @@ -var struct_value = require("./struct_value"); +var struct_value = require("struct_value"); b = new struct_value.Bar(); diff --git a/Examples/test-suite/javascript/template_static_runme.js b/Examples/test-suite/javascript/template_static_runme.js index 477d97249..d6106138a 100644 --- a/Examples/test-suite/javascript/template_static_runme.js +++ b/Examples/test-suite/javascript/template_static_runme.js @@ -1,3 +1,3 @@ -var template_static = require("./template_static"); +var template_static = require("template_static"); template_static.Foo.bar_double(1); diff --git a/Examples/test-suite/javascript/typedef_class_runme.js b/Examples/test-suite/javascript/typedef_class_runme.js index 3e4dc9093..64e0051c3 100644 --- a/Examples/test-suite/javascript/typedef_class_runme.js +++ b/Examples/test-suite/javascript/typedef_class_runme.js @@ -1,4 +1,4 @@ -var typedef_class = require("./typedef_class"); +var typedef_class = require("typedef_class"); a = new typedef_class.RealA(); a.a = 3; diff --git a/Examples/test-suite/javascript/typedef_inherit_runme.js b/Examples/test-suite/javascript/typedef_inherit_runme.js index 4abcc2536..7590e1e6e 100644 --- a/Examples/test-suite/javascript/typedef_inherit_runme.js +++ b/Examples/test-suite/javascript/typedef_inherit_runme.js @@ -1,4 +1,4 @@ -var typedef_inherit = require("./typedef_inherit"); +var typedef_inherit = require("typedef_inherit"); a = new typedef_inherit.Foo(); b = new typedef_inherit.Bar(); diff --git a/Examples/test-suite/javascript/typedef_scope_runme.js b/Examples/test-suite/javascript/typedef_scope_runme.js index 0ac56884c..5c1368ab7 100644 --- a/Examples/test-suite/javascript/typedef_scope_runme.js +++ b/Examples/test-suite/javascript/typedef_scope_runme.js @@ -1,4 +1,4 @@ -var typedef_scope = require("./typedef_scope"); +var typedef_scope = require("typedef_scope"); b = new typedef_scope.Bar(); x = b.test1(42,"hello"); diff --git a/Examples/test-suite/javascript/typemap_arrays_runme.js b/Examples/test-suite/javascript/typemap_arrays_runme.js index cd6827ac9..610ecdd9c 100644 --- a/Examples/test-suite/javascript/typemap_arrays_runme.js +++ b/Examples/test-suite/javascript/typemap_arrays_runme.js @@ -1,4 +1,4 @@ -var typemap_arrays = require("./typemap_arrays"); +var typemap_arrays = require("typemap_arrays"); if (typemap_arrays.sumA(null) != 60) throw "RuntimeError, Sum is wrong"; diff --git a/Examples/test-suite/javascript/typemap_delete_runme.js b/Examples/test-suite/javascript/typemap_delete_runme.js index 4b3174956..1d42ce4da 100644 --- a/Examples/test-suite/javascript/typemap_delete_runme.js +++ b/Examples/test-suite/javascript/typemap_delete_runme.js @@ -1,4 +1,4 @@ -var typemap_delete = require("./typemap_delete"); +var typemap_delete = require("typemap_delete"); r = new typemap_delete.Rect(123); if (r.val != 123) diff --git a/Examples/test-suite/javascript/typemap_namespace_runme.js b/Examples/test-suite/javascript/typemap_namespace_runme.js index 614e0ffeb..2aa358024 100644 --- a/Examples/test-suite/javascript/typemap_namespace_runme.js +++ b/Examples/test-suite/javascript/typemap_namespace_runme.js @@ -1,4 +1,4 @@ -var typemap_namespace = require("./typemap_namespace"); +var typemap_namespace = require("typemap_namespace"); if (typemap_namespace.test1("hello") != "hello") throw "RuntimeError"; diff --git a/Examples/test-suite/javascript/typemap_ns_using_runme.js b/Examples/test-suite/javascript/typemap_ns_using_runme.js index 9115c16ae..7e4019ab2 100644 --- a/Examples/test-suite/javascript/typemap_ns_using_runme.js +++ b/Examples/test-suite/javascript/typemap_ns_using_runme.js @@ -1,4 +1,4 @@ -var typemap_ns_using = require("./typemap_ns_using"); +var typemap_ns_using = require("typemap_ns_using"); if (typemap_ns_using.spam(37) != 37) throw "RuntimeError"; diff --git a/Examples/test-suite/javascript/using1_runme.js b/Examples/test-suite/javascript/using1_runme.js index a2e37fcb6..2415156f0 100644 --- a/Examples/test-suite/javascript/using1_runme.js +++ b/Examples/test-suite/javascript/using1_runme.js @@ -1,4 +1,4 @@ -var using1 = require("./using1"); +var using1 = require("using1"); if (using1.spam(37) != 37) throw "RuntimeError"; diff --git a/Examples/test-suite/javascript/using2_runme.js b/Examples/test-suite/javascript/using2_runme.js index aa5e9b15f..2ef08faca 100644 --- a/Examples/test-suite/javascript/using2_runme.js +++ b/Examples/test-suite/javascript/using2_runme.js @@ -1,4 +1,4 @@ -var using2 = require("./using2"); +var using2 = require("using2"); if (using2.spam(37) != 37) throw "RuntimeError"; diff --git a/Examples/test-suite/javascript/varargs_runme.js b/Examples/test-suite/javascript/varargs_runme.js index 69d761e63..fc6d945c1 100644 --- a/Examples/test-suite/javascript/varargs_runme.js +++ b/Examples/test-suite/javascript/varargs_runme.js @@ -1,4 +1,4 @@ -var varargs = require("./varargs"); +var varargs = require("varargs"); if (varargs.test("Hello") != "Hello") { throw new Error("Failed"); |