jcuda-main
jcuda-main copied to clipboard
Add automated tests
The testing procedure and test coverage has to be improved.
One of the main reasons of why there are no proper, automated JUnit tests is that the native library handling in Maven is difficult: The native library has to be available before the tests are run, it has to be in the right path, and the Maven surefire plugin has to be aware of this path. With the improvements of https://github.com/jcuda/jcuda-main/issues/8 , it should become possible to add proper unit tests and execute them automatically.
Right now, the tests mainly consist of some of the NVIDIA CUDA samples that have been ported to JCuda, the additional JCuda samples, the tests that have been added for dedicated features, and some regression tests for bugfixes.
These tests are currently not executed automatically, and they are not yet all available at GitHub.
As a first step, most of the samples/tests that already print the prominent PASSED
or FAILED
message could extended to simply check this result in an assertion.
The first set of tests has been converted into unit tests and added in https://github.com/jcuda/jcuda/commit/a312f1fd48334716da7479ca6f3c7fb45aba1271 .
(Although, in some cases, there is no clear line of separation between a "sample" and a "test": Some of the samples also perform a validation, and some of the tests also serve as examples showing the usage of a particular part of the API)
The current set of tests is only for JCuda. Further tests for the other runtime libraries (JCublas, JCufft...) will be added soon.