Commit Graph

66 Commits (511df14eb0419ded01888022959d6eeb8f32d6b4)

Author SHA1 Message Date
Vincent Coubard daa135a1b3 Move defaults and handlers variable into a static function.
This change allow a lot of code from utest to be removed from the final
binary if not used.
2016-08-30 13:29:14 +01:00
Vincent Coubard eed52a05d5 Replace default_handlers value by a reference. 2016-08-30 13:29:12 +01:00
Vincent Coubard 4bf28d474c Convert case_control to a POD. 2016-08-30 13:29:10 +01:00
Vincent Coubard 7a6edda44c Enhance compatibility between control_t and base_control_t:
* Add conversion operator in control_t to convert instances to base_control_t
2016-08-30 13:29:09 +01:00
Vincent Coubard 6d319c521f Construct control_t from a POD struct.
Replace const control_t instances by this POD.

This save memory and prevent inclusion of the constants in the binary if
they are not used.
2016-08-30 13:29:07 +01:00
Vincent Coubard 8fa239cdfd Move constant definitions of non POD object into cpp file.
It save space and fix the ODR violation.
2016-08-30 13:29:05 +01:00
Vincent Coubard 2bc5c3d069 Move global Timeout object from utest_shim in static function.
The change of scope allow the linker to remove the variable if not used.
2016-08-30 13:29:03 +01:00
Vincent Coubard acc3115e27 Move utest global serial object into a function.
That way it is not a global object anymore and is not attached to the
.init section and init array. If the function which contain the object is
not called then the serial object will not be present in the final binary.
2016-08-30 13:23:08 +01:00
Sam Grove a7c7ceda0e Merge pull request #2455 from bridadan/share-greentea-serial-in-frameworks
Sharing greentea-client's RawSerial with utest and UNITY.
2016-08-26 09:56:23 -05:00
Sam Grove 2fe3e5214e Merge pull request #2509 from adbridge/copy_constructor
Utest: default copy constructor for failure_t doesn't behave as expected
2016-08-26 09:23:21 -05:00
Russ Butler f21adc4ad1 Move utest handlers out of critical section
In the function raise_failure move the test_failure and case_failure
calls out of the critical section. This allows these handlers to run
without interrupts disabled and enables them to use rtos features
such as a mutex. This is required for heap metrics to work.
2016-08-22 18:33:00 -05: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
Anna Bridge 4f3dba41a1 Fixes issue #2508.
The default compiler(ARMCC) copy constructor for failure_t doesn't behave as
expected and has unexpected side effects. This fix adds a custom copy constructor
to fix this.
2016-08-22 13:29:01 +01:00
Brian Daniels f334bd7602 Sharing greentea-client's RawSerial with utest and UNITY.
This commit allows the linker to remove the reference to the RawSerial object
if it not used in the application. This way it only is brought in for
tests.
2016-08-15 12:11:34 -05:00
Brian Daniels fc65ce08e0 Adding README for utest
This README was pulled from the project's repo here:
https://github.com/ARMmbed/utest. I made minor modifications to the README
to reflect the changes to the default scheduler (using a Timeout object
instead of MINAR).
2016-08-03 13:20:31 -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