Module junit.lua

JUnit module.

This module can be used to evaluate energy measurement tests and generate a JUnit compatible report for consumption for a continuous integration environment. Take a look at CI.lua for inspiration how it can be used.

Functions

addTest(name, channel, target, start, stop, lowMargin, highMargin) Add a test to the module.
getTests() Get the tests from the module
clearTests() Remove all existing tests
removeTest(name) Remove a single test
evaluate(project, device, rec_id) Evaluate all tests.
saveReport(filename) Save JUnit xml report


Functions

addTest(name, channel, target, start, stop, lowMargin, highMargin)
Add a test to the module.

Parameters:

  • name Name of the test.
  • channel Name of channel to verify (me, ae supported).
  • target Expected value in SI unit (i.e. Joules for energy).
  • start Start of the measurement in milliseconds.
  • stop End of the measurement in milliseconds.
  • lowMargin How many percent below target value is acceptable, set to -1 to skip check
  • highMargin How many percent above target value is acceptable, set to -1 to skip check
getTests()
Get the tests from the module

Returns:

    A table of tests, each item consists of name, channel, target, start, stop, lowMargin and highMargin. After evaluation, pass and state is also added.
clearTests()
Remove all existing tests
removeTest(name)
Remove a single test

Parameters:

  • name The name of the test to remove
evaluate(project, device, rec_id)
Evaluate all tests. This should be called after tests have been added and a recording have been made.

Parameters:

  • project The project.
  • device The device the recording was made with.
  • rec_id The recording id.
saveReport(filename)
Save JUnit xml report

Parameters:

  • filename The name of the file to be saved, don't forget extension.
generated by LDoc 1.4.6 Last updated 2021-10-13 21:46:39