Commit Graph

94 Commits (e17b1df13d9c3269b838169d6d61912d3d13431d)

Author SHA1 Message Date
ccli8 39a6fa9609 Enlarge wait time in Greentea test function test_deepsleep
Original wait time is not enough for UART to flush out before deepsleep on some targets.
2018-06-19 09:23:53 +08:00
Cruz Monrreal 6999d25f4d
Merge pull request #6935 from maciejbocianski/ticker_test_fix
ticker test improvement
2018-06-13 08:46:41 -05:00
Maciej Bocianski 27bf6cff4f ticker test improvement
Make multiticker test more reliable when scheduling very early interrupts.
When very early interrupt is scheduled (e.g now + 2[ticks]) then it's likely
that it won't be fired in some circumstances and as a result there is overdue
event in queue. That overdue event can be mistakenly scheduled again by
`Ticker::detach` (detach calls schedule if head was removed). That's why we
should check interrupts counter immediately after wait period and before detach loop
2018-06-08 15:37:59 +02:00
Wilfried Chauveau 3745c73e91 set the tolerance to 5% if NO_SYSTICK is enabled 2018-05-31 13:05:37 +01:00
Przemyslaw Stekiel 500be1fbac Fix tolerance definition in ticker tests. 2018-05-25 13:04:23 -05:00
Przemyslaw Stekiel 06c6db5119 tests-mbed_drivers-lp_timer: modify tolerance to percentage form
Represent tolerance value as it is done in `tests-mbed_drivers_timer`.
Use 5% tolerance for lp ticker.
2018-05-25 12:33:42 -05:00
Przemyslaw Stekiel a0a07d9725 tests-mbed_drivers-timerevent: increase tolerance for NRF52_DK
Test inserts event into the TimerEvent object which is scheduled 50 ms in the future. Then test thread hangs on the semaphore for 51 ms and after that time we expect that event handler has been executed. This test fails sometimes on NRF51_DK, NRF52_DK since different clocks are used for event handling and delay. TimerEvent class uses fast us ticker and semaphores are based on lp ticker (NRF51_DK) or System Tick Timer (NRF52_DK).
We assume that ticker measurement error is 10% and our 1 [ms] extra corresponds to 2% error. I suggest to increase delay to 2 [ms] (4%). This should be enough for all boards at this moment.
2018-05-25 12:33:42 -05:00
Przemyslaw Stekiel 75df9ecd19 tests-mbed_drivers-lp_ticker: increase tolerance for NRF51_DK
This test fails sometimes while testing 1 ms timeout on NRF51_DK board.
This board is very slow and lp ticker is inaccurate.
I noticed that measured results are very close to the tolerance value. For 1ms delay we measure in failure case 1560 us and tolerance is set to 550.
Since measurement method is also significantly flawed (extra time for setting up ticker and execution of a ticker irq handler) I recommend to increase tolerance by least +100 us for now.
2018-05-25 12:30:52 -05:00
Przemyslaw Stekiel a3d5921515 tests-mbed_drivers-timerevent: Disable deep-sleep mode in TestTimerEvent class.
Since now us ticker is disabled in deep-sleep mode and tests-mbed_drivers-timerevent verifies TimerEvent class which uses us ticker then deep-sleep mode needs to be disabled during the test execution.
2018-05-25 12:30:52 -05:00
Przemyslaw Stekiel 79f219bb3d tests-mbed_drivers-timer: Adapt tolerance for new Ticker driver
Since this change concerns new ticker driver for NRF51_DK it goas on ticker feature branch.

On this branch us ticker is based on 1 MHz higher precision counter (on master is based on 32kHz RTC). As a result of using higher precision counter measurement error increased:
:485::FAIL: Expected 1.060000 Was 1.070478

For delay 1060 ms we measured ~1070 ms so we have about ~1% measurement error which is not bed for this board.

To make it work with 1MHz us ticker increase test tolerance. Define tolerance as follows:
tolerance  = 500us + 0.02 * delay.
2018-05-25 12:29:55 -05:00
Przemyslaw Stekiel b524a7f8d9 tests-mbed_drivers-lp_ticker: Adapt tolerance for new Ticker driver
Since this change concerns new ticker driver for NRF51_DK it goas on ticker feature branch.

On master NRF51_DK Ticker driver uses 32kHz RTC for lp and us ticker. Test uses us ticker to measure lp ticker interrupt scheduling (LowPowerTicker.attach), but since the same hardware is used for both tickers the measurement error is constant. On this branch us ticker uses 1 MHz higher precision clock and the results are different - measurement error grows linearly and shows inaccuracy of the RTC.
Test implements constant delta for measured time equal to 2000 us.

Change delta so it depends on lp ticker tested timeout value:
500us for measurement inaccuracy + 5% tolerance for LowPowerTicker
2018-05-25 12:29:54 -05:00
Przemyslaw Stekiel 2323486bf3 tests-mbed_drivers-timerevent: perform test only if USTICKER support is enabled. 2018-05-25 12:29:54 -05:00
Bartek Szatkowski a92ff94904 Fix rebase error 2018-05-25 12:20:10 -05:00
Bartek Szatkowski 6e9f04bf2f Rename DEVICE_LOWPOWERTIMER to DEVICE_LPTICKER
That's to match DEVICE_USTICKER.
2018-05-25 12:20:09 -05:00
Przemyslaw Stekiel b7fdf60f29 Skip higher level ticker tests for targets with stale ticker target specific drivers.
Since target specific ticker drivers are not ready also features which uses ticker in upper layers may not work correctly and tests for these features.
We need to disable also failing higher level ticker related tests (by adding check if DEVICE_USTICKER symbol is available and raise #error [NOT_SUPPORTED] if not).

Note:
tests-mbed_drivers-rtc is new and uses us ticker to perform a delay.
2018-05-25 12:18:55 -05:00
Przemyslaw Stekiel 7227670416 Skip higher level ticker tests for targets with stale ticker target specific drivers.
Since target specific ticker drivers are not ready also features which uses ticker in upper layers may not work correctly and tests for these features.
We need to disable also failing higher level ticker related tests (by adding check if DEVICE_USTICKER symbol is available and raise #error [NOT_SUPPORTED] if not).
2018-05-25 12:17:49 -05:00
Przemyslaw Stekiel 785e5d30a2 Disable `tests-mbed_drivers-timeout` test if USTICKER support is disabled (NRF52_DK). 2018-05-25 12:04:32 -05:00
Przemyslaw Stekiel 48a769dbb3 Disable `tests-mbed_drivers-timerevent` test if USTICKER support is disabled. 2018-05-25 12:04:32 -05:00
Przemyslaw Stekiel 3cd3defbba Disable boards which does not fulfil new sleep standards.
These boards will be re-enabled when sleep driver for them is ready.

Note:
This operation is done by removing "SLEEP" feature from target's "device_has" list (in targets.json config file).
For NRF52_DK removing of "SLEEP" feature causes some timing issues which have influence on tests. In order to successfully disable this board we need to disable also related features like "USTICKER", "LOWPOERTIMER" and slightly modify ticker tests, so they will not be executed if usticker support is not available (by default all targets support us ticker).
2018-05-25 12:04:32 -05:00
Cruz Monrreal 15ff9a8bf7
Merge pull request #6864 from davidsaada/david_flashiap_unaligned_src
FlashIAP: Fix problem of programming source buffer not aligned to 4
2018-05-14 10:35:38 -05:00
David Saada 9cdecf4d5a FlashIAP: Fix problem of programming source buffer not aligned to uint32_t 2018-05-10 12:00:29 +03:00
Przemyslaw Stekiel 2ccc11f243 tests-mbed_drivers-rtc: Add one second tolerance in functional tests.
Currently test assumes that 1 sec is long enough to set RTC time and read same time which has been set.
In some cases extra time for synchronisation between clock domains is needed and after setting/reading operations the read value might be different than one which has been set (+1 sec).
Additionally in some cases when lp ticker is based on RTC, the RTC implementation may use mechanism to trace elapsed seconds without modifying RTC registers. In such case it is possible that second will change immediately after setting time.

Add 1 sec tolerance (min possible) for such checks.
2018-05-09 14:41:40 +02:00
deepikabhavnani d43d9b134b Moved stats test to platform folder 2018-05-01 14:03:31 -05:00
Brian Daniels 631e5ebdee Modifying echo test to be driven more from the device.
Previously, the echo test followed a flow like the following:

-STEP-	-HOST PC-                  -DEVICE-
0	send _sync
1				   echo back _sync
2				   send echo_count
3	echo back echo_count
4	send first echo packet
5				   echo back echo packet
	(repeat echo steps)

However, as noted by issue #6659, this test would somtimes fail between
steps 4 and 5. To ensure each KV pair makes to the correct destination,
we usually write the KV back. Step 4 does not wait for this to happen
and starts sending echo packets. So the device is acting as the "echo
server".

This change makes the host PC the "echo server". The idea being that the
device will be slower and the host pc should always be able to keep up
with it, not the other way around.
2018-04-23 17:56:13 -05:00
Deepika bf0393aaa9 Added test for MbedCRC.h 2018-03-23 14:54:24 -05:00
Filip Jagodzinski 82f781ce3d Tests: Drivers: Timeout: Update unit tests
Added unit tests for Timeout API.
Added unit tests for LowPowerTimeout API.
Moved all existing test cases to a header file.
2018-02-28 17:27:46 +01:00
Cruz Monrreal 3d37d819e9
Merge pull request #5046 from fkjagodzinski/timerevent_tests
TimerEvent tests
2018-02-26 15:02:52 -06:00
Filip Jagodzinski 44c4583f2a Tests: Drivers: TimerEvent: Add tests 2018-02-23 09:13:37 +01:00
David Saada 0aeeece97d FlashIAP driver modifications:
- Support programming across sectors.
- Support program size not aligned to page size.
- Fix validations on sector erase.
2018-02-22 22:48:29 +02:00
Maciej Bocianski 143765137e test-mbed_drivers-ticker: improve two ticker test accuracy
test_case_2x_callbacks test was redesigned to eliminate ticker rescheduling and improve time mesure accuracy.

Constant ticker rescheduling (detach()/attach_us() calls)
was causing the gap between consecutive callback calls was not exact 1ms
but 1ms + time needed to call the callback and attach new one.
New design just uses two tickers to update counter alternatively every 1ms without rescheduling them
2018-01-30 13:40:56 +01:00
Maciej Bocianski dd84c0bc5f test-mbed_drivers-ticker: fix ticker cross attach
This commit fixes ticker cross-schedule bug in test_case_2x_callbacks subtest

In effect of this bug:
    ticker_callback_1_switch_to_2 was called only once
    ticker2 was never been fired because it was repeatedly detached just before fire and attached again
2018-01-30 13:01:11 +01:00
Przemyslaw Stekiel a25bf8fbc1 Add RTC time test. 2018-01-24 10:47:34 +01:00
Jimmy Brisson c00efaec44
Merge pull request #5737 from jeromecoutant/PR_LP_TIMER_TEST
lp_timer test : add a minimum delta value
2018-01-04 10:03:53 -06:00
jeromecoutant 9a43912177 lp_timer test : add a minimum delta value 2018-01-03 15:37:19 +01:00
Maciej Bocianski cc580d7532 mem_trace tests refactoring 2017-12-22 07:56:56 +01:00
Russ Butler 1faf46e161 Fix deficiency in the race test
The test for construction of local static objects doesn't check
to see if the object returned has been fully initialized. Because
of this, an error with ARMCC was not detected.

This patch adds an assert to the race_test to ensure that the
object has been properly initialized.
2017-12-01 10:49:50 -06:00
Martin Kojtal 56aa7c396f
Merge pull request #5261 from maciejbocianski/ticker_tests2
Extends test set for Ticker class
2017-11-16 16:23:35 +00:00
Martin Kojtal eb5d3fffff
Merge pull request #5403 from mprse/timer_test_delta_fix
Provide fixes for Timer and LowPowerTimer tests.
2017-11-16 16:19:24 +00:00
Przemyslaw Stekiel 78e1362ec0 Provide fix for Issue #5468.
Issue: https://github.com/ARMmbed/mbed-os/issues/5468
Increased DELTA value for Timer and Low Power Timer tests.
2017-11-13 11:03:29 +01:00
Przemyslaw Stekiel d962f67ca2 Move Timer test, modify ASERT macros, fix comments.
Move Timer test to TESTS/mbed_drivers/ directory which is more suitable.
Fix few comments which are incorrect.
Use more relevant ASERT macros.
2017-11-13 10:43:26 +01:00
Przemyslaw Stekiel d49899a6e2 Provide fix for Timer and LowPowerTimer tests (time accumulation).
LowPoterTimer test gives sometimes failed result while testing measured time accumulation. The check which verifies if total number of elapsed milliseconds is valid fails. Test assumes that delta value equal to 1 ms is sufficient for all test cases, which is not true since in case where time measurement is performed few times in sequence the measurement error also accumulates and 1 ms might be not enough. To solve this problem delta value for milliseconds tests must be updated.
2017-11-13 10:12:11 +01:00
Jimmy Brisson 1454e6b54b
Merge pull request #5047 from maciejbocianski/lp_ticker_tests
Test set for LowPowerTicker class
2017-11-02 10:37:00 -05:00
Maciej Bocianski 9bf936cb49 race test: fix out of memory problem for NUCLEO_F070RB 2017-10-25 09:40:05 +02:00
Maciej Bocianski aaa15bcf58 Extends test set for Ticker class (round 2) 2017-10-19 15:12:44 +02:00
Jimmy Brisson 23be7a814d Merge pull request #5074 from mprse/lp_timer_test
Add Low Power Timer test.
2017-10-13 09:21:46 -05:00
Jimmy Brisson 84f2d089f4 Merge pull request #5147 from 0xc0170/fix_deepsleep_tests
Test: deepsleep() API replacement
2017-10-13 09:19:41 -05:00
Maciej Bocianski 9fb4fd017a Test set for LowPowerTicker class 2017-10-11 15:01:15 +02:00
Przemyslaw Stekiel 34a03267d8 Add Low Power Timer test. 2017-10-11 14:55:34 +02:00
Jimmy Brisson df88a9dcc2 Merge pull request #5272 from studavekar/echo_test_fix_handshake
Fix echo test handshake and reduce uart load
2017-10-09 13:05:03 -05:00
Martin Kojtal 943fc32c73 Merge pull request #5255 from c1728p9/fix_ticker_test
Prevent use of deleted ticker in Ticker test
2017-10-09 14:05:22 +01:00