[gjs] tests: Add a few early basic tests
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs] tests: Add a few early basic tests
- Date: Thu, 23 Sep 2010 18:16:51 +0000 (UTC)
commit d03a5c363c457ecc6026b72e402b41168bb50eda
Author: Colin Walters <walters verbum org>
Date: Mon Sep 20 13:32:59 2010 -0400
tests: Add a few early basic tests
These very simple js tests exercise the basic infrastructure, before
we drop into more complex unit tests.
Added for XULRunner 1.9.3 porting.
https://bugzilla.gnome.org/show_bug.cgi?id=630413
Makefile-test.am | 4 ++++
test/js/test0010basic.js | 6 ++++++
test/js/test0020importer.js | 6 ++++++
test/js/test0030basicBoxed.js | 8 ++++++++
test/js/test0040mainloop.js | 15 +++++++++++++++
5 files changed, 39 insertions(+), 0 deletions(-)
---
diff --git a/Makefile-test.am b/Makefile-test.am
index a05e8aa..eda994d 100644
--- a/Makefile-test.am
+++ b/Makefile-test.am
@@ -160,6 +160,10 @@ EXTRA_DIST += \
test/js/modules/subA/subB/__init__.js \
test/js/modules/subA/subB/foobar.js \
test/js/modules/subA/subB/baz.js \
+ test/js/test0010basic.js \
+ test/js/test0020importer.js \
+ test/js/test0030basicBoxed.js \
+ test/js/test0040mainloop.js \
test/js/testself.js \
test/js/testByteArray.js \
test/js/testCairo.js \
diff --git a/test/js/test0010basic.js b/test/js/test0010basic.js
new file mode 100644
index 0000000..30bb07b
--- /dev/null
+++ b/test/js/test0010basic.js
@@ -0,0 +1,6 @@
+function testBasic1() {
+ var foo = 1+1;
+ log("1 + 1 = " + foo);
+}
+
+gjstestRun();
diff --git a/test/js/test0020importer.js b/test/js/test0020importer.js
new file mode 100644
index 0000000..8ca444e
--- /dev/null
+++ b/test/js/test0020importer.js
@@ -0,0 +1,6 @@
+function testImporter1() {
+ var GLib = imports.gi.GLib;
+ assertEquals(GLib.MAJOR_VERSION, 2);
+}
+
+gjstestRun();
diff --git a/test/js/test0030basicBoxed.js b/test/js/test0030basicBoxed.js
new file mode 100644
index 0000000..35ec43b
--- /dev/null
+++ b/test/js/test0030basicBoxed.js
@@ -0,0 +1,8 @@
+var Regress = imports.gi.Regress;
+
+function testBasicBoxed() {
+ var a = new Regress.TestSimpleBoxedA();
+ a.some_int = 42;
+}
+
+gjstestRun();
diff --git a/test/js/test0040mainloop.js b/test/js/test0040mainloop.js
new file mode 100644
index 0000000..e1d3479
--- /dev/null
+++ b/test/js/test0040mainloop.js
@@ -0,0 +1,15 @@
+var Mainloop = imports.mainloop;
+
+function testBasicMainloop() {
+ log('running mainloop test');
+ Mainloop.idle_add(function() { Mainloop.quit('testMainloop'); });
+ Mainloop.run('testMainloop');
+ log('mainloop test done');
+}
+
+/* A dangling mainloop idle should get removed and not leaked */
+function testDanglingIdle() {
+ Mainloop.idle_add(function() { return true; });
+}
+
+gjstestRun();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]