Commit Graph

49 Commits (0a1d9fa018df96614334b99147a3ebad4040c728)

Author SHA1 Message Date
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
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
Shrikant Tudavekar c5621b9eb3 fix echo test handshake and reduce uart load
1) if we receive more than one __sync, previous handshake would consider
it as echo_count and try to decode the value. Now we skip superfluous __sync.

2) reduce the uart load produced by the test, as we are heavily running tests in
parallel and not one-to-one this update was required.
2017-10-08 11:21:17 -05:00
Martin Kojtal b30c622522 Test: deepsleep() API replacement
Use sleep() as entry function + check to be certain we
are entering deepsleep when required by test (should be allowed)
2017-10-05 16:43:57 +01:00
Jimmy Brisson 4dff32ab5a Merge pull request #5220 from c1728p9/sleep_lock_fixes
Fix deep sleep lock bugs
2017-10-05 10:03:44 -05:00
Russ Butler ad0b11565c Prevent use of deleted ticker in Ticker test
In test_case_2x_callbacks two tickers are setup to repeatedly
reschedule each other. When these tickers are deleted this
rescheduling is still occurring and can lead to a deleted ticker
being scheduled.

When this happens the following error message is displayed:
Thread 0x0 error -6: Not allowed in ISR context

Note - this problem was not detected by CI since the test reported
the correct results back to the host test and only experienced this
error on tear down.

This problem can be reproduced on an nrf51 by first building the ticker
test with:
"mbed test -t GCC_ARM -m NRF51_DK -n tests-mbed_drivers-ticker
--compile -DMBED_TRAP_ERRORS_ENABLED=1
-DMBED_HEAP_STATS_ENABLED=1 -DMBED_STACK_STATS_ENABLED=1"

And then running testing with:
"mbed test -t GCC_ARM -m NRF51_DK -n tests-mbed_drivers-ticker --run"
2017-10-04 16:07:41 -05:00
Russ Butler d910dc5bc4 Revert #5006 - Extends test set for Ticker class
This commit reverts commit c1c0f1ea57
because it causes nightly builds to fail. This is because extra tests
added in tests-mbed_drivers-ticker fail on some targets, such as the
KL46Z, MAX32625MBED, MAX32630FTHR, NCS36510, NRF51 and NRF52_DK.
2017-10-03 11:44:24 -05:00
Russ Butler ea468856c4 Add a test to validate locking
Test that DeepSleepLock and Timer lock deep sleep at the correct time
and do no leave sleep locked after they are destroted.
2017-10-02 11:35:03 -05:00
Jimmy Brisson 90e5483bbe Merge pull request #5006 from maciejbocianski/ticker_tests
Extends test set for Ticker class
2017-09-29 10:06:14 -05:00
Martin Kojtal b72bd08644 Merge pull request #4965 from deepikabhavnani/IAR_heap_stats
Add heap stats for IAR
2017-09-22 11:34:47 +01:00
Deepika 459e7d4725 IAR heap stats added 2017-09-18 10:24:01 -05:00
Russ Butler 47b0f31d32 Remove direct use of us and lp ticker from tests
Remove the direct use of the microsecond and low power ticker from
the tests. This enforces that sleep mode is properly locked when
using timers. Furthermore, this prepares the codebase for new ticker
changes which allow differing clock frequencies and timer bit widths.
2017-09-13 20:11:39 -05:00
Maciej Bocianski c1c0f1ea57 Extends test set for Ticker class 2017-09-12 16:04:52 +02:00
Anna Bridge 2955a0adc6 Merge pull request #5063 from 0xc0170/fix_lpticker_test
Fixing lp ticker and sleep manager tests
2017-09-11 22:28:52 +01:00
Russ Butler 30450d40d6 Decrease error in Timeout test due to ISR latency
Increase the Timeout period from 1ms to 10ms so interrupt latency has
1/10th the effect on the measurement. This prevents failures due to
interrupt latency causing a drift.
2017-09-09 20:43:36 -05:00
Russ Butler d9aff6f0dd Prevent deeps sleep in regular sleep test case
Lock deep sleep before calling sleep to prevent the device from
entering deep sleep mode.
2017-09-09 20:43:35 -05:00
Deepika 5875569070 Added function header for stl test 2017-09-06 09:51:16 -05:00
Laurent MEUNIER be7fa925ad TESTS: flashiap: Add condition to check error on unaligned access
In case the target supports a page size of 1 byte, i.e. is able to
program flash 1 byte at a time, which is the case of STM32 F4 targets,
there is no reason for flash_device.program to return an error when
trying to write on an "unaligned" address.
2017-08-28 16:21:18 +02:00
Shrikant Tudavekar 8a4dbff8d6 validate base_time key received
This is required as greentea can send multiple __sync packets and cause the
to be in unexpected state.
2017-07-05 12:37:41 -05:00
Shrikant Tudavekar 73907259d9 Increased stack to 1024 from 768 and corrected assert.
1) mbed-os-tests-mbedmicro-rtos-mbed-basic tests use to fail when run in loop
after 20-25, This was because the stack used by test application was in range of
744-840 bytes. So bumped the stack size to 1024 bytes.

2) Corrected the assert and taken out the assert which was not required.
2017-06-22 18:25:39 -05:00
studavekar 12fe3415bc Deprecate testcases related to time drift.
1) RtosTimer is been Deprecated by EventQueue.
2) wait_us testing can't be reliably tested.
2017-06-22 18:25:38 -05:00
studavekar 0f55193df8 Update timing tests to be robust.
In the new approach the host controls the device activity when the test
should start, finish and pass/fail status is send to device. Also deprecate
the test cases which can't accurately test.
2017-06-22 18:25:16 -05:00
Martin Kojtal 7aea3bc43e race tests: fix unsupported condition
Should be true if single thread is defined, then its not
supported.
2017-05-25 14:47:28 +01:00
Bartek Szatkowski 6a0fcd3c58 Reduce test overhead in preparation for CMSIS 5
Reduce RAM consumption so all tests can still be built when using
CMSIS/RTX5. Also reduce clutter by removing the per target stack size
defines in the tests.
2017-05-14 19:25:19 -05:00
Martin Kojtal 84eddd01c1 tests: race test - add not supported for single threaded env
Fixes #4196. As someone might not be aware that settting default_lib to small has
some implications regarding thread safety, therefore we print an error.
2017-04-20 10:53:01 +01:00
0xc0170 2fa2927ab5 tests: add FlashIAP functional test
It currently tests functionality provided by flash IAP API like
read/program/erase and getters.
2017-02-21 14:08:56 -06:00
Mahadevan Mahesh ac9668a498 Update tests to fix build failures. Also make the code similar to other tests
Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2016-11-02 11:45:14 -05:00
Brian Daniels 9a4aeec1b2 Waiting before call to deepsleep to allow buffers to flush 2016-10-13 13:51:54 -05:00
Sam Grove 7dd1b04c2e Merge pull request #2651 from svastm/fix_lp_timer_test
Use lp_timer to count time in the deepsleep tests
2016-09-09 18:02:10 -05:00
Sam Grove 0128dd2d8f Merge pull request #2562 from c1728p9/init_race_condition
Fix GCC lazy init race condition and add test
2016-09-09 17:59:37 -05:00
Sam Grove a6b27319ec Merge pull request #2496 from geky/callback-cv
Add cv-qualifiers to Callback and deprecate combinatorial explody functions
2016-09-09 01:45:25 +02:00
svastm cc55173329 Use lp_timer to count time in the deepsleep tests
Because microseconds timer can be disable during deepsleep
2016-09-08 18:09:45 +02:00
Brian Daniels 1473240637 Fixing issue in timing host test and wait_us case
The timing host tests reported success even if the total drift was
negative. This adds a check for this now.

The wait_us test now does not use a timer and just waits for 100000 us
between prints. This adds inherent drift, but it should still be well
under the limit.
2016-09-07 09:14:17 -05:00
Brian Daniels 4f4112b18e Consolidating timer reads to reduce drift 2016-09-01 15:12:38 -05:00
Brian Daniels 07a23556a9 Reducing number of timeouts to decrease drift 2016-09-01 15:12:06 -05:00
Brian Daniels e678325730 Modifying timing tests to use timing drift host test 2016-08-30 14:53:18 -05:00
Russ Butler 69431da0c7 Add a test to check for init race conditions
Test SingletonPtr initailization along the with lazy initailization
that is built into the C++ language itself.
2016-08-30 11:23:11 -05:00
Christopher Haster 5c0f39f190 Split callback test into multiple tests based on types
As the templated tests grew, the resulting binary exceeded a
flash size of 64K. This caused the test to incorrectly fail on
small devices.

Moved and split into the following:
TESTS/mbed_functional/callback
TESTS/mbed_functional/callback_small
TESTS/mbed_functional/callback_big
TESTS/mbed_functional/functionpointer
2016-08-26 09:54:13 -05:00
Christopher Haster c71e67f2dc Updated minor functionality of the Callback class
- Marked `call` and `operator()` functions as const
- Moved to static_cast for internal function pointer to avoid losing
  compiler checked const-safety
- Added test for `operator=` with non-callback types
- Moved from zero-cast to value-initializer when callback is null
- Added `operator==` and `operator!=`
- Removed special handling of null callback
- Replicated doxygen to all overloads
- Added correct nops where uninitialized callbacks are called
- Added assertion for null callback
- Removed copy-constructor from callback constructor
2016-08-26 09:54:02 -05:00
Bogdan Marinescu 1e3cbc909b Added tests for the memory tracer 2016-08-26 09:42:40 -05:00
Christopher Haster 45d25ed493 Added support for cv-qualifiers in Callback class
Additionally, the following changes were don to avoid combinatorial
explosion in function overloads as a result of adding cv-qualifiers:
- Added convenience function for inferred type
- Deprecated callback overloads qhere cv-qualifiers are not scalable

Supported overloads:
callback(void (*f)(A...));
callback(const Callback<R(A...)> &);
callback(T *t,                void (*f)(T*, A...));
callback(const T *t,          void (*f)(const T*, A...));
callback(volatile T *t,       void (*f)(volatile T*, A...));
callback(const volatile T *t, void (*f)(const volatile T*, A...));
callback(T *t,                void (T::*f)(A...));
callback(const T *t,          void (T::*f)(A...) const);
callback(volatile T *t,       void (T::*f)(A...) volatile);
callback(const volatile T *t, void (T::*f)(A...) const volatile);
2016-08-26 09:40:22 -05:00
Sam Grove 3dac791b4a Merge pull request #2476 from bulislaw/lp_ticker
K22F/K64F: Add lp_ticker implementation and HAL lp_ticker tests
2016-08-25 09:19:18 -05:00
Bartek Szatkowski 7203be9e6f Add tests for LowPowerTimeout and lp_ticker 2016-08-25 13:25:02 +01:00
Russ Butler 6a31ffbf3e Heap statistics
Keep track of the current size allocated, maximum size allocated,
number of allocations, failed allocations and total size allocated for
both GCC and ARM. Report the maximum size allocated at the end of
testing.

Also, add a test to verify heap metrics are working as expected.
2016-08-22 18:32:51 -05:00
Christopher Haster 8e60fdd919 Added tests for cv-qualifier c-objects in Callback class 2016-07-20 19:27:38 -05:00
Brian Daniels a9eb39dee4 Adding test frameworks and test sources
This commit adds the following test frameworks:

- `greentea-client` (https://github.com/ARMmbed/greentea-client)
  - This framework provides a key-value api for communicating with the
    greentea test tool (https://github.com/ARMmbed/greentea)
- `unity` (https://github.com/ARMmbed/unity)
  - This framework provides test assert macros that can be used when
    writing test cases
- `utest` (https://github.com/ARMmbed/utest)
  - This framework allows you to execute a series of test cases with
    reporting that works with the greentea test tool
    (https://github.com/ARMmbed/greentea)

The following changes were made when bringing these frameworks into the
tree:

- References to `mbed_drivers/mbed.h` within utest's tests were migrated
  to `mbed.h`
- The yotta file `module.json` was removed from `greentea-client` and
  `unity`
  - `coverage.json` was also removed from `greentea-client`
- `.gitignore` and `.gitattributes` were removed from `greentea-client`
- Apache 2.0 license files were removed from `greentea-client`

This also brings in a number of tests that have been newly written or ported from various sources:

- `TESTS/integration` - Very basic tests, used to check if testing frameworks are working correctly
- `TESTS/mbed_drivers` (Thanks @PrzemekWirkus!) - TESTS ported from mbed OS 3.0 (https://github.com/ARMmbed/mbed-drivers)
- `TESTS/mbedmicro-mbed` (Thanks @PrzemekWirkus!) - Tests that weren't covered by `TESTS/mbed_drivers` that currently live in `libraries/tests/mbed`
- `TESTS/mbedmicro-rtos-mbed` (Thanks @PrzemekWirkus!) - Ported tests that currently live in `libraries/tests/rtos/mbed`
- `TESTS/storage_abstraction` (Thanks @rgrover!) - Tests for the storage_abstraction hal
2016-07-20 12:41:26 -05:00