Commit Graph

71 Commits (f69531e82fb683a4476afd9154742558b14561ca)

Author SHA1 Message Date
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