Skip to content

Commit

Permalink
* Fixed unit tests, added a test for missing py-builtins.js file
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Iversen committed Mar 7, 2011
1 parent cdb68fb commit 2ffee96
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions pyjs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#! /usr/bin/env python

import sys
import os.path
from optparse import OptionParser
from py2js import convert_py2js
Expand Down
6 changes: 5 additions & 1 deletion run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test3(name, in_file=None, known_to_fail=False):
in_file = in_file or name

PYTHON_COMMAND = "python \"%s\" > \"%s\""
PY2JS_COMMAND = "python py2js.py --include-builtins \"%s\" > \"%s\" 2> \"%s\""
PY2JS_COMMAND = "python pyjs.py --include-builtins \"%s\" > \"%s\" 2> \"%s\""
JS_COMMAND = "js -f \"%s\" > \"%s\" 2> \"%s\""
DIFF_COMMAND = "diff \"%s\" \"%s\" > \"%s\""
w = Writer()
Expand All @@ -54,6 +54,10 @@ def test3(name, in_file=None, known_to_fail=False):
w.check(r, known_to_fail)

def main():
if not os.path.exists("py-builtins.js"):
print "py-builtins.js not found. Run 'make' to generate it"
sys.exit(1)

This comment has been minimized.

Copy link
@Neppord

Neppord Mar 7, 2011

Collaborator

i think you should use return instead of sys.exit(1)!? or rais an error.... what if main will be used from a nother scrtipt....?

This comment has been minimized.

Copy link
@chrivers

chrivers Mar 7, 2011

Owner

I fixed this in the newest commit.


parser = OptionParser(usage="%prog [options] filename",
description="py2js tests.")
parser.add_option("-a", "--run-all",
Expand Down

0 comments on commit 2ffee96

Please sign in to comment.