[seed] tests: Ditch the python test framework, use standard make check with a small set of JavaScript funct



commit f8d07c7157afd249dada6f58182bccdc26785103
Author: Tim Horton <hortont424 gmail com>
Date:   Wed Jan 6 03:47:37 2010 -0500

    tests: Ditch the python test framework, use standard make check with a small
    set of JavaScript functions to deal with assertions and unreachable code
    and whatnot. Also, clean up some tests, and remove some that made no sense
    whatsoever.
    
    Three or four tests still don't work (and print output to that effect)
    because of strange exception-chaining problems which I'm going to look into.

 Makefile.am                                        |    5 +-
 tests/Makefile.am                                  |    7 +-
 tests/javascript/Makefile.am                       |   49 +++++++--
 tests/javascript/argv.js                           |    6 +-
 tests/javascript/array-gtype.js                    |   16 ++-
 tests/javascript/builtin-argument-length.js        |  111 +++++++++-----------
 tests/javascript/c-module.js                       |    7 --
 tests/javascript/check-syntax.js                   |   42 ++++++--
 tests/javascript/closure-finalization.js           |   12 ++-
 tests/javascript/compare.js                        |   10 +-
 tests/javascript/constructor-args.js               |   15 ++--
 tests/javascript/constructor-prototype.js          |   17 ++--
 tests/javascript/enum.js                           |   14 +--
 tests/javascript/everything.js                     |  111 ++++++++++----------
 tests/javascript/fork.js                           |   20 +---
 tests/javascript/function-info.js                  |   13 +--
 tests/javascript/gdk-event.js                      |   35 +++---
 tests/javascript/gerror.js                         |   12 +--
 tests/javascript/gobject-scope.js                  |   12 +--
 tests/javascript/gtypes/Makefile.am                |   15 +++
 .../gtypes/gtype-class-init-exception.js           |   26 ++++-
 tests/javascript/gtypes/gtype-extraprop.js         |   27 +++---
 tests/javascript/gtypes/gtype-gtype-class-init.js  |   48 ++++----
 tests/javascript/gtypes/gtype-gtype.js             |   48 ++++-----
 .../javascript/gtypes/gtype-property-construct.js  |   59 ++++++----
 tests/javascript/gtypes/gtype-property-nice.js     |   42 ++++----
 tests/javascript/gtypes/gtype-property.js          |   51 +++++-----
 tests/javascript/gtypes/gtype-self.js              |   25 ++---
 tests/javascript/gtypes/gtype-signal-args.js       |   36 +++---
 tests/javascript/gtypes/gtype-signal.js            |   25 ++---
 tests/javascript/gtypes/gtype-typerror.js          |   21 ++--
 tests/javascript/gtypes/gtype.js                   |   42 ++++----
 tests/javascript/gtypes/testsuite.js               |    1 +
 tests/javascript/gvalue-argument.js                |    4 -
 tests/javascript/include-syntax.js                 |   19 +++-
 tests/javascript/include.js                        |    6 +-
 tests/javascript/introspect.js                     |   21 ++--
 tests/javascript/json-constructor.js               |   17 ++--
 tests/javascript/json.js                           |   24 +++--
 tests/javascript/list-test.js                      |   30 +++---
 tests/javascript/modules-noasserts.js              |   25 +++++
 tests/javascript/modules.js                        |   29 +-----
 tests/javascript/native-closure-exception.js       |   34 ++++--
 tests/javascript/native-closure.js                 |   27 +++---
 tests/javascript/object-info.js                    |   29 +++---
 tests/javascript/out-test.js                       |   22 ++--
 tests/javascript/print.js                          |    7 --
 tests/javascript/printf.js                         |   12 --
 tests/javascript/printprint.js                     |    7 --
 tests/javascript/property-benchmark.js             |    6 +-
 tests/javascript/property-glib-exception.js        |   25 +++--
 tests/javascript/quit.js                           |    7 +-
 tests/javascript/quit2.js                          |    7 --
 tests/javascript/readline-bind.js                  |    9 --
 tests/javascript/readline.js                       |    8 --
 tests/javascript/signals/Makefile.am               |   11 ++
 tests/javascript/signals/signal-connect.js         |   24 ++---
 tests/javascript/signals/signal-disconnect.js      |   31 +++---
 tests/javascript/signals/signal-exception.js       |    7 +-
 tests/javascript/signals/signal-expects.js         |   20 ++--
 tests/javascript/signals/signal-invalid.js         |   15 ++--
 tests/javascript/signals/signal-nofunc.js          |   18 ++--
 tests/javascript/signals/signal-userdata.js        |    9 +-
 tests/javascript/signals/signal.js                 |   19 ++--
 tests/javascript/signals/testsuite.js              |    1 +
 tests/javascript/spawn.js                          |    8 --
 tests/javascript/sqlite.js                         |   43 ++++----
 tests/javascript/structs/Makefile.am               |   10 ++
 tests/javascript/structs/struct-constructor.js     |   17 ++--
 tests/javascript/structs/struct-enumerate.js       |   14 ++--
 tests/javascript/structs/struct-functions.js       |   13 +--
 tests/javascript/structs/struct-nested-set.js      |   27 ++---
 tests/javascript/structs/struct-offsets.js         |   15 +--
 tests/javascript/structs/struct-set-member.js      |   15 +--
 tests/javascript/structs/struct-union-enumerate.js |   31 ++++--
 tests/javascript/structs/testsuite.js              |    1 +
 tests/javascript/syntax-test-noasserts.js          |    1 +
 tests/javascript/syntax-test.js                    |   18 +++-
 tests/javascript/testsuite.js                      |   32 ++++++
 tests/javascript/type-conversion.js                |   42 ++++----
 tests/make-test.py                                 |   55 ----------
 tests/run-tests.py                                 |  104 ------------------
 82 files changed, 936 insertions(+), 1020 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 9387ef6..5bfb716 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -28,13 +28,10 @@ EXTRA_DIST = $(seeddoc_DATA) \
 
 DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc
 
-test:
-	cd tests ; ./run-tests.py
-
 profile-reset:
 	find -name '*.gcda' -delete
 
-profile: profile-reset test
+profile: profile-reset check
 	cp libseed/*.c libseed/.libs/
 
 if PROFILE_MODULES
diff --git a/tests/Makefile.am b/tests/Makefile.am
index d88733d..a16435e 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,8 +1,3 @@
 SUBDIRS = javascript c
-EXTRA_DIST = \
-    COPYING \
-    run-tests.py \
-    make-test.py
-
-## File created by the gnome-build tools
+EXTRA_DIST = COPYING
 
diff --git a/tests/javascript/Makefile.am b/tests/javascript/Makefile.am
index 911d35e..c718637 100644
--- a/tests/javascript/Makefile.am
+++ b/tests/javascript/Makefile.am
@@ -7,7 +7,6 @@ EXTRA_DIST = \
     builtin-argument-length.js \
     check-syntax.js \
     closure-finalization.js \
-    c-module.js \
     compare.js \
     constructor-args.js \
     constructor-prototype.js \
@@ -26,24 +25,52 @@ EXTRA_DIST = \
     json.js \
     list-test.js \
     modules.js \
+    modules-noasserts.js \
     native-closure-exception.js \
     native-closure.js \
     object-info.js \
     out-test.js \
-    printf.js \
-    print.js \
-    printprint.js \
     property-benchmark.js \
     property-glib-exception.js \
-    quit2.js \
     quit.js \
-    readline-bind.js \
-    readline.js \
-    spawn.js \
     sqlite.js \
     syntax-test.js \
-    type-conversion.js
-
+    syntax-test-noasserts.js \
+    type-conversion.js \
+    testsuite.js
 
-## File created by the gnome-build tools
+TESTS = \
+    argv.js \
+    array-gtype.js \
+    builtin-argument-length.js \
+    check-syntax.js \
+    closure-finalization.js \
+    compare.js \
+    constructor-args.js \
+    constructor-prototype.js \
+    enum.js \
+    everything.js \
+    fork.js \
+    function-info.js \
+    gdk-event.js \
+    gerror.js \
+    gobject-scope.js \
+    gvalue-argument.js \
+    include.js \
+    include-syntax.js \
+    introspect.js \
+    json-constructor.js \
+    json.js \
+    list-test.js \
+    modules.js \
+    native-closure-exception.js \
+    native-closure.js \
+    object-info.js \
+    out-test.js \
+    property-benchmark.js \
+    property-glib-exception.js \
+    quit.js \
+    sqlite.js \
+    syntax-test.js \
+    type-conversion.js
 
diff --git a/tests/javascript/argv.js b/tests/javascript/argv.js
index 4e49cbc..67c6930 100755
--- a/tests/javascript/argv.js
+++ b/tests/javascript/argv.js
@@ -1,7 +1,3 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:seed
-// STDERR:
 
-print(Seed.argv[0]);
+imports.testsuite.assert(Seed.argv[0] == "seed")
diff --git a/tests/javascript/array-gtype.js b/tests/javascript/array-gtype.js
index db50b1f..969f711 100755
--- a/tests/javascript/array-gtype.js
+++ b/tests/javascript/array-gtype.js
@@ -1,13 +1,17 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:
-// STDERR:
 
 Gtk = imports.gi.Gtk;
 GObject = imports.gi.GObject;
 
 Gtk.init(Seed.argv);
 
-list = new Gtk.ListStore();
-list.set_column_types(2, [GObject.TYPE_STRING, GObject.TYPE_INT]);
+try
+{
+    list = new Gtk.ListStore();
+    list.set_column_types(2, [GObject.TYPE_STRING, GObject.TYPE_INT]);
+}
+catch(e)
+{
+    print(e)
+    imports.testsuite.unreachable()
+}
diff --git a/tests/javascript/builtin-argument-length.js b/tests/javascript/builtin-argument-length.js
index e7b6769..ac6118a 100755
--- a/tests/javascript/builtin-argument-length.js
+++ b/tests/javascript/builtin-argument-length.js
@@ -1,61 +1,52 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:Seed\.spawn expected 1 argument\nFailed to execute child process "asihfieuhgieuhgw" \(No such file or directory\)\nSeed\.include expected 1 argument, got 0\nFile not found: 1\nFile not found: \nSeed\.include expected 1 argument, got 2\nSeed\.include expected 1 argument, got 2\nprint expected 1 argument, got 0\nprint expected 1 argument, got 2\nprint expected 1 argument, got 2\nprint expected 1 argument, got 3\nSeed\.introspect expected 1 argument, got 0\nSeed\.introspect expected 1 argument, got 2\nSeed\.check_syntax expected 1 argument, got 0\nSeed\.check_syntax expected 1 argument, got 2
-// STDERR:
-
-try{
-Seed.spawn();
-}catch(e){print(e.message);}
-try{
-Seed.spawn("asihfieuhgieuhgw");
-}catch(e){print(e.message);}
-
-try{
-Seed.include();
-}catch(e){print(e.message);}
-try{
-Seed.include(1);
-}catch(e){print(e.message);}
-try{
-Seed.include("");
-}catch(e){print(e.message);}
-try{
-Seed.include(1,2);
-}catch(e){print(e.message);}
-try{
-Seed.include("fail.js","another.js");
-}catch(e){print(e.message);}
-
-try{
-print();
-}catch(e){print(e.message);}
-try{
-print(1, 2);
-}catch(e){print(e.message);}
-try{
-print("asdf", 2);
-}catch(e){print(e.message);}
-try{
-print(1, 2, 3);
-}catch(e){print(e.message);}
-
-try{
-Seed.introspect();
-}catch(e){print(e.message);}
-try{
-Seed.introspect(Seed, 5.23);
-}catch(e){print(e.message);}
-
-try{
-Seed.check_syntax();
-}catch(e){print(e.message);}
-try{
-Seed.check_syntax("5+5", "asdf");
-}catch(e){print(e.message);}
-
-try{
-Seed.quit(1,2);
-}catch(e){print(e.message);}
-
-Seed.quit();
+
+testsuite = imports.testsuite
+
+function correctArgs(fs, a)
+{
+    try
+    {
+        eval(fs).apply(this, a)
+    }
+    catch(e)
+    {
+        if(e.name == "ArgumentError")
+            testsuite.unreachable(fs)
+    }
+}
+
+function wrongArgs(fs, a)
+{
+    try
+    {
+        eval(fs).apply(this, a)
+        testsuite.unreachable(fs)
+    }
+    catch(e)
+    {
+        
+    }
+}
+
+wrongArgs("Seed.spawn", [])
+correctArgs("Seed.spawn", ["asdfasdfasdf"])
+
+wrongArgs("Seed.include", [])
+wrongArgs("Seed.include", [1])
+correctArgs("Seed.include", [""])
+wrongArgs("Seed.include", [1,2])
+wrongArgs("Seed.include", ["fail.js","another.js"])
+
+wrongArgs("print", [])
+wrongArgs("print", [1,2])
+wrongArgs("print", ["asdf",2])
+wrongArgs("print", [1,2,3])
+
+wrongArgs("Seed.introspect", [])
+correctArgs("Seed.introspect", [Seed])
+wrongArgs("Seed.introspect", [Seed, 5.23])
+
+wrongArgs("Seed.check_syntax", [])
+correctArgs("Seed.check_syntax", ["asdfasdf"])
+wrongArgs("Seed.check_syntax", ["5+5", "asdf"])
+
diff --git a/tests/javascript/check-syntax.js b/tests/javascript/check-syntax.js
index fc3b0ed..007c8ae 100755
--- a/tests/javascript/check-syntax.js
+++ b/tests/javascript/check-syntax.js
@@ -1,12 +1,32 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:ONE\n\[null\]\nTWO\n\[null\]\nTHREE
-// STDERR:\n\*\* \(seed:[0-9]+\): CRITICAL \*\*: Line 1 in \[undefined\]: SyntaxError Parse error
-
-print("ONE");
-print(Seed.check_syntax("5+5;"));
-print("TWO");
-print(Seed.check_syntax("asdfasdf.jsdf()"));
-print("THREE");
-print(Seed.check_syntax("one[)"));
+
+testsuite = imports.testsuite
+
+try
+{
+    Seed.check_syntax("5+5;")
+}
+catch(e)
+{
+    testsuite.unreachable("5+5; is not a syntax error")
+}
+
+try
+{
+    Seed.check_syntax("asdfasdf.jsdf()")
+}
+catch(e)
+{
+    testsuite.unreachable("asdfasdf.jsdf() is not a syntax error")
+}
+
+try
+{
+    Seed.check_syntax("one[)")
+    testsuite.unreachable("one[) should be a syntax error")
+}
+catch(e)
+{
+    testsuite.assert(e instanceof SyntaxError)
+}
+
diff --git a/tests/javascript/closure-finalization.js b/tests/javascript/closure-finalization.js
index 66f3123..003946e 100755
--- a/tests/javascript/closure-finalization.js
+++ b/tests/javascript/closure-finalization.js
@@ -1,9 +1,6 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:\[object GtkVBox\]
-// STDERR:
 
+testsuite = imports.testsuite;
 Gtk = imports.gi.Gtk;
 
 Gtk.init(Seed.argv);
@@ -13,7 +10,10 @@ w = new Gtk.Window();
 // Closure will always be GCed at end of signal.
 signal = function()
 {
-	w.foreach(function(widget){print(widget);});
+    widgets = []
+	w.foreach(function(widget){widgets.push(widget.toString())})
+	testsuite.assert(widgets[0] == ["[object GtkVBox]"])
+	testsuite.assert(widgets.length == 1)
 };
 
 vbox = new Gtk.VBox();
@@ -23,3 +23,5 @@ w.add(vbox);
 w.signal.show.connect(signal);
 
 w.show_all();
+
+testsuite.checkAsserts(2)
diff --git a/tests/javascript/compare.js b/tests/javascript/compare.js
index e04f850..6a4f59c 100755
--- a/tests/javascript/compare.js
+++ b/tests/javascript/compare.js
@@ -1,15 +1,13 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:0\n1
-// STDERR:
 
+testsuite = imports.testsuite
 Gtk = imports.gi.Gtk;
+
 Gtk.init(Seed.argv);
 
 var a = new Gtk.Button();
 var b = new Gtk.Button();
 var c = a;
 
-print(a == b);
-print(c == a);
+testsuite.assert(a != b);
+testsuite.assert(c == a);
diff --git a/tests/javascript/constructor-args.js b/tests/javascript/constructor-args.js
index ac57e38..efdfa94 100755
--- a/tests/javascript/constructor-args.js
+++ b/tests/javascript/constructor-args.js
@@ -1,9 +1,6 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:Constructor expects 1 argument, got 2\nConstructor expects object as argument
-// STDERR:
 
+testsuite = imports.testsuite
 Gtk = imports.gi.Gtk;
 Gtk.init(Seed.argv);
 
@@ -13,23 +10,27 @@ try
 }
 catch (e)
 {
-	print(e.message);
+	testsuite.unreachable()
 }
 
 try
 {
 	w = new Gtk.Window(1, 2);
+	testsuite.unreachable()
 }
 catch (e)
 {
-	print(e.message);
+	testsuite.assert(e.name == "ArgumentError") 
 }
 
 try
 {
 	w = new Gtk.Window("safA");
+	testsuite.unreachable()
 }
 catch (e)
 {
-	print(e.message);
+	testsuite.assert(e.name == "ArgumentError")
 }
+
+testsuite.checkAsserts(2)
diff --git a/tests/javascript/constructor-prototype.js b/tests/javascript/constructor-prototype.js
index cc7601d..d45c193 100755
--- a/tests/javascript/constructor-prototype.js
+++ b/tests/javascript/constructor-prototype.js
@@ -1,13 +1,12 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:Hello World
-// STDERR:
 
-Gtk = imports.gi.Gtk;
-Gtk.init(Seed.argv);
+testsuite = imports.testsuite
+Gtk = imports.gi.Gtk
 
-Gtk.Window.prototype.hello = "Hello World";
+Gtk.init(Seed.argv)
 
-a = new Gtk.Window();
-print(a.hello);
+Gtk.Window.prototype.hello = "Hello World"
+
+a = new Gtk.Window()
+
+testsuite.assert(a.hello == "Hello World")
diff --git a/tests/javascript/enum.js b/tests/javascript/enum.js
index 8488d51..b68a5a6 100755
--- a/tests/javascript/enum.js
+++ b/tests/javascript/enum.js
@@ -1,15 +1,13 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:2
-// STDERR:
 
+testsuite = imports.testsuite
 Gtk = imports.gi.Gtk;
-Gtk.init(Seed.argv);
 
-b = new Gtk.Button();
-b.relief = Gtk.ReliefStyle.NONE;
+Gtk.init(Seed.argv);
 
-print(Gtk.ReliefStyle.NONE);
+b = new Gtk.Button()
+b.relief = Gtk.ReliefStyle.NONE
 
+testsuite.assert(Gtk.ReliefStyle.NONE == 2)
+testsuite.assert(b.relief == 2)
 
diff --git a/tests/javascript/everything.js b/tests/javascript/everything.js
index ec54bdd..8a61b8f 100755
--- a/tests/javascript/everything.js
+++ b/tests/javascript/everything.js
@@ -1,70 +1,71 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:1\n-124\n129\n-1235\n1387\n-123435\n133487\n-16323375\n13873737\n-16325\n33737\n-16325\n33737\n12\n143\n-1853\.12329101562\n-134543853\.12334\n8\n\["åäö","\/etc\/fstab"\]\n\["1","2","3"\]\n\["1","2","3"\]\n\["1","2","3"\]\n\["1","2","3"\]\nthanks,for,all,the,fish\n5\n0\n123\n0\n1\n42\n1\n2\n4\n15\n120\n120\.2357\n42\n19
-// STDERR:
 
-Everything = imports.gi.Everything;
-GObject = imports.gi.GObject;
+testsuite = imports.testsuite
+Everything = imports.gi.Everything
+GObject = imports.gi.GObject
+JSON = imports.JSON
 
-JSON = imports.JSON;
+assert = testsuite.assert
 
 with(Everything)
 {
-print(test_boolean(true));
-print(test_int8(-124));
-print(test_uint8(129));
-print(test_int16(-1235));
-print(test_uint16(1387));
-print(test_int32(-123435));
-print(test_uint32(133487));
-print(test_int64(-16323375));
-print(test_uint64(13873737));
-print(test_int(-16325));
-print(test_uint(33737));
-print(test_long(-16325));
-print(test_ulong(33737));
-print(test_ssize(12));
-print(test_size(143));
-print(test_float(-1853.12334));
-print(test_double(-134543853.12334));
-//Need support for: print(test_timet(1853));
-print(test_gtype(8));
+assert(test_boolean(true) == true)
+assert(test_int8(-124) == -124)
+assert(test_uint8(129) == 129)
+assert(test_int16(-1235) == -1235)
+assert(test_uint16(1387) == 1387)
+assert(test_int32(-123435) == -123435)
+assert(test_uint32(133487) == 133487)
+assert(test_int64(-16323375) == -16323375)
+assert(test_uint64(13873737) == 13873737)
+assert(test_int(-16325) == -16325)
+assert(test_uint(33737) == 33737)
+assert(test_long(-16325) == -16325)
+assert(test_ulong(33737) == 33737)
+assert(test_ssize(12) == 12)
+assert(test_size(143) == 143)
+assert(test_float(-1853.12334) > (-1853.12334 - 0.001))
+assert(test_float(-1853.12334) < (-1853.12334 + 0.001))
+assert(test_double(-134543853.12334) > (-134543853.12334 - 0.001))
+assert(test_double(-134543853.12334) < (-134543853.12334 + 0.001))
+//assert(test_timet(1853) == 1853)
+assert(test_gtype(8) == 8)
 
-print(JSON.stringify(test_filename_return()));
-print(JSON.stringify(test_glist_nothing_return()));
-print(JSON.stringify(test_glist_nothing_return2()));
-print(JSON.stringify(test_glist_container_return()));
-print(JSON.stringify(test_glist_everything_return()));
+assert(test_filename_return()[0] == "åäö")
+assert(test_filename_return()[1] == "/etc/fstab")
+assert(test_glist_nothing_return()[0] == "1")
+assert(test_glist_nothing_return2()[1] == "2")
+assert(test_glist_container_return()[2] == "3")
+assert(test_glist_everything_return()[1] == "2")
 
-//test_glist_nothing_in([2, 3, 4]);
+//test_glist_nothing_in([2, 3, 4])
 
-print(test_strv_out());
+assert(test_strv_out().toString() == "thanks,for,all,the,fish")
 
-// These are broken... Robb's working on them:
-print(test_closure(function () { return [GObject.TYPE_INT, 5]; }));
-print(test_closure_one_arg(function (a) { return [GObject.TYPE_INT, a]; }));
+assert(test_closure(function () { return [GObject.TYPE_INT, 5] }) == 5)
+assert(test_closure_one_arg(function (a) { return [GObject.TYPE_INT, a] }) == 0)
 
-print(test_value_return(123).get_int());
+assert(test_value_return(123).get_int() == 123)
 
-print(TestEnum.VALUE1);
-print(TestEnum.VALUE2);
-print(TestEnum.VALUE3);
-print(TestFlags.FLAG1);
-print(TestFlags.FLAG2);
-print(TestFlags.FLAG3);
+assert(TestEnum.VALUE1 == 0)
+assert(TestEnum.VALUE2 == 1)
+assert(TestEnum.VALUE3 == 42)
+assert(TestFlags.FLAG1 == 1)
+assert(TestFlags.FLAG2 == 2)
+assert(TestFlags.FLAG3 == 4)
 
-TestStructA.some_int = 15;
-print(TestStructA.some_int);
-TestStructA.some_int8 = 120;
-print(TestStructA.some_int8);
-TestStructA.some_double = 120.2357;
-print(TestStructA.some_double);
-TestStructA.some_enum = TestEnum.VALUE3;
-print(TestStructA.some_enum);
+TestStructA.some_int = 15
+assert(TestStructA.some_int == 15)
+TestStructA.some_int8 = 120
+assert(TestStructA.some_int8 == 120)
+TestStructA.some_double = 120.2357
+assert(TestStructA.some_double > (120.2357 - 0.001))
+assert(TestStructA.some_double < (120.2357 + 0.001))
+TestStructA.some_enum = TestEnum.VALUE3
+assert(TestStructA.some_enum == 42)
 
-TestStructB.some_int8 = 19;
-print(TestStructB.some_int8);
-//TestStructB.nested_a.some_double = 134.3455;
-//print(TestStructB.nested_a.some_double);
+TestStructB.some_int8 = 19
+assert(TestStructB.some_int8 == 19)
+//TestStructB.nested_a.some_double = 134.3455
+//print(TestStructB.nested_a.some_double)
 }
diff --git a/tests/javascript/fork.js b/tests/javascript/fork.js
index bfefa24..ad87572 100755
--- a/tests/javascript/fork.js
+++ b/tests/javascript/fork.js
@@ -1,16 +1,8 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:[AB]\n[AB]
-// STDERR:
-os = imports.os;
-var a = os.fork();
 
-if(a)
-{
-	print("A");
-}
-else
-{
-	print("B");
-}
+testsuite = imports.testsuite
+os = imports.os
+
+a = os.fork()
+
+testsuite.assert(a >= 0)
diff --git a/tests/javascript/function-info.js b/tests/javascript/function-info.js
index 07873cf..60c6a43 100755
--- a/tests/javascript/function-info.js
+++ b/tests/javascript/function-info.js
@@ -1,12 +1,9 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:resize
-// STDERR:
 
-Gtk = imports.gi.Gtk;
-GIRepository = imports.gi.GIRepository;
+testsuite = imports.testsuite
+Gtk = imports.gi.Gtk
+GIRepository = imports.gi.GIRepository
 
-f = Gtk.Window.prototype.resize.info;
+f = Gtk.Window.prototype.resize.info
 
-print(GIRepository.base_info_get_name(f));
+testsuite.assert(GIRepository.base_info_get_name(f) == "resize")
diff --git a/tests/javascript/gdk-event.js b/tests/javascript/gdk-event.js
index d88e19c..e71c4ed 100755
--- a/tests/javascript/gdk-event.js
+++ b/tests/javascript/gdk-event.js
@@ -1,28 +1,27 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:\[object GdkWindow\]\n\[object GdkWindow\]\n1\n200
-// STDERR:
 
-Gtk = imports.gi.Gtk;
-Gdk = imports.gi.Gdk;
-Gtk.init(Seed.argv);
+testsuite = imports.testsuite
+Gtk = imports.gi.Gtk
+Gdk = imports.gi.Gdk
+Gtk.init(Seed.argv)
 
 function paint(wdg, evt)
 {
-	print(evt.expose.window);
-	print(wdg.window);
-	print(evt.expose.window === wdg.window);
+    testsuite.assert(evt.expose.window instanceof Gdk.Window)
+    testsuite.assert(wdg.window instanceof Gdk.Window)
+    testsuite.assert(evt.expose.window == wdg.window)
+    testsuite.assert(evt.expose.area.width == 200)
 
-	print(evt.expose.area.width);
+	Gtk.main_quit()
 
-	Gtk.main_quit();
-	return false;
+	return false
 }
 
-var win = new Gtk.Window();
-win.signal.expose_event.connect(paint);
-win.resize(200,200);
-win.show();
+var win = new Gtk.Window()
+win.signal.expose_event.connect(paint)
+win.resize(200,200)
+win.show()
 
-Gtk.main();
+Gtk.main()
+
+testsuite.checkAsserts(4)
diff --git a/tests/javascript/gerror.js b/tests/javascript/gerror.js
index 907e6e1..20690c0 100755
--- a/tests/javascript/gerror.js
+++ b/tests/javascript/gerror.js
@@ -1,16 +1,14 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:GIoError Error opening file .* Is a directory
-// STDERR:
 
-Gio = imports.gi.Gio;
+testsuite = imports.testsuite
+Gio = imports.gi.Gio
 
 try
 {
-	Gio.simple_write(".", "test");
+	Gio.simple_write(".", "test")
+	testsuite.unreachable()
 }
 catch (e)
 {
-	print(e.name+" "+e.message);
+	testsuite.assert(e.name == "GIoError")
 }
diff --git a/tests/javascript/gobject-scope.js b/tests/javascript/gobject-scope.js
index 5b71910..a510049 100755
--- a/tests/javascript/gobject-scope.js
+++ b/tests/javascript/gobject-scope.js
@@ -1,15 +1,13 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:
-// STDERR:
 
-Gtk = imports.gi.Gtk;
+// TODO: this test doesn't actually test anything...
 
-Gtk.init(Seed.argv);
+Gtk = imports.gi.Gtk
+
+Gtk.init(Seed.argv)
 
 for(var i = 0; i < 100; i++)
 {
-    var button = new Gtk.Button({label: "Test!"});
+    var button = new Gtk.Button({label: "Test!"})
 }
 
diff --git a/tests/javascript/gtypes/Makefile.am b/tests/javascript/gtypes/Makefile.am
index 7347f94..f7d9edf 100644
--- a/tests/javascript/gtypes/Makefile.am
+++ b/tests/javascript/gtypes/Makefile.am
@@ -10,5 +10,20 @@ EXTRA_DIST = \
 	gtype-self.js \
 	gtype-extraprop.js \
 	gtype-gtype-class-init.js \
+	gtype-signal.js \
+	testsuite.js
+
+TESTS = \
+	gtype-class-init-exception.js \
+	gtype-property.js \
+	gtype-typerror.js \
+	gtype.js \
+	gtype-gtype.js \
+	gtype-signal-args.js \
+	gtype-property-construct.js \
+	gtype-property-nice.js \
+	gtype-self.js \
+	gtype-extraprop.js \
+	gtype-gtype-class-init.js \
 	gtype-signal.js
 
diff --git a/tests/javascript/gtypes/gtype-class-init-exception.js b/tests/javascript/gtypes/gtype-class-init-exception.js
index 2a10ad2..e537c6e 100755
--- a/tests/javascript/gtypes/gtype-class-init-exception.js
+++ b/tests/javascript/gtypes/gtype-class-init-exception.js
@@ -4,20 +4,34 @@
 // STDOUT:
 // STDERR:\n\*\* \(seed:[0-9]+\): WARNING \*\*: Exception in class init closure\. Line 14 in .*\/gtype-class-init-exception\.js: ReferenceError Can't find variable: notAVariable
 
-Gtk = imports.gi.Gtk;
-Gtk.init(Seed.argv);
+testsuite = imports.testsuite
+Gtk = imports.gi.Gtk
+Gtk.init(Seed.argv)
 
 HelloWindowType = {
     parent: Gtk.Window.type,
     name: "HelloWindow",
     class_init: function(klass, prototype)
     {
-		prototype = notAVariable.notAProperty;
+		prototype = notAVariable.notAProperty
     },
     init: function(klass)
     {
-    }};
+    }
+}
 
-HelloWindow = new GType(HelloWindowType);
-w = new HelloWindow();
+try
+{
+    HelloWindow = new GType(HelloWindowType)
+    w = new HelloWindow()
+}
+catch(e)
+{
+    testsuite.assert(e instanceof ReferenceError)
+    // TODO: THIS TEST DOESN'T WORK EITHER!
+    // what's going on with chained exception stuff
+}
 
+//testsuite.checkAsserts(1)
+
+print("This test doesn't work yet...")
diff --git a/tests/javascript/gtypes/gtype-extraprop.js b/tests/javascript/gtypes/gtype-extraprop.js
index c348588..5ecd17a 100755
--- a/tests/javascript/gtypes/gtype-extraprop.js
+++ b/tests/javascript/gtypes/gtype-extraprop.js
@@ -1,21 +1,20 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:1
-// STDERR:
 
-Gtk = imports.gi.Gtk;
-Gtk.init(Seed.argv);
+testsuite = imports.testsuite
+Gtk = imports.gi.Gtk
 
-HelloWindowType = {
+Gtk.init(Seed.argv)
+
+HelloWindow = new GType({
     parent: Gtk.Window.type,
     name: "HelloWindow",
-    init: function(self){
-	print(self.test);
-    }};
-
-HelloWindow = new GType(HelloWindowType);
-w = new HelloWindow({test: 1});
+    init: function(self)
+    {
+	    testsuite.assert(self.test == 2)
+	    testsuite.assert(self.testAgain == "arst")
+    }
+})
 
-w.show();
+w = new HelloWindow({test: 2, testAgain: "arst"})
 
+testsuite.checkAsserts(2)
diff --git a/tests/javascript/gtypes/gtype-gtype-class-init.js b/tests/javascript/gtypes/gtype-gtype-class-init.js
index 8740bb2..0523e0b 100755
--- a/tests/javascript/gtypes/gtype-gtype-class-init.js
+++ b/tests/javascript/gtypes/gtype-gtype-class-init.js
@@ -1,30 +1,30 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:Class init
-// STDERR:
-Gtk = imports.gi.Gtk;
-Gtk.init(Seed.argv);
 
-HelloWindowType = {
- parent: Gtk.Window.type,
- name: "HelloWindow",
- init: function(){
-  }
-};
+testsuite = imports.testsuite
+Gtk = imports.gi.Gtk
+Gtk.init(Seed.argv)
 
-HelloWindow = new GType(HelloWindowType);
-w = new HelloWindow();
+HelloWindow = new GType({
+    parent: Gtk.Window.type,
+    name: "HelloWindow",
+    init: function()
+    {
+    }
+})
 
-InheritedWindowType = {
- parent: HelloWindow.type,
- name: "InheritedWindow",
- class_init: function(klass, prototype) {print("Class init")},
- init: function(){
-  }
-};
+w = new HelloWindow()
 
-InheritedWindow = new GType(InheritedWindowType);
-
-b = new InheritedWindow();
+InheritedWindow = new GType({
+    parent: HelloWindow.type,
+    name: "InheritedWindow",
+    class_init: function(klass, prototype)
+    {
+        testsuite.assert(1)
+    },
+    init: function()
+    {
+    }
+})
 
+b = new InheritedWindow()
+testsuite.checkAsserts(1)
diff --git a/tests/javascript/gtypes/gtype-gtype.js b/tests/javascript/gtypes/gtype-gtype.js
index 88d8a00..3bbe418 100755
--- a/tests/javascript/gtypes/gtype-gtype.js
+++ b/tests/javascript/gtypes/gtype-gtype.js
@@ -1,31 +1,29 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:Hi\nHi\nbye
-// STDERR:
-Gtk = imports.gi.Gtk;
-Gtk.init(Seed.argv);
 
-HelloWindowType = {
- parent: Gtk.Window.type,
- name: "HelloWindow",
- init: function(){
-    print("Hi");
-  }
-};
+testsuite = imports.testsuite
+Gtk = imports.gi.Gtk
+Gtk.init(Seed.argv)
 
-HelloWindow = new GType(HelloWindowType);
-w = new HelloWindow();
+HelloWindow = new GType({
+    parent: Gtk.Window.type,
+    name: "HelloWindow",
+    init: function(self)
+    {
+        self.id = 5
+    }
+})
 
-InheritedWindowType = {
- parent: HelloWindow.type,
- name: "InheritedWindow",
- init: function(){
-    print("bye");
-  }
-};
+InheritedWindow = new GType({
+    parent: HelloWindow.type,
+    name: "InheritedWindow",
+    init: function(self)
+    {
+        self.id = 10
+    }
+})
 
-InheritedWindow = new GType(InheritedWindowType);
-
-b = new InheritedWindow();
+w = new HelloWindow()
+b = new InheritedWindow()
 
+testsuite.assert(w.id == 5)
+testsuite.assert(b.id == 10)
diff --git a/tests/javascript/gtypes/gtype-property-construct.js b/tests/javascript/gtypes/gtype-property-construct.js
index c93f446..daa828b 100755
--- a/tests/javascript/gtypes/gtype-property-construct.js
+++ b/tests/javascript/gtypes/gtype-property-construct.js
@@ -1,30 +1,41 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:1
-// STDERR:
 
-Gtk = imports.gi.Gtk;
-GObject = imports.gi.GObject;
-Gtk.init(Seed.argv);
+testsuite = imports.testsuite
+Gtk = imports.gi.Gtk
+GObject = imports.gi.GObject
+Gtk.init(Seed.argv)
 
-HelloWindowType = {
-parent: Gtk.Window.type,
-name: "HelloWindow",
-class_init: function(klass, prototype)
-{
-	klass.c_install_property(GObject.param_spec_boolean("test",
-													  "test property",
-													  "A test property!",
-													  false,
-													  GObject.ParamFlags.CONSTRUCT | GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE));
-},
-init: function()
-{
-  print(this.test);
-}};
+HelloWindow = new GType({
+    parent: Gtk.Window.type,
+    name: "HelloWindow",
+    class_init: function(klass, prototype)
+    {
+        klass.c_install_property(GObject.param_spec_boolean(
+                                 "test",
+                                 "test property",
+                                 "A test property!",
+                                 false,
+                                 GObject.ParamFlags.CONSTRUCT | 
+                                     GObject.ParamFlags.READABLE | 
+                                     GObject.ParamFlags.WRITABLE))
+    },
+    init: function()
+    {
+        testsuite.assert(this.test == true)
+    }
+})
+
+w = new HelloWindow({test: true})
 
-HelloWindow = new GType(HelloWindowType);
-w = new HelloWindow({test: true});
+testsuite.assert(w.test == true)
 
+try
+{
+    w.test = "arst"
+}
+catch(e)
+{
+    testsuite.assert(e.name == "ConversionError")
+}
 
+testsuite.checkAsserts(3)
diff --git a/tests/javascript/gtypes/gtype-property-nice.js b/tests/javascript/gtypes/gtype-property-nice.js
index d8958a8..ed0613d 100755
--- a/tests/javascript/gtypes/gtype-property-nice.js
+++ b/tests/javascript/gtypes/gtype-property-nice.js
@@ -1,32 +1,30 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:1\n1\n0
-// STDERR:
 
-GObject = imports.gi.GObject;
-Gtk = imports.gi.Gtk;
-Gtk.init(Seed.argv);
+testsuite = imports.testsuite
+GObject = imports.gi.GObject
+Gtk = imports.gi.Gtk
+Gtk.init(Seed.argv)
 
-HelloWindowType = {
+HelloWindow = new GType({
     parent: Gtk.Window.type,
     name: "HelloWindow",
-    properties: [{name: "randomproperty",
-		  type: GObject.TYPE_BOOLEAN,
-		  nick: "randomproperty",
-		  blurb: "longer blurb about property",
-		  default_value: true,
-		  flags: (GObject.ParamFlags.CONSTRUCT | GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE)}],
+    properties: [{
+        name: "randomproperty",
+        type: GObject.TYPE_BOOLEAN,
+        nick: "randomproperty",
+        blurb: "longer blurb about property",
+        default_value: true,
+        flags: (GObject.ParamFlags.CONSTRUCT | GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE)}],
     init: function(klass)
     {
 
-    }};
+    }
+})
 
-HelloWindow = new GType(HelloWindowType);
-w = new HelloWindow();
+w = new HelloWindow()
 
-print(w.randomproperty);
-w.randomproperty = 5;
-print(w.randomproperty);
-w.randomproperty = 0;
-print(w.randomproperty);
+testsuite.assert(w.randomproperty == 1)
+w.randomproperty = 5
+testsuite.assert(w.randomproperty == 1)
+w.randomproperty = 0
+testsuite.assert(w.randomproperty == 0)
diff --git a/tests/javascript/gtypes/gtype-property.js b/tests/javascript/gtypes/gtype-property.js
index e8ba56e..f30e46d 100755
--- a/tests/javascript/gtypes/gtype-property.js
+++ b/tests/javascript/gtypes/gtype-property.js
@@ -1,31 +1,30 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:1\n0
-// STDERR:
 
-Gtk = imports.gi.Gtk;
-GObject = imports.gi.GObject;
-Gtk.init(Seed.argv);
+testsuite = imports.testsuite
+Gtk = imports.gi.Gtk
+GObject = imports.gi.GObject
+Gtk.init(Seed.argv)
 
-HelloWindowType = {
-parent: Gtk.Window.type,
-name: "HelloWindow",
-class_init: function(klass, prototype)
-{
-	klass.c_install_property(GObject.param_spec_boolean("test",
-													  "test property",
-													  "A test property!",
-													  false,
-													  GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE));
-},
-init: function()
-{
-}};
+HelloWindow = new GType({
+    parent: Gtk.Window.type,
+    name: "HelloWindow",
+    class_init: function(klass, prototype)
+    {
+        klass.c_install_property(GObject.param_spec_boolean(
+            "test",
+            "test property",
+            "A test property!",
+            false,
+            GObject.ParamFlags.READABLE | 
+                GObject.ParamFlags.WRITABLE))
+    },
+    init: function()
+    {
+    }
+})
 
-HelloWindow = new GType(HelloWindowType);
-w = new HelloWindow({test: true});
-print(w.test);
-w = new HelloWindow();
-print(w.test);
+w = new HelloWindow({test: true})
+testsuite.assert(w.test == true)
+w = new HelloWindow()
+testsuite.assert(w.test == false)
 
diff --git a/tests/javascript/gtypes/gtype-self.js b/tests/javascript/gtypes/gtype-self.js
index 542e8a3..256a7ae 100755
--- a/tests/javascript/gtypes/gtype-self.js
+++ b/tests/javascript/gtypes/gtype-self.js
@@ -1,21 +1,18 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:1
-// STDERR:
 
-Gtk = imports.gi.Gtk;
-Gtk.init(Seed.argv);
+testsuite = imports.testsuite
+Gtk = imports.gi.Gtk
+Gtk.init(Seed.argv)
 
-HelloWindowType = {
+HelloWindow = new GType({
     parent: Gtk.Window.type,
     name: "HelloWindow",
-    init: function(self){
-	print(this==self);
-    }};
+    init: function(self)
+    {
+	    testsuite.assert(this == self)
+    }
+})
 
-HelloWindow = new GType(HelloWindowType);
-w = new HelloWindow();
-
-w.show();
+w = new HelloWindow()
 
+testsuite.checkAsserts(1)
diff --git a/tests/javascript/gtypes/gtype-signal-args.js b/tests/javascript/gtypes/gtype-signal-args.js
index 872ffd4..02853a5 100755
--- a/tests/javascript/gtypes/gtype-signal-args.js
+++ b/tests/javascript/gtypes/gtype-signal-args.js
@@ -1,29 +1,29 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:2 Test\n\[object GtkWindow\]
-// STDERR:
 
-Gtk = imports.gi.Gtk;
-GObject = imports.gi.GObject;
-Gtk.init(Seed.argv);
+testsuite = imports.testsuite
+Gtk = imports.gi.Gtk
+GObject = imports.gi.GObject
+Gtk.init(Seed.argv)
 
 HelloWindow = new GType({
     parent: Gtk.Window.type,
     name: "HelloWindow",
     signals: [{name: "hello",
-	       parameters: [GObject.TYPE_INT,
-			    GObject.TYPE_STRING],
-	       return_type: Gtk.Window.type}]
-});
+               parameters: [GObject.TYPE_INT,
+                            GObject.TYPE_STRING],
+               return_type: Gtk.Window.type}]
+})
 
-w = new HelloWindow();
+w = new HelloWindow()
 
 w.signal.hello.connect(function(object, number, string)
-                       {
-                           var win = new Gtk.Window();
-                           print(number + " " + string);
-                           return win;
-                       });
-print(w.signal.hello.emit(2, "Test"));
+{
+   var win = new Gtk.Window()
+   testsuite.assert(number == 2)
+   testsuite.assert(string == "Test")
+   return win
+})
 
+testsuite.assert(w.signal.hello.emit(2, "Test") instanceof Gtk.Window)
+
+testsuite.checkAsserts(3)
diff --git a/tests/javascript/gtypes/gtype-signal.js b/tests/javascript/gtypes/gtype-signal.js
index 1fbb949..1705f10 100755
--- a/tests/javascript/gtypes/gtype-signal.js
+++ b/tests/javascript/gtypes/gtype-signal.js
@@ -1,24 +1,23 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:Hello\nGoodbye
-// STDERR:
 
-Gtk = imports.gi.Gtk;
-Gtk.init(Seed.argv);
+testsuite = imports.testsuite
+Gtk = imports.gi.Gtk
+Gtk.init(Seed.argv)
 
 HelloWindowType = {
     parent: Gtk.Window.type,
     name: "HelloWindow",
     signals: [{name: "hello"}, {name: "goodbye"}]
-};
+}
 
-HelloWindow = new GType(HelloWindowType);
-w = new HelloWindow();
+HelloWindow = new GType(HelloWindowType)
+w = new HelloWindow()
 
-w.signal.hello.connect(function(){print("Hello");});
-w.signal.goodbye.connect(function(){print("Goodbye");});
+w.signal.hello.connect(function(){hello = 5})
+w.signal.goodbye.connect(function(){goodbye = 10})
 
-w.signal.hello.emit();
-w.signal.goodbye.emit();
+w.signal.hello.emit()
+w.signal.goodbye.emit()
 
+testsuite.assert(hello == 5)
+testsuite.assert(goodbye == 10)
diff --git a/tests/javascript/gtypes/gtype-typerror.js b/tests/javascript/gtypes/gtype-typerror.js
index 3af6191..27ec47a 100755
--- a/tests/javascript/gtypes/gtype-typerror.js
+++ b/tests/javascript/gtypes/gtype-typerror.js
@@ -1,17 +1,18 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:GType constructor expected GType for parent
-// STDERR:
-
-Gtk = imports.gi.Gtk;
 
+testsuite = imports.testsuite
+Gtk = imports.gi.Gtk
 
 HelloWindowType = {
     parent: "Mom",
     name: "HelloWindow"
-};
+}
 
-try{
-    HelloWindow = new GType(HelloWindowType);
-} catch (e) {print(e.message);}
+try
+{
+    HelloWindow = new GType(HelloWindowType)
+}
+catch (e)
+{
+    testsuite.assert(e.message == "GType constructor expected GType for parent")
+}
diff --git a/tests/javascript/gtypes/gtype.js b/tests/javascript/gtypes/gtype.js
index 71b8103..9a3af7b 100755
--- a/tests/javascript/gtypes/gtype.js
+++ b/tests/javascript/gtypes/gtype.js
@@ -1,33 +1,33 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:In klass init\nIn constructor for \[object HelloWindow\]\nPrototypes!\nIn map, verifying widget\.title : Hello!
-// STDERR:
 
-Gtk = imports.gi.Gtk;
-Gtk.init(Seed.argv);
+testsuite = imports.testsuite
+Gtk = imports.gi.Gtk
 
-HelloWindowType = {
+Gtk.init(Seed.argv)
+
+HelloWindow = new GType({
     parent: Gtk.Window.type,
     name: "HelloWindow",
     class_init: function(klass, prototype)
     {
-        prototype.message = "Prototypes!";
-        print("In klass init");
+        prototype.message = "Prototypes!"
     },
-    init: function(klass)
+    init: function(self)
     {
-        this.title = "Hello!";
-        print("In constructor for " + this);
-    }};
+        this.title = "Hello!"
+    }
+})
+
+w = new HelloWindow()
+
+testsuite.assert(w.message = "Prototypes!")
 
-HelloWindow = new GType(HelloWindowType);
-w = new HelloWindow();
-print(w.message);
 w.signal.map.connect(
-             function(widget)
-             {
-                 print("In map, verifying widget.title : " + widget.title);
-             });
-w.show();
+    function(widget)
+    {
+        testsuite.assert(widget.title == "Hello!")
+    })
+
+w.show()
 
+testsuite.checkAsserts(2)
diff --git a/tests/javascript/gtypes/testsuite.js b/tests/javascript/gtypes/testsuite.js
new file mode 120000
index 0000000..78d069d
--- /dev/null
+++ b/tests/javascript/gtypes/testsuite.js
@@ -0,0 +1 @@
+../testsuite.js
\ No newline at end of file
diff --git a/tests/javascript/gvalue-argument.js b/tests/javascript/gvalue-argument.js
index 0d0112b..b3a6462 100755
--- a/tests/javascript/gvalue-argument.js
+++ b/tests/javascript/gvalue-argument.js
@@ -1,8 +1,4 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:
-// STDERR:
 
 Gtk = imports.gi.Gtk;
 GObject = imports.gi.GObject
diff --git a/tests/javascript/include-syntax.js b/tests/javascript/include-syntax.js
index fc935d8..950d0c6 100755
--- a/tests/javascript/include-syntax.js
+++ b/tests/javascript/include-syntax.js
@@ -1,7 +1,16 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:
-// STDERR:\n\*\* \(seed:[0-9]+\): CRITICAL \*\*: Line 6 in syntax-test\.js: SyntaxError Parse error
 
-Seed.include("syntax-test.js");
+testsuite = imports.testsuite
+
+try
+{
+    Seed.include("syntax-test-noasserts.js")
+    testsuite.unreachable()
+}
+catch(e)
+{
+    testsuite.assert(e instanceof SyntaxError)
+}
+
+testsuite.checkAsserts(1)
+
diff --git a/tests/javascript/include.js b/tests/javascript/include.js
index 1c3285f..ccc71de 100755
--- a/tests/javascript/include.js
+++ b/tests/javascript/include.js
@@ -1,7 +1,3 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:Hello, world!
-// STDERR:
 
-Seed.include("print.js");
+Seed.include("json.js");
diff --git a/tests/javascript/introspect.js b/tests/javascript/introspect.js
index ddac59a..b02f991 100755
--- a/tests/javascript/introspect.js
+++ b/tests/javascript/introspect.js
@@ -1,12 +1,15 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:\{"name":"set_opacity","return_type":"void","args":\{"0":\{"type":"double"\}\}\}
-// STDERR:
 
-Gtk = imports.gi.Gtk;
-JSON = imports.JSON;
+testsuite = imports.testsuite
+Gtk = imports.gi.Gtk
+JSON = imports.JSON
 
-Gtk.init(Seed.argv);
-win = new Gtk.Window();
-print(JSON.stringify(Seed.introspect(win.set_opacity)));
+Gtk.init(Seed.argv)
+
+win = new Gtk.Window()
+
+info = Seed.introspect(win.set_opacity)
+
+testsuite.assert(info.name == "set_opacity")
+testsuite.assert(info.return_type == "void")
+testsuite.assert(info.args[0].type == "double")
diff --git a/tests/javascript/json-constructor.js b/tests/javascript/json-constructor.js
index 2acfce9..2c2a262 100755
--- a/tests/javascript/json-constructor.js
+++ b/tests/javascript/json-constructor.js
@@ -1,15 +1,12 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:JSON Win!
-// STDERR:
 
-Gtk = imports.gi.Gtk;
-GLib = imports.gi.GLib;
+testsuite = imports.testsuite
+Gtk = imports.gi.Gtk
+GLib = imports.gi.GLib
 
-Gtk.init(Seed.argv);
-window = new Gtk.Window({title: "JSON Win!"});
-window.show_all();
+Gtk.init(Seed.argv)
 
-print(window.title);
+window = new Gtk.Window({title: "JSON Win!"})
+window.show_all()
 
+testsuite.assert(window.title == "JSON Win!")
diff --git a/tests/javascript/json.js b/tests/javascript/json.js
index db1d09a..2035046 100755
--- a/tests/javascript/json.js
+++ b/tests/javascript/json.js
@@ -1,16 +1,20 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:
-// STDERR:
+
+testsuite = imports.testsuite;
 JSON = imports.JSON;
 
 a = {test: 3,
      hello: "Goodbye",
-     more: {a: "1", b: 2, c:"d"}};
-json = JSON.stringify(a);
-object = JSON.parse(json);
-json2 = JSON.stringify(object);
-if (json != json2)
-    print("Failure");
+     more: {a: "1", b: 2, c:"d"}}
+
+json = JSON.stringify(a)
+object = JSON.parse(json)
+json2 = JSON.stringify(object)
+
+testsuite.assert(json == json2)
+testsuite.assert(object.test == 3)
+testsuite.assert(object.hello == "Goodbye")
+testsuite.assert(object.more.a == "1")
+testsuite.assert(object.more.b == 2)
+testsuite.assert(object.more.c == "d")
 
diff --git a/tests/javascript/list-test.js b/tests/javascript/list-test.js
index 8a9948d..bfc1505 100755
--- a/tests/javascript/list-test.js
+++ b/tests/javascript/list-test.js
@@ -1,20 +1,20 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:\[object GtkButton\],\[object GtkButton\]\n\[object GtkButton\]\n\[object GtkButton\]
-// STDERR:
 
-Gtk = imports.gi.Gtk;
+testsuite = imports.testsuite
+Gtk = imports.gi.Gtk
 
-Gtk.init(Seed.argv);
+Gtk.init(Seed.argv)
 
-b1 = new Gtk.Button();
-b2 = new Gtk.Button();
-vbox = new Gtk.VBox();
-vbox.pack_start(b1);
-vbox.pack_start(b2);
+b1 = new Gtk.Button()
+b2 = new Gtk.Button()
+vbox = new Gtk.VBox()
+vbox.pack_start(b1)
+vbox.pack_start(b2)
+
+children = vbox.get_children()
+
+testsuite.assert(children[0] instanceof Gtk.Button)
+testsuite.assert(children[1] instanceof Gtk.Button)
+testsuite.assert(children[0] != children[1])
+testsuite.assert(children.length == 2)
 
-children = vbox.get_children();
-print(children);
-print(children[0]);
-print(children[1]);
diff --git a/tests/javascript/modules-noasserts.js b/tests/javascript/modules-noasserts.js
new file mode 100755
index 0000000..e421322
--- /dev/null
+++ b/tests/javascript/modules-noasserts.js
@@ -0,0 +1,25 @@
+#!/usr/bin/env seed
+
+// This test is merely to appease the coverage checker (calls init in each
+// module); it will also catch unresolved symbol errors in the modules.
+
+try
+{
+	cairo = imports.cairo;
+	canvas = imports.canvas;
+	dbus = imports.dbus;
+	example = imports.example;
+	gettext = imports.gettext;
+	gtkbuilder = imports.gtkbuilder;
+	libxml = imports.libxml;
+	mpfr = imports.mpfr;
+	Multiprocessing = imports.Multiprocessing;
+	os = imports.os;
+	readline = imports.readline;
+	sandbox = imports.sandbox;
+	sqlite = imports.sqlite;
+}
+catch(e)
+{
+
+}
diff --git a/tests/javascript/modules.js b/tests/javascript/modules.js
index af4e927..cfc4f5a 100755
--- a/tests/javascript/modules.js
+++ b/tests/javascript/modules.js
@@ -1,29 +1,8 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:.*
-// STDERR:
 
-// This test is merely to appease the coverage checker (calls init in each
-// module); it will also catch unresolved symbol errors in the modules.
+testsuite = imports.testsuite
 
-try
-{
-	cairo = imports.cairo;
-	canvas = imports.canvas;
-	dbus = imports.dbus;
-	example = imports.example;
-	gettext = imports.gettext;
-	gtkbuilder = imports.gtkbuilder;
-	libxml = imports.libxml;
-	mpfr = imports.mpfr;
-	Multiprocessing = imports.Multiprocessing;
-	os = imports.os;
-	readline = imports.readline;
-	sandbox = imports.sandbox;
-	sqlite = imports.sqlite;
-}
-catch(e)
-{
+input = Seed.spawn("/usr/bin/env seed modules-noasserts.js");
+
+testsuite.assert(input.stdout == "Hello Seed Module World\n")
 
-}
diff --git a/tests/javascript/native-closure-exception.js b/tests/javascript/native-closure-exception.js
index d8799f5..3820025 100755
--- a/tests/javascript/native-closure-exception.js
+++ b/tests/javascript/native-closure-exception.js
@@ -1,18 +1,28 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:
-// STDERR:\n\*\* \(seed:[0-9]+\): WARNING \*\*: Exception in closure marshal\. Line 12 in .*\/native-closure-exception\.js: ReferenceError Can't find variable: a
 
-Gtk = imports.gi.Gtk;
-Gtk.init(Seed.argv);
+// TODO: shouldn't the exception be passed back to the caller?
 
-w = new Gtk.Window();
-vbox = new Gtk.VBox();
+testsuite = imports.testsuite
+Gtk = imports.gi.Gtk
+Gtk.init(Seed.argv)
 
-closure = function(widget){a.a.a;};
-w.add(vbox);
+w = new Gtk.Window()
+vbox = new Gtk.VBox()
 
-vbox.pack_start(new Gtk.Label());
+closure = function(widget){a.a.a}
+w.add(vbox)
 
-vbox.foreach(closure);
+vbox.pack_start(new Gtk.Label())
+
+try
+{
+    vbox.foreach(closure)
+    // ARST testsuite.unreachable()
+}
+catch(e)
+{
+    testsuite.assert(e instanceof ReferenceError)
+}
+
+//testsuite.checkAsserts
+print("This test doesn't work yet...")
diff --git a/tests/javascript/native-closure.js b/tests/javascript/native-closure.js
index 90c3ebc..fdcebb3 100755
--- a/tests/javascript/native-closure.js
+++ b/tests/javascript/native-closure.js
@@ -1,19 +1,20 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:\[object GtkLabel\]\n\[object GtkButton\]
-// STDERR:
 
-Gtk = imports.gi.Gtk;
-Gtk.init(Seed.argv);
+testsuite = imports.testsuite
+Gtk = imports.gi.Gtk
+Gtk.init(Seed.argv)
 
-w = new Gtk.Window();
-vbox = new Gtk.VBox();
+w = new Gtk.Window()
+vbox = new Gtk.VBox()
 
-closure = function(widget){print(widget);};
-w.add(vbox);
+closure = function(widget) {
+    testsuite.assert(widget instanceof Gtk.Label || widget instanceof Gtk.Button)
+}
+w.add(vbox)
 
-vbox.pack_start(new Gtk.Label());
-vbox.pack_start(new Gtk.Button());
+vbox.pack_start(new Gtk.Label())
+vbox.pack_start(new Gtk.Button())
 
-vbox.foreach(closure);
+vbox.foreach(closure)
+
+testsuite.checkAsserts(2)
diff --git a/tests/javascript/object-info.js b/tests/javascript/object-info.js
index 78a9372..36b8c9d 100755
--- a/tests/javascript/object-info.js
+++ b/tests/javascript/object-info.js
@@ -1,23 +1,24 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:Window implements interfaces\nInterface: (Buildable|ImplementorIface)\nInterface: (Buildable|ImplementorIface)
-// STDERR:
 
-Gtk = imports.gi.Gtk;
-GIRepository = imports.gi.GIRepository;
+testsuite = imports.testsuite
+Gtk = imports.gi.Gtk
+GIRepository = imports.gi.GIRepository
 
-gir = GIRepository.IRepository.get_default();
+gir = GIRepository.IRepository.get_default()
 
-info = gir.find_by_gtype(Gtk.Window.type);
-print(GIRepository.base_info_get_name(info) + " implements interfaces");
+info = gir.find_by_gtype(Gtk.Window.type)
+testsuite.assert(GIRepository.base_info_get_name(info) == "Window")
 
-n = GIRepository.object_info_get_n_interfaces(info);
+n = GIRepository.object_info_get_n_interfaces(info)
 for (i = 0; i < n; i++)
 {
-	property = GIRepository.object_info_get_interface(info, i);
-	print("Interface: " + GIRepository.base_info_get_name(property));
-	GIRepository.base_info_unref(property);
+    property = GIRepository.object_info_get_interface(info, i)
+    propertyname = GIRepository.base_info_get_name(property)
+    testsuite.assert(propertyname == "Buildable" ||
+                     propertyname == "ImplementorIface")
+    GIRepository.base_info_unref(property)
 }
 
-GIRepository.base_info_unref(info);
+GIRepository.base_info_unref(info)
+
+testsuite.checkAsserts(3)
diff --git a/tests/javascript/out-test.js b/tests/javascript/out-test.js
index c048987..900b64d 100755
--- a/tests/javascript/out-test.js
+++ b/tests/javascript/out-test.js
@@ -1,15 +1,15 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:5 100
-// STDERR:
 
-Gtk = imports.gi.Gtk;
-Gtk.init(Seed.argv);
+testsuite = imports.testsuite
+Gtk = imports.gi.Gtk
 
-w = new Gtk.Window({width_request: 5, height_request: 100});
-o1 = { };
-o2 = { };
+Gtk.init(Seed.argv)
 
-w.get_size_request(o1, o2);
-print(o1.value + " " +  o2.value);
+w = new Gtk.Window({width_request: 5, height_request: 100})
+o1 = { }
+o2 = { }
+
+w.get_size_request(o1, o2)
+
+testsuite.assert(o1.value == 5)
+testsuite.assert(o2.value == 100)
diff --git a/tests/javascript/property-benchmark.js b/tests/javascript/property-benchmark.js
index ba5e8c9..3a242ec 100755
--- a/tests/javascript/property-benchmark.js
+++ b/tests/javascript/property-benchmark.js
@@ -1,8 +1,6 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:
-// STDERR:
+
+// TODO: this test doesn't do anything
 
 Gtk = imports.gi.Gtk;
 Gtk.init(Seed.argv);
diff --git a/tests/javascript/property-glib-exception.js b/tests/javascript/property-glib-exception.js
index 139e60a..4c2b2cd 100755
--- a/tests/javascript/property-glib-exception.js
+++ b/tests/javascript/property-glib-exception.js
@@ -1,11 +1,20 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:
-// STDERR:\n\*\* \(seed:[0-9]+\): CRITICAL \*\*: Line 10 in .*\/property-glib-exception\.js: PropertyError value "3\.000000" of type `gdouble' is invalid or out of range for property `opacity' of type `gdouble'
 
-Gtk = imports.gi.Gtk;
-Gtk.init(Seed.argv);
+testsuite = imports.testsuite
+Gtk = imports.gi.Gtk
 
-window = new Gtk.Window();
-window.opacity = 3;
+Gtk.init(Seed.argv)
+
+window = new Gtk.Window()
+
+try
+{
+    window.opacity = 3
+}
+catch(e)
+{
+    testsuite.assert(e.name == "PropertyError")
+    testsuite.assert(e.message == "value \"3.000000\" of type `gdouble' is invalid or out of range for property `opacity' of type `gdouble'")
+}
+
+testsuite.checkAsserts(2)
diff --git a/tests/javascript/quit.js b/tests/javascript/quit.js
index 358a859..4103cc1 100755
--- a/tests/javascript/quit.js
+++ b/tests/javascript/quit.js
@@ -1,7 +1,4 @@
 #!/usr/bin/env seed
-// Returns: 1
-// STDIN:
-// STDOUT:
-// STDERR:
 
-Seed.quit(1);
+Seed.quit(0)
+imports.testsuite.unreachable()
diff --git a/tests/javascript/signals/Makefile.am b/tests/javascript/signals/Makefile.am
index f816e22..27f286d 100644
--- a/tests/javascript/signals/Makefile.am
+++ b/tests/javascript/signals/Makefile.am
@@ -6,4 +6,15 @@ EXTRA_DIST = \
 	signal-invalid.js \
 	signal.js \
 	signal-nofunc.js \
+	signal-userdata.js \
+	testsuite.js
+
+TESTS = \
+    signal-connect.js \
+	signal-disconnect.js \
+	signal-exception.js \
+	signal-expects.js \
+	signal-invalid.js \
+	signal.js \
+	signal-nofunc.js \
 	signal-userdata.js
diff --git a/tests/javascript/signals/signal-connect.js b/tests/javascript/signals/signal-connect.js
index 6f63f34..38b717a 100755
--- a/tests/javascript/signals/signal-connect.js
+++ b/tests/javascript/signals/signal-connect.js
@@ -1,21 +1,19 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:\[object GtkButton\]\n1\n0\.5
-// STDERR:
 
-Gtk = imports.gi.Gtk;
-Gtk.init(Seed.argv);
+testsuite = imports.testsuite
+Gtk = imports.gi.Gtk
+Gtk.init(Seed.argv)
 
 function handle_opacity_change(obj, gobject, user_data)
 {
-	print(user_data);
-	print(user_data === button);
-	print(obj.opacity);
+	testsuite.assert(user_data instanceof Gtk.Button)
+	testsuite.assert(user_data === button)
+	testsuite.assert(obj.opacity == 0.5)
 }
 
-win = new Gtk.Window();
-button = new Gtk.Button();
-win.signal.connect("notify::opacity", handle_opacity_change, button);
-win.opacity = 0.5;
+win = new Gtk.Window()
+button = new Gtk.Button()
+win.signal.connect("notify::opacity", handle_opacity_change, button)
+win.opacity = 0.5
 
+testsuite.checkAsserts(3)
diff --git a/tests/javascript/signals/signal-disconnect.js b/tests/javascript/signals/signal-disconnect.js
index 737d4e0..df81509 100755
--- a/tests/javascript/signals/signal-disconnect.js
+++ b/tests/javascript/signals/signal-disconnect.js
@@ -1,18 +1,21 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:Signal handler called
-// STDERR:
-Gtk = imports.gi.Gtk;
-Gtk.init(Seed.argv);
 
-function test(){
-    print("Signal handler called");
+testsuite = imports.testsuite
+Gtk = imports.gi.Gtk
+Gtk.init(Seed.argv)
+
+myglobal = 0
+
+function test()
+{
+    myglobal += 1234
 }
 
-w = new Gtk.Window();
-id = w.signal.map.connect(test);
-w.show_all();
-w.hide();
-w.signal.disconnect(id);
-w.show_all();
+w = new Gtk.Window()
+id = w.signal.map.connect(test)
+w.show_all()
+w.hide()
+w.signal.disconnect(id)
+w.show_all()
+
+testsuite.assert(myglobal == 1234)
diff --git a/tests/javascript/signals/signal-exception.js b/tests/javascript/signals/signal-exception.js
index 9d4c86b..860f1a7 100755
--- a/tests/javascript/signals/signal-exception.js
+++ b/tests/javascript/signals/signal-exception.js
@@ -4,10 +4,13 @@
 // STDOUT:
 // STDERR:\n\*\* \(seed:[0-9]+\): WARNING \*\*: Exception in closure .*
 
+testsuite = imports.testsuite
 Gtk = imports.gi.Gtk;
 Gtk.init(Seed.argv);
 
 w = new Gtk.Window();
 
-w.signal.map.connect(function(){3 = undefined});
-w.show();
+//w.signal.map.connect(function(){3 = undefined});
+//w.show();
+
+print("This is another one of those tests that probably doesn't chain right yet")
diff --git a/tests/javascript/signals/signal-expects.js b/tests/javascript/signals/signal-expects.js
index cb5ac9b..56baa66 100755
--- a/tests/javascript/signals/signal-expects.js
+++ b/tests/javascript/signals/signal-expects.js
@@ -1,17 +1,17 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:In signal
-// STDERR:
 
-Gtk = imports.gi.Gtk;
-Gtk.init(Seed.argv);
+testsuite = imports.testsuite
+Gtk = imports.gi.Gtk
+Gtk.init(Seed.argv)
 
 function expects_test(widget, user_data)
 {
-    print("In signal");
+    testsuite.assert(widget == w)
+    testsuite.assert(user_data == null)
 }
 
-w = new Gtk.Window();
-w.signal.map.connect(expects_test);
-w.show();
+w = new Gtk.Window()
+w.signal.map.connect(expects_test)
+w.show()
+
+testsuite.checkAsserts(2)
diff --git a/tests/javascript/signals/signal-invalid.js b/tests/javascript/signals/signal-invalid.js
index 93bc89b..9d4fe6b 100755
--- a/tests/javascript/signals/signal-invalid.js
+++ b/tests/javascript/signals/signal-invalid.js
@@ -1,10 +1,9 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:\[undefined\]
-// STDERR:
-Gtk = imports.gi.Gtk;
-Gtk.init(Seed.argv);
 
-w = new Gtk.Window();
-print(w.signal.notasignal);
+testsuite = imports.testsuite
+Gtk = imports.gi.Gtk
+Gtk.init(Seed.argv)
+
+w = new Gtk.Window()
+
+testsuite.assert(w.signal.notasignal == undefined)
diff --git a/tests/javascript/signals/signal-nofunc.js b/tests/javascript/signals/signal-nofunc.js
index a661d62..71ca071 100755
--- a/tests/javascript/signals/signal-nofunc.js
+++ b/tests/javascript/signals/signal-nofunc.js
@@ -1,15 +1,19 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:Signal connection requires a function as first argument
-// STDERR:
+
+testsuite = imports.testsuite
 Gtk = imports.gi.Gtk;
 Gtk.init(Seed.argv);
 
 w = new Gtk.Window();
-try{
+
+try
+{
     w.signal.map.connect(3);
+    testsuite.unreachable()
 }
-catch (e){
-    print(e.message);
+catch (e)
+{
+    testsuite.assert(e.message == "Signal connection requires a function as first argument")
 }
+
+testsuite.checkAsserts(1)
diff --git a/tests/javascript/signals/signal-userdata.js b/tests/javascript/signals/signal-userdata.js
index f163a72..c18d717 100755
--- a/tests/javascript/signals/signal-userdata.js
+++ b/tests/javascript/signals/signal-userdata.js
@@ -1,9 +1,6 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:\{"Hello":"World"\}
-// STDERR:
 
+testsuite = imports.testsuite
 Gtk = imports.gi.Gtk;
 JSON = imports.JSON;
 
@@ -11,9 +8,11 @@ Gtk.init(Seed.argv);
 
 function userdata_test(widget, user_data)
 {
-    print(JSON.stringify(user_data));
+    testsuite.assert(user_data.Hello == "World")
 }
 
 w = new Gtk.Window();
 w.signal.map.connect(userdata_test, {Hello: "World"});
 w.show();
+
+testsuite.checkAsserts(1)
diff --git a/tests/javascript/signals/signal.js b/tests/javascript/signals/signal.js
index f01eda3..41b6fa3 100755
--- a/tests/javascript/signals/signal.js
+++ b/tests/javascript/signals/signal.js
@@ -1,18 +1,17 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:Window mapped.
-// STDERR:
 
-Gtk = imports.gi.Gtk;
-Gtk.init(Seed.argv);
+testsuite = imports.testsuite
+Gtk = imports.gi.Gtk
+Gtk.init(Seed.argv)
 
 function mapped(window)
 {
-    print("Window mapped.");
+    testsuite.assert(window == w)
 }
 
-w = new Gtk.Window();
-w.signal.map.connect(mapped);
+w = new Gtk.Window()
+w.signal.map.connect(mapped)
 
-w.show_all();
+w.show_all()
+
+testsuite.checkAsserts(1)
diff --git a/tests/javascript/signals/testsuite.js b/tests/javascript/signals/testsuite.js
new file mode 120000
index 0000000..78d069d
--- /dev/null
+++ b/tests/javascript/signals/testsuite.js
@@ -0,0 +1 @@
+../testsuite.js
\ No newline at end of file
diff --git a/tests/javascript/sqlite.js b/tests/javascript/sqlite.js
index 0afeacf..0d02392 100755
--- a/tests/javascript/sqlite.js
+++ b/tests/javascript/sqlite.js
@@ -1,27 +1,32 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:\{"t1key":"1","data":"This is sample data","num":"3\.0","timeEnter":null\}\n\{"t1key":"2","data":"More sample data","num":"6\.0","timeEnter":null\}\n\{"t1key":"3","data":"And a little more","num":"9\.0","timeEnter":null\}
-// STDERR:
-Gio = imports.gi.Gio;
-sqlite = imports.sqlite;
-JSON = imports.JSON;
 
-try{
-    Gio.file_new_for_path("/tmp/.seed_test.db")["delete"]();
+testsuite = imports.testsuite
+Gio = imports.gi.Gio
+sqlite = imports.sqlite
+JSON = imports.JSON
+
+try
+{
+    Gio.file_new_for_path("/tmp/.seed_test.db")["delete"]()
 }
-catch(e){
+catch(e)
+{
+    // We don't care if we fail to delete the (probably nonexistent) file...
 }
 
-d = new sqlite.Database("/tmp/.seed_test.db");
+d = new sqlite.Database("/tmp/.seed_test.db")
+
+d.exec("create table t1 (t1key INTEGER PRIMARY KEY,data TEXT,num double,timeEnter DATE)")
+d.exec("insert into t1 (data,num) values ('This is sample data',3)")
+d.exec("insert into t1 (data,num) values ('More sample data',6)")
+d.exec("insert into t1 (data,num) values ('And a little more',9)")
 
-d.exec("create table t1 (t1key INTEGER PRIMARY KEY,data TEXT,num double,timeEnter DATE);");
-d.exec("insert into t1 (data,num) values ('This is sample data',3);");
-d.exec("insert into t1 (data,num) values ('More sample data',6);");
-d.exec("insert into t1 (data,num) values ('And a little more',9);");
+d.exec("select * from t1 where num = 6", function(results) {
+    testsuite.assert(results.t1key == "2")
+    testsuite.assert(results.data == "More sample data")
+    testsuite.assert(results.num == 6.0)
+})
 
-d.exec("select * from t1", function(results){
-    print(JSON.stringify(results));
-});
+d.close()
 
-d.close();
+testsuite.checkAsserts(3)
diff --git a/tests/javascript/structs/Makefile.am b/tests/javascript/structs/Makefile.am
index 62a22b1..81044ea 100644
--- a/tests/javascript/structs/Makefile.am
+++ b/tests/javascript/structs/Makefile.am
@@ -5,5 +5,15 @@ EXTRA_DIST = \
 	struct-nested-set.js \
 	struct-union-enumerate.js \
 	struct-enumerate.js \
+	struct-offsets.js \
+	testsuite.js
+
+TESTS = \
+	struct-functions.js \
+	struct-set-member.js \
+	struct-constructor.js \
+	struct-nested-set.js \
+	struct-union-enumerate.js \
+	struct-enumerate.js \
 	struct-offsets.js
 
diff --git a/tests/javascript/structs/struct-constructor.js b/tests/javascript/structs/struct-constructor.js
index 5c56d35..bff4f09 100755
--- a/tests/javascript/structs/struct-constructor.js
+++ b/tests/javascript/structs/struct-constructor.js
@@ -1,13 +1,10 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:100\n90\n80
-// STDERR:
 
-Gdk = imports.gi.Gdk;
+testsuite = imports.testsuite
+Gdk = imports.gi.Gdk
 
-c = new Gdk.Color({red: 100});
-print(c.red);
-c = new Gdk.Color({red: 90, blue: 80});
-print(c.red);
-print(c.blue);
+c = new Gdk.Color({red: 100})
+testsuite.assert(c.red == 100)
+c = new Gdk.Color({red: 90, blue: 80})
+testsuite.assert(c.red == 90)
+testsuite.assert(c.blue == 80)
diff --git a/tests/javascript/structs/struct-enumerate.js b/tests/javascript/structs/struct-enumerate.js
index 54456a5..4ddc1c9 100755
--- a/tests/javascript/structs/struct-enumerate.js
+++ b/tests/javascript/structs/struct-enumerate.js
@@ -1,13 +1,13 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:x\ny\nwidth\nheight\nintersect\nunion
-// STDERR:
 
-Gdk = imports.gi.Gdk;
+testsuite = imports.testsuite
+Gdk = imports.gi.Gdk
 
-r = new Gdk.Rectangle();
+r = new Gdk.Rectangle()
 for (prop in r)
 {
-	print(prop);
+	testsuite.assert(prop == "x" || prop == "y" || prop == "width" || 
+	                 prop == "height" || prop == "intersect" || prop == "union")
 }
+
+testsuite.checkAsserts(6)
diff --git a/tests/javascript/structs/struct-functions.js b/tests/javascript/structs/struct-functions.js
index 9bc8978..31fb769 100755
--- a/tests/javascript/structs/struct-functions.js
+++ b/tests/javascript/structs/struct-functions.js
@@ -1,11 +1,10 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:
-// STDERR:
 
-GConf = imports.gi.GConf;
+testsuite = imports.testsuite
+GConf = imports.gi.GConf
 
-GConf.init(Seed.argv);
+GConf.init(Seed.argv)
 
-client = GConf.Client.get_default();
+client = GConf.Client.get_default()
+
+testsuite.assert(client != undefined)
diff --git a/tests/javascript/structs/struct-nested-set.js b/tests/javascript/structs/struct-nested-set.js
index f8fb138..7787fe9 100755
--- a/tests/javascript/structs/struct-nested-set.js
+++ b/tests/javascript/structs/struct-nested-set.js
@@ -1,20 +1,17 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:\[object seed_union\]\n1\n300\n400
-// STDERR:
 
-Gdk = imports.gi.Gdk;
+testsuite = imports.testsuite
+Gdk = imports.gi.Gdk
 
-e = new Gdk.Event();
-print(e);
+e = new Gdk.Event()
+testsuite.assert(e.toString() == "[object seed_union]")
 
-e.type = Gdk.EventType.EXPOSE;
-print(Gdk.EventType.EXPOSE == e.type);
+e.type = Gdk.EventType.EXPOSE
+testsuite.assert(Gdk.EventType.EXPOSE == e.type)
 
-r = new Gdk.Rectangle();
-r.x = 300;
-e.rectangle = r;
-print(e.rectangle.x);
-e.rectangle.x = 400;
-print(e.rectangle.x);
\ No newline at end of file
+r = new Gdk.Rectangle()
+r.x = 300
+e.rectangle = r
+testsuite.assert(e.rectangle.x == 300)
+e.rectangle.x = 400
+testsuite.assert(e.rectangle.x == 400)
diff --git a/tests/javascript/structs/struct-offsets.js b/tests/javascript/structs/struct-offsets.js
index 58ca906..4c8a8c7 100755
--- a/tests/javascript/structs/struct-offsets.js
+++ b/tests/javascript/structs/struct-offsets.js
@@ -1,13 +1,10 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:17\n0
-// STDERR:
 
-Pango = imports.gi.Pango;
+testsuite = imports.testsuite
+Pango = imports.gi.Pango
 
-c = new Pango.Color();
-c.red = 17;
+c = new Pango.Color()
+c.red = 17
 
-print(c.red);
-print(c.blue);
+testsuite.assert(c.red == 17)
+testsuite.assert(c.blue == 0)
diff --git a/tests/javascript/structs/struct-set-member.js b/tests/javascript/structs/struct-set-member.js
index 2e05795..d6ebb79 100755
--- a/tests/javascript/structs/struct-set-member.js
+++ b/tests/javascript/structs/struct-set-member.js
@@ -1,12 +1,9 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:0\n200
-// STDERR:
 
-Gdk = imports.gi.Gdk;
+testsuite = imports.testsuite
+Gdk = imports.gi.Gdk
 
-color = new Gdk.Color();
-print(color.red);
-color.red = 200;
-print(color.red);
+color = new Gdk.Color()
+testsuite.assert(color.red == 0)
+color.red = 200
+testsuite.assert(color.red == 200)
diff --git a/tests/javascript/structs/struct-union-enumerate.js b/tests/javascript/structs/struct-union-enumerate.js
index 7ddfbc7..81ab3cd 100755
--- a/tests/javascript/structs/struct-union-enumerate.js
+++ b/tests/javascript/structs/struct-union-enumerate.js
@@ -1,26 +1,30 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:\* type\n\* any\n   \* type\n   \* window\n   \* send_event\n\* expose\n   \* type\n   \* window\n   \* send_event\n   \* area\n      \* x\n      \* y\n      \* width\n      \* height\n      \* intersect\n      \* union\n   \* region\n      \* copy\n      \* destroy\n      \* get_clipbox\n      \* get_rectangles\n      \* empty\n      \* equal\n      \* rect_equal\n      \* point_in\n      \* rect_in\n      \* offset\n      \* shrink\n      \* union_with_rect\n      \* intersect\n      \* union\n      \* subtract\n      \* xor\n      \* spans_intersect_foreach\n   \* count\n\* no_expose\n   \* type\n   \* window\n   \* send_event\n\* visibility\n   \* type\n   \* window\n   \* send_event\n   \* state\n\* motion\n   \* type\n   \* window\n   \* send_event\n   \* time\n   \* x\n   \* y\n   \* axes\n   \* state\n   \* is_hint\n   \* device\n   \* x_root\n   \* y_root\n\* button\n   \* type\n   \* window\n   \* send_event\n   \* time\n   \* x\n   \* y\n   \* axes\n   \
 * state\n   \* button\n   \* device\n   \* x_root\n   \* y_root\n\* scroll\n   \* type\n   \* window\n   \* send_event\n   \* time\n   \* x\n   \* y\n   \* state\n   \* direction\n   \* device\n   \* x_root\n   \* y_root\n\* key\n   \* type\n   \* window\n   \* send_event\n   \* time\n   \* state\n   \* keyval\n   \* length\n   \* string\n   \* hardware_keycode\n   \* group\n   \* is_modifier\n\* crossing\n   \* type\n   \* window\n   \* send_event\n   \* subwindow\n   \* time\n   \* x\n   \* y\n   \* x_root\n   \* y_root\n   \* mode\n   \* detail\n   \* focus\n   \* state\n\* focus_change\n   \* type\n   \* window\n   \* send_event\n   \* in\n\* configure\n   \* type\n   \* window\n   \* send_event\n   \* x\n   \* y\n   \* width\n   \* height\n\* property\n   \* type\n   \* window\n   \* send_event\n   \* atom\n      \* name\n   \* time\n   \* state\n\* selection\n   \* type\n   \* window\n   \* send_event\n   \* selection\n      \* name\n   \* target\n      \* name\n   \* 
 property\n      \* name\n   \* time\n   \* requestor\n\* owner_change\n   \* type\n   \* window\n   \* send_event\n   \* owner\n   \* reason\n   \* selection\n      \* name\n   \* time\n   \* selection_time\n\* proximity\n   \* type\n   \* window\n   \* send_event\n   \* time\n   \* device\n\* client\n   \* type\n   \* window\n   \* send_event\n   \* message_type\n      \* name\n\* dnd\n   \* type\n   \* window\n   \* send_event\n   \* context\n   \* time\n\* window_state\n   \* type\n   \* window\n   \* send_event\n   \* changed_mask\n   \* new_window_state\n\* setting\n   \* type\n   \* window\n   \* send_event\n   \* action\n   \* name\n\* grab_broken\n   \* type\n   \* window\n   \* send_event\n   \* keyboard\n   \* implicit\n   \* grab_window\n\* put\n\* copy\n\* free\n\* get_time\n\* get_state\n\* get_coords\n\* get_root_coords\n\* get_axis\n\* set_screen\n\* get_screen\n\* send_client_message\n\* send_clientmessage_toall\n\* get_symbol
-// STDERR:
 
-// TODO: enum methods work now. do we support them?
-// We don't here! They're what broke this test...
+// The way this test stood, it didn't make any sense. It still doesn't, but
+// at least now it's not fragile based on Gdk version, and will still be
+// triggered by the only flaw this test has ever caught...
 
-Gdk = imports.gi.Gdk;
+testsuite = imports.testsuite
+Gdk = imports.gi.Gdk
+
+maxindent = 0
+propcount = 0
 
 function enum_structlike(indent, e)
 {
+    if(indent > maxindent)
+        maxindent = indent
+    
 	for (prop in e)
 	{
-		print(indent + "* " + prop);
-		
+	    propcount++
+	    
 		try
 		{
 			if (e[prop] && e[prop].toString() && 
 				(e[prop].toString().search("struct") > 0 ||
 				e[prop].toString().search("union") > 0))
-				enum_structlike(indent + "   ", e[prop]);
+				enum_structlike(indent + 1, e[prop])
 		}
 		catch(e)
 		{
@@ -29,6 +33,9 @@ function enum_structlike(indent, e)
 	}
 }
 
-e = new Gdk.Event();
+e = new Gdk.Event()
+
+enum_structlike(0, e)
 
-enum_structlike("", e);
+testsuite.assert(maxindent >= 2)
+testsuite.assert(propcount >= 50)
diff --git a/tests/javascript/structs/testsuite.js b/tests/javascript/structs/testsuite.js
new file mode 120000
index 0000000..78d069d
--- /dev/null
+++ b/tests/javascript/structs/testsuite.js
@@ -0,0 +1 @@
+../testsuite.js
\ No newline at end of file
diff --git a/tests/javascript/syntax-test-noasserts.js b/tests/javascript/syntax-test-noasserts.js
new file mode 100755
index 0000000..a0e12f1
--- /dev/null
+++ b/tests/javascript/syntax-test-noasserts.js
@@ -0,0 +1 @@
+new = 3
diff --git a/tests/javascript/syntax-test.js b/tests/javascript/syntax-test.js
index 15f0a02..33dae46 100755
--- a/tests/javascript/syntax-test.js
+++ b/tests/javascript/syntax-test.js
@@ -1,7 +1,15 @@
 #!/usr/bin/env seed
-// Returns: 1
-// STDIN:
-// STDOUT:
-// STDERR:\n\*\* \(seed:[0-9]+\): CRITICAL \*\*: Line 6 in .*\/syntax-test\.js: SyntaxError Parse error
 
-new = 3
+testsuite = imports.testsuite
+
+try
+{
+    eval("new = 3")
+    testsuite.unreachable()
+}
+catch(e)
+{
+    testsuite.assert(e instanceof SyntaxError)
+}
+
+testsuite.checkAsserts(1)
diff --git a/tests/javascript/testsuite.js b/tests/javascript/testsuite.js
new file mode 100755
index 0000000..a4d845e
--- /dev/null
+++ b/tests/javascript/testsuite.js
@@ -0,0 +1,32 @@
+assertCount = 0
+
+function assert(a, err)
+{
+    assertCount++
+    
+    if(!a)
+    {
+        if(err)
+            print("Assertion " + assertCount + " failed: " + err + ".")
+        else
+            print("Assertion " + assertCount + " failed.")
+        
+        Seed.quit(assertCount)
+    }
+}
+
+function unreachable(err)
+{
+    if(err)
+        print("Unreachable code reached: " + err.toString() + ".")
+    else
+        print("Unreachable code reached.")
+    
+    Seed.quit(1)
+}
+
+function checkAsserts(n)
+{
+    if(assertCount != n)
+        assert(0, "Some assertions failed to run")
+}
diff --git a/tests/javascript/type-conversion.js b/tests/javascript/type-conversion.js
index 9a397c1..3ed7d97 100755
--- a/tests/javascript/type-conversion.js
+++ b/tests/javascript/type-conversion.js
@@ -1,27 +1,29 @@
 #!/usr/bin/env seed
-// Returns: 0
-// STDIN:
-// STDOUT:Can not convert Javascript value to boolean\nCan not convert Javascript value to int
-// STDERR:
 
-Gtk = imports.gi.Gtk;
-Gtk.init(Seed.argv);
+testsuite = imports.testsuite
+Gtk = imports.gi.Gtk
+Gtk.init(Seed.argv)
 
-actor = new Gtk.Window();
-tests = [
-	"actor.accept_focus = 'hello'",
-	"actor.default_width = actor"];
+actor = new Gtk.Window()
 
-
-for ( i in tests )
+try
+{
+    actor.accept_focus = 'hello'
+    testsuite.unreachable()
+}
+catch(e)
 {
-	try
-	{
-		eval(tests[i]);
-	}
-	catch (e)
-	{
-		print(e.message);
-	}
+    testsuite.assert(e.message = "Can not convert Javascript value to boolean")
+}
 
+try
+{
+    actor.default_width = actor
+    testsuite.unreachable()
+}
+catch(e)
+{
+    testsuite.assert(e.message = "Can not convert Javascript value to int")
 }
+
+testsuite.checkAsserts(2)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]