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.
|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|
- addTest(name, channel, target, start, stop, lowMargin, highMargin)
Add a test to the module.
- 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
Get the tests from the module
A table of tests, each item consists of name, channel, target, start, stop, lowMargin and highMargin. After evaluation, pass and state is also added.
- Remove all existing tests
Remove a single test
- 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.
- project The project.
- device The device the recording was made with.
- rec_id The recording id.
Save JUnit xml report
- filename The name of the file to be saved, don't forget extension.