seed r654 - in trunk/tests: . javascript
- From: hortont svn gnome org
- To: svn-commits-list gnome org
- Subject: seed r654 - in trunk/tests: . javascript
- Date: Mon, 5 Jan 2009 08:13:17 +0000 (UTC)
Author: hortont
Date: Mon Jan 5 08:13:17 2009
New Revision: 654
URL: http://svn.gnome.org/viewvc/seed?rev=654&view=rev
Log:
Move tests into a subdir. Getting ready to add C tests (to test API, etc.)
Added:
trunk/tests/javascript/
trunk/tests/javascript/COPYING
trunk/tests/javascript/Makefile.am
trunk/tests/javascript/argv.js (props changed)
- copied unchanged from r652, /trunk/tests/argv.js
trunk/tests/javascript/builtin-argument-length.js (props changed)
- copied unchanged from r652, /trunk/tests/builtin-argument-length.js
trunk/tests/javascript/c-module.js (props changed)
- copied unchanged from r652, /trunk/tests/c-module.js
trunk/tests/javascript/check-syntax.js (props changed)
- copied unchanged from r652, /trunk/tests/check-syntax.js
trunk/tests/javascript/closure-finalization.js (props changed)
- copied unchanged from r652, /trunk/tests/closure-finalization.js
trunk/tests/javascript/compare.js (props changed)
- copied unchanged from r652, /trunk/tests/compare.js
trunk/tests/javascript/constructor-args.js (props changed)
- copied unchanged from r652, /trunk/tests/constructor-args.js
trunk/tests/javascript/constructor-prototype.js (props changed)
- copied unchanged from r652, /trunk/tests/constructor-prototype.js
trunk/tests/javascript/enum.js (props changed)
- copied unchanged from r652, /trunk/tests/enum.js
trunk/tests/javascript/fork.js (props changed)
- copied unchanged from r652, /trunk/tests/fork.js
trunk/tests/javascript/function-info.js (props changed)
- copied unchanged from r652, /trunk/tests/function-info.js
trunk/tests/javascript/gdk-event.js (props changed)
- copied unchanged from r652, /trunk/tests/gdk-event.js
trunk/tests/javascript/gerror.js (props changed)
- copied unchanged from r652, /trunk/tests/gerror.js
trunk/tests/javascript/gobject-scope.js (props changed)
- copied unchanged from r652, /trunk/tests/gobject-scope.js
trunk/tests/javascript/gtype-class-init-exception.js (contents, props changed)
- copied, changed from r652, /trunk/tests/gtype-class-init-exception.js
trunk/tests/javascript/gtype-property.js (props changed)
- copied unchanged from r652, /trunk/tests/gtype-property.js
trunk/tests/javascript/gtype-signal-exception.js (props changed)
- copied unchanged from r652, /trunk/tests/gtype-signal-exception.js
trunk/tests/javascript/gtype-signal.js (props changed)
- copied unchanged from r652, /trunk/tests/gtype-signal.js
trunk/tests/javascript/gtype-typerror.js (props changed)
- copied unchanged from r652, /trunk/tests/gtype-typerror.js
trunk/tests/javascript/gtype.js (props changed)
- copied unchanged from r652, /trunk/tests/gtype.js
trunk/tests/javascript/include-syntax.js (props changed)
- copied unchanged from r652, /trunk/tests/include-syntax.js
trunk/tests/javascript/include.js (props changed)
- copied unchanged from r652, /trunk/tests/include.js
trunk/tests/javascript/introspect.js (props changed)
- copied unchanged from r652, /trunk/tests/introspect.js
trunk/tests/javascript/json-constructor.js (props changed)
- copied unchanged from r652, /trunk/tests/json-constructor.js
trunk/tests/javascript/json.js (props changed)
- copied unchanged from r652, /trunk/tests/json.js
trunk/tests/javascript/list-test.js (props changed)
- copied unchanged from r652, /trunk/tests/list-test.js
trunk/tests/javascript/namespace-exception-test.js (props changed)
- copied unchanged from r652, /trunk/tests/namespace-exception-test.js
trunk/tests/javascript/native-closure-exception.js (contents, props changed)
- copied, changed from r652, /trunk/tests/native-closure-exception.js
trunk/tests/javascript/native-closure.js (props changed)
- copied unchanged from r652, /trunk/tests/native-closure.js
trunk/tests/javascript/object-info.js (props changed)
- copied unchanged from r652, /trunk/tests/object-info.js
trunk/tests/javascript/out-test.js (props changed)
- copied unchanged from r652, /trunk/tests/out-test.js
trunk/tests/javascript/print.js (props changed)
- copied unchanged from r652, /trunk/tests/print.js
trunk/tests/javascript/printf.js (props changed)
- copied unchanged from r652, /trunk/tests/printf.js
trunk/tests/javascript/printprint.js (props changed)
- copied unchanged from r652, /trunk/tests/printprint.js
trunk/tests/javascript/property-benchmark.js (props changed)
- copied unchanged from r652, /trunk/tests/property-benchmark.js
trunk/tests/javascript/property-glib-exception.js (contents, props changed)
- copied, changed from r652, /trunk/tests/property-glib-exception.js
trunk/tests/javascript/quit.js (props changed)
- copied unchanged from r652, /trunk/tests/quit.js
trunk/tests/javascript/quit2.js (props changed)
- copied unchanged from r652, /trunk/tests/quit2.js
trunk/tests/javascript/readline.js (props changed)
- copied unchanged from r652, /trunk/tests/readline.js
trunk/tests/javascript/readline_bind.js (props changed)
- copied unchanged from r653, /trunk/tests/readline_bind.js
trunk/tests/javascript/signal-connect.js (props changed)
- copied unchanged from r652, /trunk/tests/signal-connect.js
trunk/tests/javascript/signal-exception.js (contents, props changed)
- copied, changed from r652, /trunk/tests/signal-exception.js
trunk/tests/javascript/signal-expects.js (props changed)
- copied unchanged from r652, /trunk/tests/signal-expects.js
trunk/tests/javascript/signal-userdata.js (props changed)
- copied unchanged from r652, /trunk/tests/signal-userdata.js
trunk/tests/javascript/signal.js (props changed)
- copied unchanged from r652, /trunk/tests/signal.js
trunk/tests/javascript/spawn.js (props changed)
- copied unchanged from r652, /trunk/tests/spawn.js
trunk/tests/javascript/sqlite.js (props changed)
- copied unchanged from r652, /trunk/tests/sqlite.js
trunk/tests/javascript/struct-constructor.js (props changed)
- copied unchanged from r652, /trunk/tests/struct-constructor.js
trunk/tests/javascript/struct-enumerate.js (props changed)
- copied unchanged from r652, /trunk/tests/struct-enumerate.js
trunk/tests/javascript/struct-functions.js (props changed)
- copied unchanged from r652, /trunk/tests/struct-functions.js
trunk/tests/javascript/struct-nested-set.js (props changed)
- copied unchanged from r652, /trunk/tests/struct-nested-set.js
trunk/tests/javascript/struct-offsets.js (props changed)
- copied unchanged from r652, /trunk/tests/struct-offsets.js
trunk/tests/javascript/struct-set-member.js (props changed)
- copied unchanged from r652, /trunk/tests/struct-set-member.js
trunk/tests/javascript/struct-union-enumerate.js (props changed)
- copied unchanged from r652, /trunk/tests/struct-union-enumerate.js
trunk/tests/javascript/syntax-test.js (contents, props changed)
- copied, changed from r652, /trunk/tests/syntax-test.js
trunk/tests/javascript/type-conversion.js (props changed)
- copied unchanged from r652, /trunk/tests/type-conversion.js
Removed:
trunk/tests/argv.js
trunk/tests/builtin-argument-length.js
trunk/tests/c-module.js
trunk/tests/check-syntax.js
trunk/tests/closure-finalization.js
trunk/tests/compare.js
trunk/tests/constructor-args.js
trunk/tests/constructor-prototype.js
trunk/tests/enum.js
trunk/tests/fork.js
trunk/tests/function-info.js
trunk/tests/gdk-event.js
trunk/tests/gerror.js
trunk/tests/gobject-scope.js
trunk/tests/gtype-class-init-exception.js
trunk/tests/gtype-property.js
trunk/tests/gtype-signal-exception.js
trunk/tests/gtype-signal.js
trunk/tests/gtype-typerror.js
trunk/tests/gtype.js
trunk/tests/include-syntax.js
trunk/tests/include.js
trunk/tests/introspect.js
trunk/tests/json-constructor.js
trunk/tests/json.js
trunk/tests/list-test.js
trunk/tests/namespace-exception-test.js
trunk/tests/native-closure-exception.js
trunk/tests/native-closure.js
trunk/tests/object-info.js
trunk/tests/out-test.js
trunk/tests/print.js
trunk/tests/printf.js
trunk/tests/printprint.js
trunk/tests/property-benchmark.js
trunk/tests/property-glib-exception.js
trunk/tests/quit.js
trunk/tests/quit2.js
trunk/tests/readline.js
trunk/tests/readline_bind.js
trunk/tests/signal-connect.js
trunk/tests/signal-exception.js
trunk/tests/signal-expects.js
trunk/tests/signal-userdata.js
trunk/tests/signal.js
trunk/tests/spawn.js
trunk/tests/sqlite.js
trunk/tests/struct-constructor.js
trunk/tests/struct-enumerate.js
trunk/tests/struct-functions.js
trunk/tests/struct-nested-set.js
trunk/tests/struct-offsets.js
trunk/tests/struct-set-member.js
trunk/tests/struct-union-enumerate.js
trunk/tests/syntax-test.js
trunk/tests/type-conversion.js
Modified:
trunk/tests/Makefile.am
trunk/tests/run-tests.py
Modified: trunk/tests/Makefile.am
==============================================================================
--- trunk/tests/Makefile.am (original)
+++ trunk/tests/Makefile.am Mon Jan 5 08:13:17 2009
@@ -1,60 +1,8 @@
+SUBDIRS = javascript
EXTRA_DIST = \
COPYING \
- argv.js \
- closure-finalization.js \
- native-closure-exception.js \
- struct-enumerate.js \
- gtype-class-init-exception.js \
- gtype-property.js \
- struct-union-enumerate.js \
- compare.js \
- include-syntax.js \
- struct-nested-set.js \
- struct-constructor.js \
- function-info.js \
- object-info.js \
- constructor-args.js \
- struct-set-member.js \
- c-module.js \
- constructor-prototype.js \
- struct-offsets.js \
- gtype-typerror.js \
- gtype-signal.js \
- signal-userdata.js \
- gtype-signal-exception.js \
- out-test.js \
- signal-expects.js \
- gtype.js \
- json.js \
- enum.js \
- signal-exception.js \
- gerror.js \
- gobject-scope.js \
- include.js \
- printf.js \
- json-constructor.js \
- list-test.js \
- namespace-exception-test.js \
- print.js \
- printprint.js \
- property-benchmark.js \
- property-glib-exception.js \
- readline.js \
run-tests.py \
- signal.js \
- syntax-test.js \
- type-conversion.js \
- native-closure.js \
- gdk-event.js \
- signal-connect.js \
- struct-functions.js \
- check-syntax.js \
- fork.js \
- quit.js \
- introspect.js \
- builtin-argument-length.js \
make-test.py
-
## File created by the gnome-build tools
Added: trunk/tests/javascript/COPYING
==============================================================================
--- (empty file)
+++ trunk/tests/javascript/COPYING Mon Jan 5 08:13:17 2009
@@ -0,0 +1 @@
+Any code in these tests is to be considered under the MIT license.
Added: trunk/tests/javascript/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/tests/javascript/Makefile.am Mon Jan 5 08:13:17 2009
@@ -0,0 +1,58 @@
+EXTRA_DIST = \
+ COPYING \
+ argv.js \
+ closure-finalization.js \
+ native-closure-exception.js \
+ struct-enumerate.js \
+ gtype-class-init-exception.js \
+ gtype-property.js \
+ struct-union-enumerate.js \
+ compare.js \
+ include-syntax.js \
+ struct-nested-set.js \
+ struct-constructor.js \
+ function-info.js \
+ object-info.js \
+ constructor-args.js \
+ struct-set-member.js \
+ c-module.js \
+ constructor-prototype.js \
+ struct-offsets.js \
+ gtype-typerror.js \
+ gtype-signal.js \
+ signal-userdata.js \
+ gtype-signal-exception.js \
+ out-test.js \
+ signal-expects.js \
+ gtype.js \
+ json.js \
+ enum.js \
+ signal-exception.js \
+ gerror.js \
+ gobject-scope.js \
+ include.js \
+ printf.js \
+ json-constructor.js \
+ list-test.js \
+ namespace-exception-test.js \
+ print.js \
+ printprint.js \
+ property-benchmark.js \
+ property-glib-exception.js \
+ readline.js \
+ signal.js \
+ syntax-test.js \
+ type-conversion.js \
+ native-closure.js \
+ gdk-event.js \
+ signal-connect.js \
+ struct-functions.js \
+ check-syntax.js \
+ fork.js \
+ quit.js \
+ introspect.js \
+ builtin-argument-length.js
+
+
+## File created by the gnome-build tools
+
Copied: trunk/tests/javascript/gtype-class-init-exception.js (from r652, /trunk/tests/gtype-class-init-exception.js)
==============================================================================
--- /trunk/tests/gtype-class-init-exception.js (original)
+++ trunk/tests/javascript/gtype-class-init-exception.js Mon Jan 5 08:13:17 2009
@@ -2,7 +2,7 @@
// Returns: 0
// STDIN:
// STDOUT:
-// STDERR:\n\*\* \(seed:[0-9]+\): WARNING \*\*: Exception in class init closure\. Line 13 in \.\/gtype-class-init-exception\.js: ReferenceError Can't find variable: notAVariable
+// STDERR:\n\*\* \(seed:[0-9]+\): WARNING \*\*: Exception in class init closure\. Line 13 in .*\/gtype-class-init-exception\.js: ReferenceError Can't find variable: notAVariable
Seed.import_namespace("Gtk");
Gtk.init(null, null);
Copied: trunk/tests/javascript/native-closure-exception.js (from r652, /trunk/tests/native-closure-exception.js)
==============================================================================
--- /trunk/tests/native-closure-exception.js (original)
+++ trunk/tests/javascript/native-closure-exception.js Mon Jan 5 08:13:17 2009
@@ -2,7 +2,7 @@
// Returns: 0
// STDIN:
// STDOUT:
-// STDERR:\n\*\* \(seed:[0-9]+\): WARNING \*\*: Exception in closure marshal\. Line 11 in \.\/native-closure-exception\.js: ReferenceError Can't find variable: a
+// STDERR:\n\*\* \(seed:[0-9]+\): WARNING \*\*: Exception in closure marshal\. Line 11 in .*\/native-closure-exception\.js: ReferenceError Can't find variable: a
Seed.import_namespace("Gtk")
Gtk.init(null, null);
Copied: trunk/tests/javascript/property-glib-exception.js (from r652, /trunk/tests/property-glib-exception.js)
==============================================================================
--- /trunk/tests/property-glib-exception.js (original)
+++ trunk/tests/javascript/property-glib-exception.js Mon Jan 5 08:13:17 2009
@@ -2,7 +2,7 @@
// Returns: 0
// STDIN:
// STDOUT:
-// STDERR:\n\*\* \(seed:[0-9]+\): CRITICAL \*\*: PropertyError. value "3.000000" of type `gdouble' is invalid or out of range for property `opacity' of type `gdouble' in ./property-glib-exception.js at line 10
+// STDERR:\n\*\* \(seed:[0-9]+\): CRITICAL \*\*: PropertyError\. value "3\.000000" of type `gdouble' is invalid or out of range for property `opacity' of type `gdouble' in .*\/property-glib-exception\.js at line 10
Seed.import_namespace("Gtk");
Gtk.init(null, null);
Copied: trunk/tests/javascript/signal-exception.js (from r652, /trunk/tests/signal-exception.js)
==============================================================================
--- /trunk/tests/signal-exception.js (original)
+++ trunk/tests/javascript/signal-exception.js Mon Jan 5 08:13:17 2009
@@ -2,7 +2,7 @@
// Returns: 0
// STDIN:
// STDOUT:
-// STDERR:\n\*\* \(seed:[0-9]+\): WARNING \*\*: Exception in signal handler. Line 10 in \.\/signal-exception.js: ReferenceError Left side of assignment is not a reference\.
+// STDERR:\n\*\* \(seed:[0-9]+\): WARNING \*\*: Exception in signal handler. Line 10 in .*\/signal-exception.js: ReferenceError Left side of assignment is not a reference\.
Seed.import_namespace("Gtk");
Gtk.init(null, null);
Copied: trunk/tests/javascript/syntax-test.js (from r652, /trunk/tests/syntax-test.js)
==============================================================================
--- /trunk/tests/syntax-test.js (original)
+++ trunk/tests/javascript/syntax-test.js Mon Jan 5 08:13:17 2009
@@ -2,6 +2,6 @@
// Returns: 1
// STDIN:
// STDOUT:
-// STDERR:\n\*\* \(seed:[0-9]+\): CRITICAL \*\*: SyntaxError\. Parse error in \.\/syntax-test\.js at line 6
+// STDERR:\n\*\* \(seed:[0-9]+\): CRITICAL \*\*: SyntaxError\. Parse error in .*\/syntax-test\.js at line 6
new = 3
Modified: trunk/tests/run-tests.py
==============================================================================
--- trunk/tests/run-tests.py (original)
+++ trunk/tests/run-tests.py Mon Jan 5 08:13:17 2009
@@ -1,27 +1,8 @@
#!/usr/bin/python
-#######################
-# Kram Test Framework #
-# Seed Unit Tests #
-#######################
-
-# So! Ideas...
-# We obviously need not just 'pass' tests, but also 'fail' tests, and to make
-# sure that they throw the correct exceptions. Something a bit more flexible
-# than a Bash script that just checks to make sure all the .jses exit properly.
-
-# I'm thinking of a comment directly after the shebang in the tests that gives
-# expected output (on one line) and expected exit value... scripts get run
-# by Python, which checks the comment and the exit value, runs the tests,
-# and records run information (rev #, uname, test times, etc.) in an
-# easily-emailed format (and append to a log file, for safekeeping).
-
-# Test script could also have an option to perform timing/memory-use tests,
-# automatically running numerous times and averaging, etc... (find a way around
-# launching overhead... reimplement main.c here?), and recording to a running
-# log so we can keep track of performance/mem-use regressions, etc...
-
-# TODO: test return value
+################################
+# Seed Unit Test Framework #
+################################
import os
import re
@@ -31,16 +12,21 @@
passed = []
failed = []
-for f in os.listdir("."):
+mcwd = os.getcwd()
+
+for f in os.listdir("javascript"):
if f.endswith(".js") and not f.endswith("_.js"):
- rfile = open(f, "r")
+ rfile = open(mcwd + "/javascript/"+f, "r")
test_code = rfile.readlines()
test_retval = int(test_code[1].replace("// Returns:","").rstrip().replace("\\n","\n"));
test_in = test_code[2].replace("// STDIN:","").rstrip().replace("\\n","\n");
test_out = "^" + test_code[3].replace("// STDOUT:","").rstrip().replace("\\n","\n") + "$";
test_err = "^" + test_code[4].replace("// STDERR:","").rstrip().replace("\\n","\n") + "$";
- p = subprocess.Popen("./"+f, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True)
+ p = subprocess.Popen(mcwd + "/javascript/" + f, shell=True,
+ stdin=subprocess.PIPE, stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE, close_fds=True,
+ cwd=mcwd+"/javascript/")
(out,err)=(p.stdout, p.stderr)
(run_out,run_err)=p.communicate(test_in + "\004")
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]