Commit Graph

34 Commits (32686d48a8fd71a4cf369d4ef8e7ee780eb6b77f)

Author SHA1 Message Date
Brian Daniels 4a0bb5b35d Update utest README 2019-01-28 16:35:35 -06:00
Brian Daniels 96a71ce59a Removing references to yotta and minar within utest 2019-01-28 16:31:20 -06:00
Deepika 1fe633799d Framework: Add required header file and namespace element instead add all 2018-10-15 10:57:21 -05:00
David Saada 2b7d83652e Unity: Add macros for test skipping.
The TEST_SKIP and TEST_SKIP_UNLESS macros (w/ and w/o messages) allow the test
to skip the test case execution from the point the macro was called (without
failing the test).
2018-07-11 14:51:05 +03:00
Christopher Haster 4cad764162 Added copyright header to all tests 2017-08-07 12:02:33 -05:00
Russ Butler e46bb0ed15 Add support for runtime test specification
Add a constructor which explicitly takes the number of test cases.
This allows a test case array created at runtime to be used.
2017-07-18 12:03:06 -05:00
Kevin Gilbert 090e63f36a Placed verbatim tags around a pair of brackets that Doxygen interpreted as xml tags 2017-06-08 17:12:03 -05:00
Kevin Gilbert 57a70d93f9 Resolved Doxygen build errors 2017-06-08 15:53:27 -05:00
Vincent Coubard f36619b859 utest_case.h : Fix comment indentation 2017-06-05 16:06:17 +01:00
Vincent Coubard 165d76ae25 utest case: Indicate explicitely that no data member shall be declared in
the Case class.
2017-06-05 16:06:17 +01:00
Vincent Coubard 5b27d65755 utest optimization: Allow case data structure to be put in ROM.
This patch split the Case class in two entities: Case and case_t. case_t contains the test case data structure while Case provide the interface to the test case. Unlike the class Case, case _t is a POD and can be instantiated at compile time and put in the constant data section (in ROM).

The Specification class has also been modified to accept arrays of case_t.
2017-06-05 16:06:17 +01:00
Christopher Haster aff49d8d1e Renamed files in platform to match source names
critical.h     -> mbed_critical.h
sleep.h        -> mbed_sleep.h
toolchain.h    -> mbed_toolchain.h
rtc_time.h     -> mbed_rtc_time.h
semihost_api.h -> mbed_semihost_api.h
wait_api.h     -> mbed_wait_api.h
2017-02-22 18:17:54 -06:00
Jimmy Brisson f1a78027d3 Add tags to our code 2016-10-04 15:02:44 -05:00
Vincent Coubard 90496ed5dc UTEST - Fix warning by removing unreachable statement.
Some compiler will trigger warnings if code is located after the exit function
because this function never returns (by the standard...).
2016-09-26 17:05:03 +01:00
Vincent Coubard 25148af3a2 UTEST - Fix warning in utest_shim.cpp by removing unreachable statement. 2016-09-26 17:02:01 +01:00
Russ Butler 1921b1aa96 Add stack metrics to greentea
Update greentea to report thread information when a thread exits or
is terminated and when testing completes. Also move metrics into
a dedicated greentea file.
2016-09-13 15:52:18 -05:00
Vincent Coubard aab107020b Use SingletonPtr for the internal variables defaults and handlers in utest_harness. 2016-09-09 17:22:41 +01:00
Vincent Coubard caa4c4f2a3 Use a SingletonPtr for the Timeout object in utest_shim.
Makes sure to initialize it, otherwize, it might be initialized in
interrupt context.
2016-09-06 10:14:26 +01:00
Vincent Coubard 85bce1467f Improve compatibility between base_control_t and control_t.
* provide missing member functions from control_t in base_control_t
* construction of control_t from reference of base_control_t instead of
  value.
* overload operator+ for all permutations between control_t and
  base_control_t.
2016-08-30 13:29:17 +01:00
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
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