diff --git a/.travis.yml b/.travis.yml index 6b23a486f8..f95b306dcb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,8 +9,16 @@ jdk: before_install: - sudo apt-get -qq update - sudo apt-get install ant-optional + - sudo apt-get install wget + - wget --no-check-certificate https://www-us.apache.org/dist//ant/binaries/apache-ant-1.10.7-bin.tar.gz + - tar -xzvf apache-ant-1.10.7-bin.tar.gz + - export PATH=`pwd`/apache-ant-1.10.7/bin:$PATH + +services: + - xvfb before_script: + - export DISPLAY=:99.0 - cd build script: diff --git a/app/src/processing/app/Platform.java b/app/src/processing/app/Platform.java index dc3c8c0da1..d2c58921e5 100644 --- a/app/src/processing/app/Platform.java +++ b/app/src/processing/app/Platform.java @@ -75,6 +75,10 @@ public class Platform { // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + static public boolean isInit() { + return inst != null; + } + static public void init() { try { diff --git a/app/src/processing/app/tools/InstallCommander.java b/app/src/processing/app/tools/InstallCommander.java index 518789d4ce..a846208dae 100644 --- a/app/src/processing/app/tools/InstallCommander.java +++ b/app/src/processing/app/tools/InstallCommander.java @@ -161,4 +161,4 @@ public boolean accept(File dir, String name) { list.append(jar.getAbsolutePath()); } } -} \ No newline at end of file +} diff --git a/app/src/processing/app/ui/Editor.java b/app/src/processing/app/ui/Editor.java index 6780a53100..0e9ab769eb 100644 --- a/app/src/processing/app/ui/Editor.java +++ b/app/src/processing/app/ui/Editor.java @@ -2898,7 +2898,6 @@ public void statusError(String what) { * Show an exception in the editor status bar. */ public void statusError(Exception e) { - e.printStackTrace(); // if (e == null) { // System.err.println("Editor.statusError() was passed a null exception."); // return; @@ -2909,9 +2908,7 @@ public void statusError(Exception e) { // Make sure something is printed into the console // Status bar is volatile - if (!re.isStackTraceEnabled()) { - System.err.println(re.getMessage()); - } + System.err.println(re.getMessage()); // Move the cursor to the line before updating the status bar, otherwise // status message might get hidden by a potential message caused by moving @@ -2940,6 +2937,8 @@ public void statusError(Exception e) { textarea.getLineStopOffset(line) - 1); } } + } else { + e.printStackTrace(); } // Since this will catch all Exception types, spend some time figuring diff --git a/app/test/resources/annotations.expected b/app/test/resources/annotations.expected deleted file mode 100644 index 76d6b79a88..0000000000 --- a/app/test/resources/annotations.expected +++ /dev/null @@ -1,53 +0,0 @@ -import processing.core.*; -import processing.data.*; -import processing.event.*; -import processing.opengl.*; - -import java.io.Serializable; - -import java.util.HashMap; -import java.util.ArrayList; -import java.io.File; -import java.io.BufferedReader; -import java.io.PrintWriter; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; - -public class annotations extends PApplet { - - - -public void setup() { - size(200,200); -} - -@Deprecated -public void banana() { - println("hey"); -} - -@SuppressWarnings({"serial", "rawtypes"}) -class Banana implements Serializable { - -} - -@SuppressWarnings("serial") -class Apple implements Serializable { - -} - -@javax.annotation.Generated(value = {"com.mrfeinberg.ImmortalAroma" -}, - comments="Shazam!", - date="2001-07-04T12:08:56.235-0700") -class Pear {} - static public void main(String[] passedArgs) { - String[] appletArgs = new String[] { "annotations" }; - if (passedArgs != null) { - PApplet.main(concat(appletArgs, passedArgs)); - } else { - PApplet.main(appletArgs); - } - } -} diff --git a/app/test/resources/bug1064.expected b/app/test/resources/bug1064.expected deleted file mode 100644 index d77173b442..0000000000 --- a/app/test/resources/bug1064.expected +++ /dev/null @@ -1,29 +0,0 @@ -import processing.core.*; -import processing.data.*; -import processing.event.*; -import processing.opengl.*; - -import java.util.HashMap; -import java.util.ArrayList; -import java.io.File; -import java.io.BufferedReader; -import java.io.PrintWriter; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; - -public class bug1064 extends PApplet { - public void setup() { -// import "; - noLoop(); - } - - static public void main(String[] passedArgs) { - String[] appletArgs = new String[] { "bug1064" }; - if (passedArgs != null) { - PApplet.main(concat(appletArgs, passedArgs)); - } else { - PApplet.main(appletArgs); - } - } -} diff --git a/app/test/resources/bug136.expected b/app/test/resources/bug136.expected deleted file mode 100644 index 9909098a32..0000000000 --- a/app/test/resources/bug136.expected +++ /dev/null @@ -1,41 +0,0 @@ -import processing.core.*; -import processing.data.*; -import processing.event.*; -import processing.opengl.*; - -import java.util.Collections; - -import java.util.HashMap; -import java.util.ArrayList; -import java.io.File; -import java.io.BufferedReader; -import java.io.PrintWriter; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; - -public class bug136 extends PApplet { - - -java.util.List alist = Collections.synchronizedList(new ArrayList()); - -public void setup() { -size(400, 200); -alist.add("hello"); -} - -public void draw() { -rect(width/4, height/4, width/2, height/2); -synchronized(alist) { -alist.get(0); -} -} - static public void main(String[] passedArgs) { - String[] appletArgs = new String[] { "bug136" }; - if (passedArgs != null) { - PApplet.main(concat(appletArgs, passedArgs)); - } else { - PApplet.main(appletArgs); - } - } -} diff --git a/app/test/resources/bug1362.expected b/app/test/resources/bug1362.expected deleted file mode 100644 index 00c81e622b..0000000000 --- a/app/test/resources/bug1362.expected +++ /dev/null @@ -1,29 +0,0 @@ -import processing.core.*; -import processing.data.*; -import processing.event.*; -import processing.opengl.*; - -import java.util.HashMap; -import java.util.ArrayList; -import java.io.File; -import java.io.BufferedReader; -import java.io.PrintWriter; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; - -public class bug1362 extends PApplet { - public void setup() { -if (true) {} else { new String(); } - noLoop(); - } - - static public void main(String[] passedArgs) { - String[] appletArgs = new String[] { "bug1362" }; - if (passedArgs != null) { - PApplet.main(concat(appletArgs, passedArgs)); - } else { - PApplet.main(appletArgs); - } - } -} diff --git a/app/test/resources/bug1442.expected b/app/test/resources/bug1442.expected deleted file mode 100644 index d48380587e..0000000000 --- a/app/test/resources/bug1442.expected +++ /dev/null @@ -1,28 +0,0 @@ -import processing.core.*; -import processing.data.*; -import processing.event.*; -import processing.opengl.*; - -import java.util.HashMap; -import java.util.ArrayList; -import java.io.File; -import java.io.BufferedReader; -import java.io.PrintWriter; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; - -public class bug1442 extends PApplet { - -public float a() { - return 1.0f; -} - static public void main(String[] passedArgs) { - String[] appletArgs = new String[] { "bug1442" }; - if (passedArgs != null) { - PApplet.main(concat(appletArgs, passedArgs)); - } else { - PApplet.main(appletArgs); - } - } -} diff --git a/app/test/resources/bug1511.expected b/app/test/resources/bug1511.expected deleted file mode 100644 index ca423630f9..0000000000 --- a/app/test/resources/bug1511.expected +++ /dev/null @@ -1,37 +0,0 @@ -import processing.core.*; -import processing.data.*; -import processing.event.*; -import processing.opengl.*; - -import java.io.StringWriter; - -import java.util.HashMap; -import java.util.ArrayList; -import java.io.File; -import java.io.BufferedReader; -import java.io.PrintWriter; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; - -public class bug1511 extends PApplet { - public void setup() { -// \u00df - -/** -* a -*/ - - - noLoop(); - } - - static public void main(String[] passedArgs) { - String[] appletArgs = new String[] { "bug1511" }; - if (passedArgs != null) { - PApplet.main(concat(appletArgs, passedArgs)); - } else { - PApplet.main(appletArgs); - } - } -} diff --git a/app/test/resources/bug1512.expected b/app/test/resources/bug1512.expected deleted file mode 100644 index bb2bd9aa09..0000000000 --- a/app/test/resources/bug1512.expected +++ /dev/null @@ -1,29 +0,0 @@ -import processing.core.*; -import processing.data.*; -import processing.event.*; -import processing.opengl.*; - -import java.util.HashMap; -import java.util.ArrayList; -import java.io.File; -import java.io.BufferedReader; -import java.io.PrintWriter; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; - -public class bug1512 extends PApplet { - public void setup() { -println("oi/*"); - noLoop(); - } - - static public void main(String[] passedArgs) { - String[] appletArgs = new String[] { "bug1512" }; - if (passedArgs != null) { - PApplet.main(concat(appletArgs, passedArgs)); - } else { - PApplet.main(appletArgs); - } - } -} diff --git a/app/test/resources/bug1518a.expected b/app/test/resources/bug1518a.expected deleted file mode 100644 index 49c81c14c3..0000000000 --- a/app/test/resources/bug1518a.expected +++ /dev/null @@ -1,45 +0,0 @@ -import processing.core.*; -import processing.data.*; -import processing.event.*; -import processing.opengl.*; - -import java.util.ArrayList; -import java.util.List; - -import java.util.HashMap; -import java.util.ArrayList; -import java.io.File; -import java.io.BufferedReader; -import java.io.PrintWriter; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; - -public class bug1518a extends PApplet { - - - - -public void setup() -{ -List list = new ArrayList(); -list.add("foo"); -list.add("bar"); -list.add("baz"); - -binarySearch(list, "bar"); -} - -static int binarySearch(List> list, T -key) { -return 0; -} - static public void main(String[] passedArgs) { - String[] appletArgs = new String[] { "bug1518a" }; - if (passedArgs != null) { - PApplet.main(concat(appletArgs, passedArgs)); - } else { - PApplet.main(appletArgs); - } - } -} diff --git a/app/test/resources/bug1518b.expected b/app/test/resources/bug1518b.expected deleted file mode 100644 index 2ca376adfe..0000000000 --- a/app/test/resources/bug1518b.expected +++ /dev/null @@ -1,43 +0,0 @@ -import processing.core.*; -import processing.data.*; -import processing.event.*; -import processing.opengl.*; - -import java.util.ArrayList; -import java.util.List; - -import java.util.HashMap; -import java.util.ArrayList; -import java.io.File; -import java.io.BufferedReader; -import java.io.PrintWriter; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; - -public class bug1518b extends PApplet { - - - - -public void setup() -{ -List list = new ArrayList(); -list.add("foo"); -list.add("bar"); -list.add("baz"); -} - -static int binarySearch(List> list, T -key) { -return 0; -} - static public void main(String[] passedArgs) { - String[] appletArgs = new String[] { "bug1518b" }; - if (passedArgs != null) { - PApplet.main(concat(appletArgs, passedArgs)); - } else { - PApplet.main(appletArgs); - } - } -} diff --git a/app/test/resources/bug1519.pde b/app/test/resources/bug1519.pde deleted file mode 100644 index 6f60573040..0000000000 --- a/app/test/resources/bug1519.pde +++ /dev/null @@ -1,9 +0,0 @@ -import java.util.ArrayList; -import java.util.List; - -void setup() -{ -List list = new ArrayList(); -List>> listOfLists = new ArrayList>(); -listOfLists.add(list); -} diff --git a/app/test/resources/bug1525.expected b/app/test/resources/bug1525.expected deleted file mode 100644 index c1337f7b23..0000000000 --- a/app/test/resources/bug1525.expected +++ /dev/null @@ -1,31 +0,0 @@ -import processing.core.*; -import processing.data.*; -import processing.event.*; -import processing.opengl.*; - -import java.util.HashMap; -import java.util.ArrayList; -import java.io.File; -import java.io.BufferedReader; -import java.io.PrintWriter; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; - -public class bug1525 extends PApplet { - public void setup() { -if (frameCount > (frameRate - 1)) { - println("My head asplode!"); -} - noLoop(); - } - - static public void main(String[] passedArgs) { - String[] appletArgs = new String[] { "bug1525" }; - if (passedArgs != null) { - PApplet.main(concat(appletArgs, passedArgs)); - } else { - PApplet.main(appletArgs); - } - } -} diff --git a/app/test/resources/bug1534.expected b/app/test/resources/bug1534.expected deleted file mode 100644 index 1b61ca49c6..0000000000 --- a/app/test/resources/bug1534.expected +++ /dev/null @@ -1,29 +0,0 @@ -import processing.core.*; -import processing.data.*; -import processing.event.*; -import processing.opengl.*; - -import java.util.HashMap; -import java.util.ArrayList; -import java.io.File; -import java.io.BufferedReader; -import java.io.PrintWriter; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; - -public class bug1534 extends PApplet { - public void setup() { -char c = '\"'; - noLoop(); - } - - static public void main(String[] passedArgs) { - String[] appletArgs = new String[] { "bug1534" }; - if (passedArgs != null) { - PApplet.main(concat(appletArgs, passedArgs)); - } else { - PApplet.main(appletArgs); - } - } -} diff --git a/app/test/resources/bug16.pde b/app/test/resources/bug16.pde deleted file mode 100644 index d787284790..0000000000 --- a/app/test/resources/bug16.pde +++ /dev/null @@ -1,9 +0,0 @@ -println("Here comes an unterminated comment!") - -/* - banana - apple - pear -* / - -println("Do you see what I did there?") diff --git a/app/test/resources/bug1936.expected b/app/test/resources/bug1936.expected deleted file mode 100644 index dd06677b05..0000000000 --- a/app/test/resources/bug1936.expected +++ /dev/null @@ -1,29 +0,0 @@ -import processing.core.*; -import processing.data.*; -import processing.event.*; -import processing.opengl.*; - -import java.util.HashMap; -import java.util.ArrayList; -import java.io.File; -import java.io.BufferedReader; -import java.io.PrintWriter; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; - -public class bug1936 extends PApplet { - public void setup() { -char a = PApplet.parseChar(PApplet.parseByte(PApplet.parseInt("15"))); - noLoop(); - } - - static public void main(String[] passedArgs) { - String[] appletArgs = new String[] { "bug1936" }; - if (passedArgs != null) { - PApplet.main(concat(appletArgs, passedArgs)); - } else { - PApplet.main(appletArgs); - } - } -} diff --git a/app/test/resources/bug281.expected b/app/test/resources/bug281.expected deleted file mode 100644 index ffc6ea5194..0000000000 --- a/app/test/resources/bug281.expected +++ /dev/null @@ -1,32 +0,0 @@ -import processing.core.*; -import processing.data.*; -import processing.event.*; -import processing.opengl.*; - -import java.util.HashMap; -import java.util.ArrayList; -import java.io.File; -import java.io.BufferedReader; -import java.io.PrintWriter; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; - -public class bug281 extends PApplet { - public void setup() { -if ( "monopoly".charAt( 3 ) == '(' ) -{ - println("parcheesi"); -} - noLoop(); - } - - static public void main(String[] passedArgs) { - String[] appletArgs = new String[] { "bug281" }; - if (passedArgs != null) { - PApplet.main(concat(appletArgs, passedArgs)); - } else { - PApplet.main(appletArgs); - } - } -} diff --git a/app/test/resources/bug315g.expected b/app/test/resources/bug315g.expected deleted file mode 100644 index ef5cdffa67..0000000000 --- a/app/test/resources/bug315g.expected +++ /dev/null @@ -1,35 +0,0 @@ -import processing.core.*; -import processing.data.*; -import processing.event.*; -import processing.opengl.*; - -import java.util.HashMap; -import java.util.ArrayList; -import java.io.File; -import java.io.BufferedReader; -import java.io.PrintWriter; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; - -public class bug315g extends PApplet { - public void setup() { -size(480, 120); -smooth(); -int y; -y = 60; -int d; -d = 80; -ellipse(75, y, d, d); - noLoop(); - } - - static public void main(String[] passedArgs) { - String[] appletArgs = new String[] { "bug315g" }; - if (passedArgs != null) { - PApplet.main(concat(appletArgs, passedArgs)); - } else { - PApplet.main(appletArgs); - } - } -} diff --git a/app/test/resources/bug4.expected b/app/test/resources/bug4.expected deleted file mode 100644 index 661de7b807..0000000000 --- a/app/test/resources/bug4.expected +++ /dev/null @@ -1,30 +0,0 @@ -import processing.core.*; -import processing.data.*; -import processing.event.*; -import processing.opengl.*; - -import java.util.HashMap; -import java.util.ArrayList; -import java.io.File; -import java.io.BufferedReader; -import java.io.PrintWriter; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; - -public class bug4 extends PApplet { - public void setup() { -int x = 12; -float u = (PApplet.parseFloat(x)/width); - noLoop(); - } - - static public void main(String[] passedArgs) { - String[] appletArgs = new String[] { "bug4" }; - if (passedArgs != null) { - PApplet.main(concat(appletArgs, passedArgs)); - } else { - PApplet.main(appletArgs); - } - } -} diff --git a/app/test/resources/bug4.pde b/app/test/resources/bug4.pde deleted file mode 100644 index ee3e1a2349..0000000000 --- a/app/test/resources/bug4.pde +++ /dev/null @@ -1,2 +0,0 @@ -int x = 12; -float u = (float(x)/width); \ No newline at end of file diff --git a/app/test/resources/bug400g.expected b/app/test/resources/bug400g.expected deleted file mode 100644 index 92dc4f5776..0000000000 --- a/app/test/resources/bug400g.expected +++ /dev/null @@ -1,34 +0,0 @@ -import processing.core.*; -import processing.data.*; -import processing.event.*; -import processing.opengl.*; - -import java.util.HashMap; -import java.util.ArrayList; -import java.io.File; -import java.io.BufferedReader; -import java.io.PrintWriter; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; - -public class bug400g extends PApplet { - -//// -public void setup(){ - size(100,100); - - if(true){ - } - else{ // Syntax error on token "else", } expected - } -} - static public void main(String[] passedArgs) { - String[] appletArgs = new String[] { "bug400g" }; - if (passedArgs != null) { - PApplet.main(concat(appletArgs, passedArgs)); - } else { - PApplet.main(appletArgs); - } - } -} diff --git a/app/test/resources/bug405.expected b/app/test/resources/bug405.expected deleted file mode 100644 index 48497bec0b..0000000000 --- a/app/test/resources/bug405.expected +++ /dev/null @@ -1,3 +0,0 @@ -for (int i : new int[] {1,2,3}) { - println(i); -} diff --git a/app/test/resources/bug420.expected b/app/test/resources/bug420.expected deleted file mode 100644 index 8ea69d2a79..0000000000 --- a/app/test/resources/bug420.expected +++ /dev/null @@ -1,6 +0,0 @@ -int[] a = new int[] { - 1, 2, 3, 4, 5 -}; -for (int i: a) { - print(i); -} diff --git a/app/test/resources/bug427g.expected b/app/test/resources/bug427g.expected deleted file mode 100644 index aebd136729..0000000000 --- a/app/test/resources/bug427g.expected +++ /dev/null @@ -1,38 +0,0 @@ -import processing.core.*; -import processing.data.*; -import processing.event.*; -import processing.opengl.*; - -import java.util.HashMap; -import java.util.ArrayList; -import java.io.File; -import java.io.BufferedReader; -import java.io.PrintWriter; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; - -public class bug427g extends PApplet { - -static final boolean DEBUG = true; - -public void setup() { - MyClass x = new MyClass(); -} - -public class MyClass { - public MyClass() { - if (DEBUG) println("Debug"); - } -} - - - static public void main(String[] passedArgs) { - String[] appletArgs = new String[] { "bug427g" }; - if (passedArgs != null) { - PApplet.main(concat(appletArgs, passedArgs)); - } else { - PApplet.main(appletArgs); - } - } -} diff --git a/app/test/resources/bug481.expected b/app/test/resources/bug481.expected deleted file mode 100644 index 10d76993ba..0000000000 --- a/app/test/resources/bug481.expected +++ /dev/null @@ -1,32 +0,0 @@ -import processing.core.*; -import processing.data.*; -import processing.event.*; -import processing.opengl.*; - -import java.applet.Applet; - -import java.util.HashMap; -import java.util.ArrayList; -import java.io.File; -import java.io.BufferedReader; -import java.io.PrintWriter; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; - -public class bug481 extends PApplet { - public void setup() { - -Class[] abc = new Class[]{Applet.class}; - noLoop(); - } - - static public void main(String[] passedArgs) { - String[] appletArgs = new String[] { "bug481" }; - if (passedArgs != null) { - PApplet.main(concat(appletArgs, passedArgs)); - } else { - PApplet.main(appletArgs); - } - } -} diff --git a/app/test/resources/bug598.expected b/app/test/resources/bug598.expected deleted file mode 100644 index e3c91eef61..0000000000 --- a/app/test/resources/bug598.expected +++ /dev/null @@ -1,70 +0,0 @@ -import processing.core.*; -import processing.data.*; -import processing.event.*; -import processing.opengl.*; - -import static java.lang.Math.tanh; -import java.util.concurrent.Callable; -import java.util.List; -import java.util.Comparator; -import java.util.Map; -import java.util.Collection; -import java.util.Arrays; -import java.util.HashSet; - -import java.util.HashMap; -import java.util.ArrayList; -import java.io.File; -import java.io.BufferedReader; -import java.io.PrintWriter; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; - -public class bug598 extends PApplet { - -// java 5 torture test - - - - - - - - - - - -private static Comparator rotarapmoc = new Comparator() { - public int compare(final String o1, final String o2) - { - return o1.charAt(o1.length() - 1) - o2.charAt(o2.length() - 1); - } -}; - -final void printClass(T t) { - println(t.getClass()); -} -public final List sortem(final String... strings) { - Arrays.sort(strings, rotarapmoc); - return Arrays.asList(strings); -} - -final Map> -charlesDeGaulle = new HashMap>(); - -public void setup() { - charlesDeGaulle.put("banana", new HashSet()); - charlesDeGaulle.get("banana").add(0); - System.out.println(sortem("aztec", "maya", "spanish", "portuguese")); - printClass(12.d); -} - static public void main(String[] passedArgs) { - String[] appletArgs = new String[] { "bug598" }; - if (passedArgs != null) { - PApplet.main(concat(appletArgs, passedArgs)); - } else { - PApplet.main(appletArgs); - } - } -} diff --git a/app/test/resources/bug5a.expected b/app/test/resources/bug5a.expected deleted file mode 100644 index c29588dfcb..0000000000 --- a/app/test/resources/bug5a.expected +++ /dev/null @@ -1,30 +0,0 @@ -import processing.core.*; -import processing.data.*; -import processing.event.*; -import processing.opengl.*; - -import java.util.HashMap; -import java.util.ArrayList; -import java.io.File; -import java.io.BufferedReader; -import java.io.PrintWriter; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; - -public class bug5a extends PApplet { - public void setup() { -println("The next line should not cause a failure."); -// no newline after me - noLoop(); - } - - static public void main(String[] passedArgs) { - String[] appletArgs = new String[] { "bug5a" }; - if (passedArgs != null) { - PApplet.main(concat(appletArgs, passedArgs)); - } else { - PApplet.main(appletArgs); - } - } -} diff --git a/app/test/resources/bug5b.expected b/app/test/resources/bug5b.expected deleted file mode 100644 index 058be9ab30..0000000000 --- a/app/test/resources/bug5b.expected +++ /dev/null @@ -1,30 +0,0 @@ -import processing.core.*; -import processing.data.*; -import processing.event.*; -import processing.opengl.*; - -import java.util.HashMap; -import java.util.ArrayList; -import java.io.File; -import java.io.BufferedReader; -import java.io.PrintWriter; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; - -public class bug5b extends PApplet { - public void setup() { -println("The next line should not cause a failure."); -/* no newline after me */ - noLoop(); - } - - static public void main(String[] passedArgs) { - String[] appletArgs = new String[] { "bug5b" }; - if (passedArgs != null) { - PApplet.main(concat(appletArgs, passedArgs)); - } else { - PApplet.main(appletArgs); - } - } -} diff --git a/app/test/src/test/processing/mode/java/ParserTests.java b/app/test/src/test/processing/mode/java/ParserTests.java deleted file mode 100644 index 4f565a7d07..0000000000 --- a/app/test/src/test/processing/mode/java/ParserTests.java +++ /dev/null @@ -1,304 +0,0 @@ -package test.processing.mode.java; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; -import static test.processing.mode.java.ProcessingTestUtil.COMPILER; -import static test.processing.mode.java.ProcessingTestUtil.preprocess; -import static test.processing.mode.java.ProcessingTestUtil.res; - -import java.io.File; -import java.io.FileWriter; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import org.junit.BeforeClass; -import org.junit.Test; - -import processing.app.SketchException; -import processing.app.exec.ProcessResult; -import antlr.RecognitionException; - -public class ParserTests { - - @BeforeClass - public static void init() { - ProcessingTestUtil.init(); - } - - static void expectRecognitionException(final String id, - final String expectedMessage, - final int expectedLine) { - try { - preprocess(id, res(id + ".pde")); - fail("Expected to fail with \"" + expectedMessage + "\" on line " - + expectedLine); - } catch (RecognitionException e) { - assertEquals(expectedMessage, e.getMessage()); - assertEquals(expectedLine, e.getLine()); - } catch (Exception e) { - if (!e.equals(e.getCause()) && e.getCause() != null) - fail(e.getCause().toString()); - else - fail(e.toString()); - } - } - - static void expectRunnerException(final String id, - final String expectedMessage, - final int expectedLine) { - try { - preprocess(id, res(id + ".pde")); - fail("Expected to fail with \"" + expectedMessage + "\" on line " - + expectedLine); - } catch (SketchException e) { - assertEquals(expectedMessage, e.getMessage()); - assertEquals(expectedLine, e.getCodeLine()); - } catch (Exception e) { - if (!e.equals(e.getCause()) && e.getCause() != null) - fail(e.getCause().toString()); - else - fail(e.toString()); - } - } - - static void expectCompilerException(final String id, - final String expectedMessage, - final int expectedLine) { - try { - final String program = ProcessingTestUtil - .preprocess(id, res(id + ".pde")); - final ProcessResult compilerResult = COMPILER.compile(id, program); - if (compilerResult.succeeded()) { - fail("Expected to fail with \"" + expectedMessage + "\" on line " - + expectedLine); - } - final String e = compilerResult.getStderr().split("\n")[0]; - final Matcher m = Pattern.compile(":(\\d+):\\s+(.+)$").matcher(e); - m.find(); - assertEquals(expectedMessage, m.group(2)); - assertEquals(String.valueOf(expectedLine), m.group(1)); - } catch (Exception e) { - if (!e.equals(e.getCause()) && e.getCause() != null) - fail(e.getCause().toString()); - else - fail(e.toString()); - } - } - - static void expectGood(final String id) { - try { - final String program = ProcessingTestUtil - .preprocess(id, res(id + ".pde")); - final ProcessResult compilerResult = COMPILER.compile(id, program); - if (!compilerResult.succeeded()) { - System.err.println(program); - System.err.println("----------------------------"); - System.err.println(compilerResult.getStderr()); - fail("Compilation failed with status " + compilerResult.getResult()); - } - - final File expectedFile = res(id + ".expected"); - if (expectedFile.exists()) { - final String expected = ProcessingTestUtil.read(expectedFile); - assertEquals(expected, program); - } else { - System.err.println("WARN: " + id - + " does not have an expected output file. Generating."); - final FileWriter sug = new FileWriter(res(id + ".expected")); - sug.write(ProcessingTestUtil.normalize(program)); - sug.close(); - } - - } catch (Exception e) { - if (!e.equals(e.getCause()) && e.getCause() != null) - fail(e.getCause().toString()); - else - fail(e.toString()); - } - } - - @Test - public void bug4() { - expectGood("bug4"); - } - - @Test - public void bug5a() { - expectGood("bug5a"); - } - - @Test - public void bug5b() { - expectGood("bug5b"); - } - - @Test - public void bug6() { - expectRecognitionException("bug6", "expecting EOF, found '/'", 1); - } - - @Test - public void bug16() { - expectRunnerException("bug16", "Unclosed /* comment */", 2); - } - - @Test - public void bug136() { - expectGood("bug136"); - } - - @Test - public void bug196() { - expectRecognitionException("bug196", - "Web colors must be exactly 6 hex digits. This looks like 5.", 4); - } - - @Test - public void bug281() { - expectGood("bug281"); - } - - @Test - public void bug481() { - expectGood("bug481"); - } - - @Test - public void bug507() { - expectRecognitionException("bug507", "expecting EOF, found 'else'", 5); - } - - @Test - public void bug598() { - expectGood("bug598"); - } - - @Test - public void bug631() { - expectGood("bug631"); - } - - @Test - public void bug763() { - expectRunnerException("bug763", "Unterminated string constant", 6); - } - - @Test - public void bug820() { - expectCompilerException("bug820", "error: variable x1 is already defined in method setup()", 18); - } - - @Test - public void bug1064() { - expectGood("bug1064"); - } - - @Test - public void bug1145() { - expectCompilerException("bug1145", "error: '.' expected", 6); - } - - @Test - public void bug1362() { - expectGood("bug1362"); - } - - @Test - public void bug1390() { - expectGood("bug1390"); - } - - @Test - public void bug1442() { - expectGood("bug1442"); - } - - @Test - public void bug1511() { - expectGood("bug1511"); - } - - @Test - public void bug1512() { - expectGood("bug1512"); - } - - @Test - public void bug1514a() { - expectGood("bug1514a"); - } - - @Test - public void bug1514b() { - expectGood("bug1514b"); - } - - @Test - public void bug1515() { - expectGood("bug1515"); - } - - @Test - public void bug1516() { - expectGood("bug1516"); - } - - @Test - public void bug1517() { - expectGood("bug1517"); - } - - @Test - public void bug1518a() { - expectGood("bug1518a"); - } - - @Test - public void bug1518b() { - expectGood("bug1518b"); - } - - @Test - public void bug1519() { - expectRecognitionException("bug1519", "Maybe too many > characters?", 7); - } - - @Test - public void bug1525() { - expectGood("bug1525"); - } - - @Test - public void bug1532() { - expectRecognitionException("bug1532", "unexpected token: break", 50); - } - - @Test - public void bug1534() { - expectGood("bug1534"); - } - - @Test - public void bug1936() { - expectGood("bug1936"); - } - - @Test - public void bug315g() { - expectGood("bug315g"); - } - - @Test - public void bug400g() { - expectGood("bug400g"); - } - - @Test - public void bug427g() { - expectGood("bug427g"); - } - - @Test - public void annotations() { - expectGood("annotations"); - } -} diff --git a/build/.gitignore b/build/.gitignore index 290988977d..177ce2a9bf 100644 --- a/build/.gitignore +++ b/build/.gitignore @@ -1,2 +1,8 @@ work javadoc + +jre/bin-test +macosx/javafx-sdk-11.0.2 +macosx/jdk-0u4.tgz +macosx/jdk-11.0.4+11 +macosx/jfx-11.0.2.zip diff --git a/build/build.xml b/build/build.xml index 93f2b05415..2500ded8a5 100644 --- a/build/build.xml +++ b/build/build.xml @@ -87,8 +87,8 @@ - - + + @@ -440,7 +440,7 @@ - + @@ -740,7 +740,7 @@ - + @@ -775,7 +775,7 @@