Permalink
Browse files

working on regression tests, and the beginnings of a fix for bug #1

  • Loading branch information...
1 parent 4e790e7 commit 91f4aa8149ecc2b5301d2af7386fa28cd4bcde8d @jdf committed Aug 15, 2010
View
@@ -2,8 +2,10 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="generated"/>
+ <classpathentry kind="src" path="tests"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lib/jython/jython.jar"/>
<classpathentry kind="lib" path="lib/processing/core.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="output" path="bin"/>
</classpath>
View
@@ -2,7 +2,11 @@
Write [Processing](http://processing.org) sketches in Python.
[Jonathan Feinberg](http://mrfeinberg.com) &lt;[jdf@pobox.com](mailto:jdf@pobox.com)&gt;
-
+
+See [known issues](http://wiki.github.com/jdf/processing.py/) and the
+[open bugs in the bug tracker](http://github.com/jdf/processing.py/issues).
+[Report a bug](http://github.com/jdf/processing.py/issues).
+
## How? ##
Quick start:
@@ -150,6 +150,11 @@ public static void main(final String[] args) throws Exception {
// or not readable.
final String sketchSource = read(new FileReader(sketchPath));
+ runSketch(args, sketchPath, sketchSource);
+ }
+
+ public static void runSketch(final String[] args, final String sketchPath,
+ final String sketchSource) throws Exception {
// Recursively search the "libraries" directory for jar files and
// directories containing dynamic libraries, adding them to the
// classpath and the library path respectively.
@@ -179,7 +184,7 @@ public static void main(final String[] args) throws Exception {
PApplet.runSketch(args, applet);
} catch (Throwable t) {
Py.printException(t);
- System.exit(-1);
+ throw new RuntimeException(t);
} finally {
interp.cleanup();
}
@@ -53,6 +53,9 @@
}
});
+ private static final Set<String> PYTHON_BUILTINS = new HashSet<String>(Arrays.asList(
+ "map", "filter", "set", "str"));
+
final Map<String, Binding> bindings = new HashMap<String, Binding>();
public DriverGenerator() {
@@ -0,0 +1,17 @@
+package test.jycessing;
+
+import junit.framework.Assert;
+import jycessing.Runner;
+
+import org.junit.Test;
+
+public class JycessingTests {
+ @Test
+ public void urllib2() {
+ try {
+ Runner.runSketch(new String[] { "urllib2" }, "urllib2.py", "import urllib2");
+ } catch (Exception e) {
+ Assert.fail(e.getMessage());
+ }
+ }
+}

0 comments on commit 91f4aa8

Please sign in to comment.