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

Add Low Power Timer test. #5074

Merged
merged 1 commit into from Oct 13, 2017

Conversation

Projects
None yet
8 participants
@mprse
Member

mprse commented Sep 12, 2017

Description

Add test for Low Power Timer. This test is created based on regular Timer test.

Status

READY

Migrations

NO

@mprse

This comment has been minimized.

Member

mprse commented Sep 12, 2017

@bulislaw @0xc0170 Review request.

TEST_ASSERT_UINT64_WITHIN(DELTA_US, 10000, lp_timer.read_high_resolution_us());
/* Reset the timer - previous measured time should be lost now. */
lp_timer.reset();

This comment has been minimized.

@bulislaw

bulislaw Sep 12, 2017

Member

Shall we validate the reset here? Rather than start the timer again?

This comment has been minimized.

@mprse

mprse Sep 12, 2017

Member

The intention of this test case is to show that reset() function works - i.e. clears time already counted by the timer. Verification if timer counts time between starts and stops is provided in test_lptimer_time_accumulation test function.

* When read of timer elapsed time is requested.
* Then result is always 0.
*/
void test_lptimer_creation()

This comment has been minimized.

@bulislaw

bulislaw Sep 12, 2017

Member

I would add another tests showing that stop actually works.

This comment has been minimized.

@mprse

mprse Sep 12, 2017

Member

Verification if stop() works correctly is provided in test_lptimer_time_accumulation() test function. This test case proves that timer counts time only between start and stop. Additional delay is provided when timer is stopped and it has been verified that this time is not counted by the timer.

TESTS/mbed_drivers/lp_timer/main.cpp Outdated
/* This test verifies if calling start() for already
* started low power timer does nothing.
*
* Timer is already started.

This comment has been minimized.

@bulislaw

bulislaw Sep 12, 2017

Member

Nit: Given...

This comment has been minimized.

@mprse

mprse Sep 12, 2017

Member

To be corrected, to the following form:
"Given timer is already started."
Also other test cases descriptions need to be updated.

This comment has been minimized.

@mprse

mprse Sep 13, 2017

Member

Fixed.

TESTS/mbed_drivers/lp_timer/main.cpp Outdated
* delays.
* Then the results are valid (within acceptable range).
*/
void test_lptimer_time_measurement()

This comment has been minimized.

@bulislaw

bulislaw Sep 12, 2017

Member

Can we make this function an template and add multiple test cases instead of duplicate the code.

This comment has been minimized.

@mprse

mprse Sep 12, 2017

Member

To be corrected.

This comment has been minimized.

@mprse

mprse Sep 13, 2017

Member

fixed.

@mprse mprse force-pushed the mprse:lp_timer_test branch Sep 13, 2017

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Sep 25, 2017

@bulislaw Did you find the responses to your questions suitable?

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Sep 27, 2017

bump

@0xc0170 0xc0170 added needs: CI and removed needs: review labels Sep 28, 2017

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Sep 28, 2017

/morph test

@mbed-bot

This comment has been minimized.

mbed-bot commented Sep 28, 2017

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1420

Build failed!

@mprse

This comment has been minimized.

Member

mprse commented Sep 28, 2017

Result: FAILURE
Your command has finished executing! Here's what you wrote!
/morph test

I have checked build log on several platforms and it looks like building fails on platforms where low power timer is not available.

@mprse mprse closed this Sep 28, 2017

@sg- sg- removed the needs: CI label Sep 28, 2017

@mprse mprse reopened this Sep 28, 2017

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Oct 2, 2017

@mprse Are you planning on fixing this failure?

@mprse mprse force-pushed the mprse:lp_timer_test branch Oct 2, 2017

@mprse

This comment has been minimized.

Member

mprse commented Oct 2, 2017

@theotherjimmy Added guard for boards which do not support low power timers.

@mprse mprse force-pushed the mprse:lp_timer_test branch Oct 3, 2017

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Oct 9, 2017

/morph test-nightly

@mbed-bot

This comment has been minimized.

mbed-bot commented Oct 10, 2017

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1557

Example Build failed!

@mbed-ci

This comment has been minimized.

mbed-ci commented Oct 10, 2017

@studavekar

This comment has been minimized.

Collaborator

studavekar commented Oct 11, 2017

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented Oct 11, 2017

Build : SUCCESS

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

Triggering tests

/test mbed-os

@mbed-ci

This comment has been minimized.

@mprse mprse force-pushed the mprse:lp_timer_test branch Oct 11, 2017

@mprse mprse force-pushed the mprse:lp_timer_test branch to 34a0326 Oct 11, 2017

@mprse

This comment has been minimized.

Member

mprse commented Oct 11, 2017

Test : FAILURE

Added missing delta value, provided minor fixes (comment, style).

@mbed-ci

This comment has been minimized.

mbed-ci commented Oct 11, 2017

Build : SUCCESS

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

Triggering tests

/test mbed-os

@mbed-ci

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@0xc0170 0xc0170 added ready for merge and removed needs: CI labels Oct 13, 2017

@theotherjimmy theotherjimmy merged commit 23be7a8 into ARMmbed:master Oct 13, 2017

5 checks passed

Cam-CI uvisor Build & Test Success
Details
ci-morph-build build completed
Details
ci-morph-test test completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment