nativelibs4java / JNAerator

JNAerator: native bindings generator for JNA / BridJ / Node.js
http://jnaerator.googlecode.com
504 stars 108 forks source link

Unable to build jnaerator due to test failure #108

Open LowWeiLin opened 8 years ago

LowWeiLin commented 8 years ago

Hello!

I am following the instructions on building using mvn clean install, and I get the following test failure which stops the build. May I know how I can fix this? Thanks!

-------------------------------------------------------------------------------
Test set: com.ochafik.lang.jnaerator.JNAerationTest
-------------------------------------------------------------------------------
Tests run: 123, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 29.906 sec <<< FAILURE! - in com.ochafik.lang.jnaerator.JNAerationTest
test[55](com.ochafik.lang.jnaerator.JNAerationTest)  Time elapsed: 0.066 sec  <<< FAILURE!
java.lang.AssertionError: Error : com.ochafik.lang.compiler.CompilerUtils$CompilationError: Error in file:///TestJNA.java at line 9, col 17 :
    illegal start of expression

1:      import com.sun.jna.*;
2:      import com.sun.jna.ptr.*;
3:      import java.nio.*;
4:      import test.*;
5:      public class TestJNA {
6:          public static void main(String[] args) {
7:              // globals.test / JNA
8:              //#runtime(JNA)
9:>>>               import static test.TestLibrary.*;
10:         }
11:     }
Error in file:///TestJNA.java at line 9, col 24 :
    illegal start of expression

1:      import com.sun.jna.*;
2:      import com.sun.jna.ptr.*;
3:      import java.nio.*;
4:      import test.*;
5:      public class TestJNA {
6:          public static void main(String[] args) {
7:              // globals.test / JNA
8:              //#runtime(JNA)
9:>>>               import static test.TestLibrary.*;
10:         }
11:     }
Error in file:///TestJNA.java at line 9, col 35 :
    ';' expected

1:      import com.sun.jna.*;
2:      import com.sun.jna.ptr.*;
3:      import java.nio.*;
4:      import test.*;
5:      public class TestJNA {
6:          public static void main(String[] args) {
7:              // globals.test / JNA
8:              //#runtime(JNA)
9:>>>               import static test.TestLibrary.*;
10:         }
11:     }
Error in file:///TestJNA.java at line 9, col 48 :
    <identifier> expected

1:      import com.sun.jna.*;
2:      import com.sun.jna.ptr.*;
3:      import java.nio.*;
4:      import test.*;
5:      public class TestJNA {
6:          public static void main(String[] args) {
7:              // globals.test / JNA
8:              //#runtime(JNA)
9:>>>               import static test.TestLibrary.*;
10:         }
11:     }
Error in file:///TestJNA.java at line 9, col 49 :
    illegal start of expression

1:      import com.sun.jna.*;
2:      import com.sun.jna.ptr.*;
3:      import java.nio.*;
4:      import test.*;
5:      public class TestJNA {
6:          public static void main(String[] args) {
7:              // globals.test / JNA
8:              //#runtime(JNA)
9:>>>               import static test.TestLibrary.*;
10:         }
11:     }
 in :
{TestJNA.java=import com.sun.jna.*;
import com.sun.jna.ptr.*;
import java.nio.*;
import test.*;
public class TestJNA {
    public static void main(String[] args) {
        // globals.test / JNA
        //#runtime(JNA)
        import static test.TestLibrary.*;
    }
}}
    at org.junit.Assert.fail(Assert.java:88)
    at org.junit.Assert.assertTrue(Assert.java:41)
    at com.ochafik.lang.jnaerator.JNAerationTest$1.setFinished(JNAerationTest.java:184)
    at com.ochafik.lang.jnaerator.JNAerator.jnaerate(JNAerator.java:1066)
    at com.ochafik.lang.jnaerator.JNAerationTest.test(JNAerationTest.java:137)
quilombodigital commented 8 years ago

same error here. windows 7, jdk 8

kitguy commented 7 years ago

same here, windows 8.1, jdk 8

shibumi commented 7 years ago

same here on windows 8.1, jdk 8 and jdk 7

skylarjhdownes commented 6 years ago

This is still an issue, I'm getting the same result on Windows 10 with JDK 1.8.0_131.

A simple workaround is to bypass the breaking tests by adding @Ignore to \jnaerator\src\test\java\com\ochafik\lang\jnaerator\JNAerationTest.java No idea if the breaking test is warning us about anything important at the moment.

risalfajar commented 1 month ago

Simplest solution is to delete test folder