-
Notifications
You must be signed in to change notification settings - Fork 1
Testing
The fuc group decided a goal of 90% test coverage for the project. The test can be found in the fuc/code/{module}/test
of the respective {module}
. The module tests are included in the default ant runt-tests
target.
Integration tests test the whole compiler chain: Lexer -> Parser -> Semantic Analyser -> IR Generator -> LLVM Backend.
The integration tests can be found in fuc/code/test
. In order to be able to reuse the example programes in different test classes and due to the limitations of JUnit, they are centralized in ExampleProgs.java
. The example programs comprise of the examples from common/examples
(loaded from there) plus some addition test programs. TestBase.java
provides the base class for all integration tests.
The integration tests compile the example program and assert, that the the compilation either produces expected errors or compiles through, producing some kind of LLVM IR Code in the end. The resulting LLVM IR Code is then executed with lli
. The result of the execution is then checked against the expected output (print
statements) and exit code (return
statement). The runtime tests hereby provide limited correctness testing (no proof of correctness of course!).
The runtime tests need a working LLVM installation (>= version 3.2). If no LLVM IR Installation is detected, they are ignored. All integration tests are included in the default run-tests
ant target (and thereby also included in the travis CI testing).
Every commit pushed to the remote master branch is tested with Travis CI. If something is pushed it will trigger an ant run-tests
and send an Email to the commit author (email taken from git) if something fails. Before running the tests, LLVM is installed, so that the runtime tests are also included in the continuous integration testing.
The current build status of the master branch is displayed on the main fuc github page as a small png at the top of the README.md. The testing can be seen in action an the Travis CI status page for fuc.
The cross tests test for the interchangeability of the fuc and the javabite modules. The cross tests have their own repository and are described there.