Skip to content
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

Test set for LowPowerTicker class #5047

Merged
merged 1 commit into from
Nov 2, 2017

Conversation

maciejbocianski
Copy link
Contributor

@maciejbocianski maciejbocianski commented Sep 7, 2017

Description

New test suite for LowPowerTicker class

Status

READY

##Blocked
#5185 fixedy by #5347 (merged)
#5150 fixedy by #5347 (merged)

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 7, 2017

cc @bulislaw @c1728p9

#define TICKER_COUNT 16

Semaphore ticker_callback_sem(0, 1);
bool ticker_callback_flag;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assume this is also candidate for volatile?

TestTicker ticker[TICKER_COUNT];

multi_counter = 0;
for(int i = 0; i < TICKER_COUNT; i++) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a nit: for ( space there

ticker[i].detach();
}

//TEST_ASSERT_EQUAL(TICKER_COUNT, multi_counter);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no dead code

Case("Test multi ticker", test_multi_ticker),
};

utest::v1::status_t greentea_test_setup(const size_t number_of_cases) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{ new line for function body


using namespace utest::v1;

#define TestTicker LowPowerTicker
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like that, it's confusing. Is there a particular reason you are doing that?

}


/** Test many tickers run simultaneously
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test case does something else than described here.


/** Test multi callback time

Given an Ticker
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a nit: a Ticker


Given an Ticker
When schedule callback
Then ticker properly execute callback multiple time
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

time -> times

/** Test multi callback time

Given an Ticker
When schedule callback
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not only once it's scheduled: When the callback is attached multiple times

/** Test if detach cancel scheduled callback event

Given an Ticker with scheduled callback
When schedule is cancelled
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

schedule is not really something that exists in Ticker terms, I know what you mean, but we could use something like:
Given a Ticker with callback attached
When the callback is detached
Then the callback is not being called

Also your test does more than described here.


/** Test single callback time via attach

Given an Ticker
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should be rewritten, some examples in previous tests.

ticker.detach();
int time_diff = timer.read_us();

printf("TOLERANCE: %d\n", (uint32_t)TOLERANCE);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets not print anything if not needed.


/** Test single callback time via attach_us

Given an Ticker
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you rewrite this, examples in previous tests.

ticker.detach();
int time_diff = timer.read_us();

printf("TOLERANCE: %d\n", (uint32_t)TOLERANCE);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets not print if we don't have to.

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 8, 2017

@theotherjimmy @studavekar To be aware, I found travis failing for some recent PR, with InsecurePlatformWarning. I restarted it here, please have a look once finished if it is still there. Has anything chagned again, or new module update somewhere causing this?

@c1728p9
Copy link
Contributor

c1728p9 commented Sep 8, 2017

Why is this being tested at the driver layer rather than the HAL layer? The HAL specification will require test cases that will make these redundant.

@bulislaw
Copy link
Member

I think that should be done on both layers, drivers and HAL (when we finish drafting the new specification).

@theotherjimmy
Copy link
Contributor

@maciejbocianski @bulislaw What's the status of this PR?

@maciejbocianski
Copy link
Contributor Author

@theotherjimmy @bulislaw
test fails on K64F
issue #5185

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 26, 2017

@theotherjimmy @bulislaw
test fails on K64F

Is this the only failure that we should expect. This means this is waiting for the fix. cc @mmahadevan108 for visibility (already tagged in the issue)

@maciejbocianski
Copy link
Contributor Author

Yes, it was the only failure from tested pool k64f, nrf51_dk, nucleo_f070rb, nucleo_f429zi,

@mbed-ci
Copy link

mbed-ci commented Oct 11, 2017

Build : FAILURE

Build number : 113
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/5047/

@mbed-ci
Copy link

mbed-ci commented Oct 11, 2017

Build : SUCCESS

Build number : 122
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/5047/

Triggering tests

/test mbed-os

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 19, 2017

K64F should be fixed via #5347 , what about the rest?

@bulislaw
Copy link
Member

@maciejbocianski what's the status here?

@maciejbocianski
Copy link
Contributor Author

I think it's ready and waiting for morph,
at least not blocked by any issue

@bulislaw
Copy link
Member

/morph build

@mbed-ci
Copy link

mbed-ci commented Oct 27, 2017

Build : SUCCESS

Build number : 359
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/5047/

Triggering tests

/morph test
/morph uvisor-test

@mbed-ci
Copy link

mbed-ci commented Oct 27, 2017

Build : SUCCESS

Build number : 361
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/5047/

Triggering tests

/morph test
/morph uvisor-test

@studavekar
Copy link
Contributor

/morph test

@mbed-ci
Copy link

mbed-ci commented Oct 30, 2017

@adbridge
Copy link
Contributor

@c1728p9 @bulislaw Are you guys happy this has been fully reviewed? I can't see any evidence of a review being signed off here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants