-
Notifications
You must be signed in to change notification settings - Fork 77
AutomatedTests
BridJ has grown big and there are many things to test.
If you build BridJ from sources, you can run a given test MyTest
with mvn test -Dtest=MyTest
.
These tests target Pointer
, PointerIO
and CommonPointerIOs
classes.
PointerTest
is generated out of a Velocity template that iterates on all BridJ primitives (java primitives + CLong
+ SizeT
+ Pointer
) to make sure that all method variations in Pointer
are covered.
TODO:
- more tests with non-null byteOffset !
- fix 3D arrays
Trivial test on simple structs.
TODO:
- more tests !
Not functional !
Tests that specifically target some past or present bugs.
Trivial enum argument calls.
TODO:
- more tests !
Test GCC4 and VC9 C++ demanglers (given known mangled names, check we get back the expected signature).
TODO:
- more tests, especially for VC9 !
Basic C++ calls tests, including virtual vs. non-virtual calls, different calling conventions on supported platforms (__stdcall...), destructor (including virtual destructor), static methods...
Windows-only test, just makes sure COM initializes well and that some known interface is instantiable.
TODO:
- more tests !!!
Compares performance of BridJ against JNA and Javolution :
- Makes sure BridJ structs are one or two orders of magnitude faster that JNA structs for some operations (cast, creation...), and faster in all cases.
- Compare calls of simple functions with JNA in direct and indirect modes and make sure BridJ is between 2-3x faster than JNA's direct mode and 20-30x faster than JNA's indirect mode.
Test basic Java to C and C to Java callbacks.
Make sure BridJ is able to extract symbols from its native library
Template-generated test that has two parts : a native C++ file, compiled in libtest.so / test.dll / libtest.dylib, and a Java class that binds to the generated functions defined in the native test library.
Makes sure the generated functions return what we expect (result based on input arguments, varying their types thanks to the template).
It's easy to create a test coverage report by yourself if you build BridJ from sources :
mvn cobertura:cobertura site
The coverage report is then in target/site/cobertura
.
Every once in a while, we publish test coverage reports of the development version of BridJ. If you want up-to-date reports, you should rather build BridJ from sources and look at the preceding section.
BridJ's Latest Published Cobertura Report
Quick links within this report :