-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Concept] Add support for test case id tagging #66
Comments
ARM Internal Ref: IOTSYST-768 |
DoD:
|
I don't understand this feature, please can you provide C/C++ and python side code snippets for this test unit with many test cases ids? Is this to synchronize client and host, both directions? Provided code snippet below does not set the full picture to me.
Why testcase_start is not automatic (once test() is invoked), case start is indicated (it might be useful to have testcase_start manual method?), and testcase finish - does it need 2 arguments, why the selftest or self does not contain result , plus test id is automatic? ID vs name? name is a test unit name, they match at the client side and host test side:
How to do that id? I found MBED_HOSTTEST_TESTCASE_START/FINISH macro, how to use those and on the host site to process those? |
@0xc0170 Martin, I will provide and example, this description is not finished yet. I need to provide a guide and examples to fully cover this feature. I just had no time to finish this yesterday. |
Reviewed this and other proposals today with Brendan, Martin and Niklas. |
we use result, not success? I saw in host tests results, and From the client side (c/c++) as it is (2 new macros) is fine, but from the host side, how htrun knows how many test_ are there, is it like with test frameworks, that a method needs to start with test_ ?
Wouldn't automatic naming make sense (test_ name), name would be upper case -> RTC001, RTC100 in my case. Or just a variable to set (same as for BaseHosttest, we are setting name, not calling a method), selftest.testcase.name = RTC001 (this is the name of the current test case, it starts once method test_rtc001 is invoked, finished once returned). |
So your pseudo-code for one binary would look like: int main() {
{
MBED_HOSTTEST_TESTCASE_START(TESTCASE_NAME);
# test case code
MBED_HOSTTEST_TESTCASE_FINISH(TESTCASE_NAME,SUCCESS);
}
{
MBED_HOSTTEST_TESTCASE_START(TESTCASE_NAME);
# test case code
MBED_HOSTTEST_TESTCASE_FINISH(TESTCASE_NAME,SUCCESS);
}
...
{
MBED_HOSTTEST_TESTCASE_START(TESTCASE_NAME);
# test case code
MBED_HOSTTEST_TESTCASE_FINISH(TESTCASE_NAME,SUCCESS);
}
MBED_HOSTTEST_RESULT(RESULT);
return 0;
} In above code you have three test cases execution and at the end you return test suite result. |
I can imagine |
|
Comment on grouping of tests. The example mbedgt test report gives idea:
My understanding of one binary having multiple tests was that one binary can have all or a group of tests based on the target memory size? and it will use clitest interface for test indexing, start and verdict. |
I wholeheartedly disagree with returning What is the semantical difference between Error and Fail? Both are "not success" and therefore the test didn't pass. Error codes are used because cheap to pass around (hence an int) and machine readable. |
IT'S A There is absolutely no reason to not use a string here. None. |
@niklas-arm regarding difference between Error and Fail. We need this to differentiate between between actual test failure and automation failure. Example the target wanted an input from host test side to carry on the test and failed on timeout. So not really a test failure. I more inclined towards using word INCONCLUSIVE. This status would be like an error for for automation/system test team. Device software team only need to debug Failures. However, I am not sure we should restrict detection of automation issues on host side only. So only PASS and FAIL from target? |
Also I advocate only three top level verdicts INCONC/ERROR (inconclusive/automation error), FAIL and PASS. While communicating INCONC/ERROR or FAIL the test can option pass relevent information in form of a string or error code that easily understandable in the report. |
|
@mazimkhan We were till now able to conclude test (case) execution result on DUT and/or host test side.
|
@mazimkhan Ok, good point. I would be fine with an "automation" error, which signifies failures related to running the test, not the test itself. |
Added in version 0.2.0. |
Description
One binary can contain may test cases (test fixtures) with a unique test case ids.
We could add support to yield many test case id results per one test case execution.
Related PRs and changes:
New success code for test case
New success code for test case is an integer with following properties:
Range of
MBED_HOSTTEST_TESTCASE_FINISH()
success:Example simple test case inside current test source code
You can think about this also like this:
Rationale
We need to move to new mode of work where one binary (test suite) can report multiple test cases results from automated run.
Changes
mbed-drivers/test_env.h
:Example:
Example "STL" mbed-drivers test case source code with new macros in use
Note: We will modify in this example mbed-driver's STL.
We are adding two macros at the beginning of the test case and the end of it:
Originally this test case was designed to run multiple checks and return one result, but now we can get multiple results from each test case and summary result from test suite passed via already used macro:
MBED_HOSTTEST_RESULT();
Example host test for RTC test cases with new functions
In this examples we refactored
test(self, selftest)
function and added two new functions with two very similar test cases (we are only changing look count).Changes:
test(self, selftest)
to give feedback from test suite.Note that in this case test case is captured inside host test and not inside binary with mbed code.
Example reporting
The text was updated successfully, but these errors were encountered: