Skip to content

Integration tests

Patrick Werner edited this page May 28, 2020 · 2 revisions

Integration tests in OpenRoberta use exported blockly-XML (the blocks of the program) and generate native programs from that. Then either

  • a crosscompiler compiles the generated program (ev3-lejos*, nxt, calliope*, arduino*)
  • linting of the generated program should be done (ev3dev, nao, microbit, simulation). This part is missing. Are you interested in doing this?

We hope, that this detects many errors in our code generators (but also errors in the crosscompilers. For example, NXC has some, documented in the issue tracker). To detect as much errors as possible, the blockly-XML should cover as many blocks and as many variants of the blocks as possible.

The blockly-XML of all tests is stored in project OpenRobertaServer in directory src/test/resources/crossCompilerTests. The tests run every night in a docker container for branch develop. We support two types of integration tests: robot specific tests and common tests.

In order to run the tests you need to specify the path to the ora-cc-rsc repository in the environment variable robot_crosscompiler_resourcebase.

Robot specific tests

  • These tests are related to the sensors and actuators of this robot.
  • All tests are in robot specific directories (ev3 or ardu for example).
  • Tests can be extended or new tests can be added at any time.
  • The tests are run from Java class CompilerWorkflowIT.

Common tests

  • These tests are related to features, that are common to all robots. This includes flow of control (if, while), variables of all types, built-in functions (like max or sin), user-defined functions.
  • The tests are run from Java class CompilerWorkflowCommonIT.
  • Actually lists are a problem, as nxt and bob3 don't support them, so lists are not common to all robots. The test class has to be extended to handle that particular case, too.
Clone this wiki locally