Commit Graph

51 Commits (f69531e82fb683a4476afd9154742558b14561ca)

Author SHA1 Message Date
Jimmy Brisson 1dd39fbe80 Python2+3: mbed test --compile 2018-02-05 11:07:37 -06:00
Jenny Plunkett 5f5014ef42 Added check for options.source_dir is none 2017-12-01 15:02:50 -06:00
Jenny Plunkett fa56189de5 Removed typos 2017-12-01 15:00:34 -06:00
Jenny Plunkett 830e9e0bcd Added options source_dir to get_default_config 2017-12-01 14:54:35 -06:00
Jenny Plunkett d438324d31 Look for mbed_app.json in root dir if no --app-config is provided 2017-12-01 12:13:13 -06:00
Sarah Marsh 6a44ceb094 Add copyright headers and use mbed error to skip tests without network config files 2017-09-20 18:31:06 -05:00
Sarah Marsh 4161e5c48d Move test config keys out of targets.json
Change TestConfig class methods to module methods
2017-09-20 18:30:08 -05:00
Sarah Marsh dee8e7f0ea Use default mbed-os test configuration if no app_config is supplied 2017-09-20 18:29:38 -05:00
Sarah Marsh ba6eb98b5c Use only one flag for test configuration file
Tools will figure out if user passed in a custom path (to indicate configration file for module) or whether they used a keyword (to indicate they'd like to use an mbed OS configuration)
2017-09-20 18:29:37 -05:00
Sarah Marsh e982eed4ad Add option to add a configuration file for modules 2017-09-20 18:27:59 -05:00
Sarah Marsh 8c0bc781d9 Allow tools to use networkinterface configs in tests 2017-09-20 18:27:59 -05:00
Marcelo Salazar 7053ef9412 memap enhancements with depth level configurable
Removed heap/stack from report
Add --stats-depth option to mbed compile
Fix minor issues identified in review
Fix bug when parsing armcc libs
Fix code style
Fix minor issues on existing tests
Fix memap for automated TESTS
Fix stats-depth parameter for tests
2017-08-06 10:30:04 +01:00
Jimmy Brisson 2c4475cacc Find extra targets in all source folders 2017-06-21 22:17:57 +10:00
Jimmy Brisson 07a6c07408 Revert "Disable Cortex-A in tooling to provide better error messages"
This reverts commit f5859b308b.
2017-05-31 13:06:30 -05:00
Jimmy Brisson f5859b308b Disable Cortex-A in tooling to provide better error messages
Disable Cortex-A in compile supported matrix
Disable Cortex-A in export supported matrix
2017-05-30 14:32:06 -05:00
Jimmy Brisson 6ef384b7fe Add type to build_data.json 2017-04-20 11:03:15 -05:00
Jimmy Brisson 808279911c Add --build-data flag to mbed test 2017-04-20 11:03:15 -05:00
Brian Daniels f3d20141a3 Allowing mbed_app.json files to be discovered for tests.
Before, mbed_app.json files were explicitly ignored when building tests.
This was mostly because you could have multiple mbed_app.json files in the
tree (for instance, in test case folders) and the behavior would be
undefined. Now the tools explicitly ensure that there aren't multiple
mbed_app.json files in your source files. So auto discovery of
mbed_app.json for testing is being reintroduced.
2016-10-06 17:40:25 -05:00
Jimmy Brisson d88852d150 Replace -o with profiles 2016-09-29 10:20:05 -05:00
Brian Daniels aeca796641 Fixing constant cleaning when compiling tests
This addresses the issue where building tests via test.py always triggered
a clean build. This is because the mbed_config.h file was being deleted from
the shared OS build to ensure that the correct config was always being
used. However, this contanstly triggered a rebuild of the OS since the
config file was not present.

Due to the shared build, having multiple app configurations that could
override the OS settings is not possible. For this reason, we now ignore
app config files unless explicitly set via the command line option
'--app-config'. Though there will now be two mbed_config.h files in the
include path of the build, it shouldn't matter since the contents will be
the same.
2016-09-22 08:30:21 -04:00
Sarah Marsh 8b74c5b3c7 Docstrings. Empty executable search path handling. 2016-09-13 12:06:01 -05:00
Sarah Marsh 61dee45dca Revise checking toolchain path 2016-09-12 18:54:39 -05:00
Conor Keegan aafcf55407 Add app config switch to options.py and make.py 2016-09-10 15:29:19 +01:00
Conor Keegan 7c72a22508 Add test command switch for app config file 2016-09-10 15:29:19 +01:00
Bogdan Marinescu 5dcd546fd5 Merge pull request #2393 from theotherjimmy/argument-dependencies
[tools] Prevent trace-backs from incomplete args
2016-09-05 12:50:47 +03:00
Brian Daniels 33672b483f Copying JSON files to pick up config for built libraries
This came up when building tests, but affects any library that's built
that uses config and included as "source" with the mbed tools.
JSON files are not copied by default when building a library, so when this
is built it loses the config data associated with the library. This commit
copies all JSON files into the build directory when building libraries.

This leads to two mbed_config.h files existing if the build directories
are different between the library and application build. This is the case
when building tests, so an option build_library was added to remove the
mbed_config.h file when compilation is done. This disabled by default when
building libraries, but it is enabled when building tests.
2016-08-23 16:42:05 -05:00
Jimmy Brisson 163fa59e17 Prevent traceback 2016-08-19 14:01:19 -05:00
Jimmy Brisson a0c8a09c89 Unify look of argument errors 2016-08-19 14:01:19 -05:00
Jimmy Brisson b2156ceef5 Format bulid_api 2016-08-16 11:04:32 -05:00
Sam Grove c84e5d32c9 Revert "Force installation of dependencies in entry points" 2016-07-29 17:35:23 -05:00
Sam Grove 5df79393fc Merge pull request #2257 from theotherjimmy/install-deps
Force installation of dependencies in entry points
2016-07-27 16:49:12 -05:00
Jimmy Brisson 0a2c35c62b Force installation of dependencies in entry points 2016-07-26 14:08:26 -05:00
Brian Daniels 7b20b0f8f7 Making mcu and toolchain required parameters for test.py
Also renaming 'target' variable to 'mcu' to match make.py
2016-07-25 14:44:09 -05:00
Brian Daniels 1618e608e7 Test discovery now uses build and toolchain logic
Previously, test discovery throught test.py used its own logic to find
tests. This was mostly a subset of the rules used during the build
process. It respected .mbedignore files, but it did not respect TARGET_,
TOOLCHAIN_, and FEATURES_ directories. This change now uses the same logic
used during building to respect these folders. Tests under these folders
that are not being pulled in for the given target will be ignored.
2016-07-25 14:43:52 -05:00
Jimmy Brisson 9759382166 prevent test form removeing the root dir 2016-07-19 09:33:03 -05:00
Jimmy Brisson 12492c17b8 Call colorized notify when --color for build.py, make.py, test.py 2016-07-11 09:41:23 -05:00
Jimmy Brisson 7a4bee8c0e nargs="*" -> action="append" 2016-07-07 15:29:36 -05:00
Jimmy Brisson 0ec8199c55 Revert "Revert "Generalize flag handling""
This reverts commit 33cec194c6.
2016-07-07 15:29:36 -05:00
Przemek Wirkus 12a01f61ca Add summary for test building
When users are building tests with `mbed compile --tests` whey will by default
get memory map breakdown report.
This can be suppresed in the future with command line switch. For now it is
visible each time users build test cases.
List is sorted by project name created with `build_project` API.

Changes:
* `build_project` now returns tuple (this breaks build_api.build_project API!)
* Memmap script got a aggregation function to print summary from small 'JSON'
  partial reports.
* Report is generated by `test_api.build_tests` function only!

Example:
```
+----------------------------------------------------------------------+--------+-----------+-------------+------------+-------+-------+-----------+
| name                                                                 | target | toolchain | total_flash | static_ram | stack |  heap | total_ram |
+----------------------------------------------------------------------+--------+-----------+-------------+------------+-------+-------+-----------+
| features-feature_ipv4-tests-mbedmicro-net-nist_internet_time_service | K64F   | GCC_ARM   |      132136 |      62288 | 32768 | 65536 |    160592 |
| features-feature_ipv4-tests-mbedmicro-net-tcp_client_echo            | K64F   | GCC_ARM   |      125613 |      62448 | 32768 | 65540 |    160756 |
| features-feature_ipv4-tests-mbedmicro-net-tcp_client_hello_world     | K64F   | GCC_ARM   |      125949 |      62448 | 32768 | 65540 |    160756 |
| features-feature_ipv4-tests-mbedmicro-net-udp_echo_client            | K64F   | GCC_ARM   |      123613 |      62276 | 32768 | 65536 |    160580 |
| features-storage-tests-cfstore-add_del                               | K64F   | GCC_ARM   |       96080 |      13052 | 32768 | 65540 |    111360 |
| features-storage-tests-cfstore-close                                 | K64F   | GCC_ARM   |       95520 |      12004 | 32768 | 65540 |    110312 |
| features-storage-tests-cfstore-create                                | K64F   | GCC_ARM   |       99144 |      13036 | 32768 | 65540 |    111344 |
| features-storage-tests-cfstore-example1                              | K64F   | GCC_ARM   |       98592 |      12368 | 32768 | 65536 |    110672 |
| features-storage-tests-cfstore-example2                              | K64F   | GCC_ARM   |       95232 |      12012 | 32768 | 65540 |    110320 |
| features-storage-tests-cfstore-example3                              | K64F   | GCC_ARM   |       95264 |      11856 | 32768 | 65536 |    110160 |
| features-storage-tests-cfstore-example4                              | K64F   | GCC_ARM   |       92632 |      12012 | 32768 | 65540 |    110320 |
| features-storage-tests-cfstore-example5                              | K64F   | GCC_ARM   |       92344 |      11856 | 32768 | 65536 |    110160 |
| features-storage-tests-cfstore-find                                  | K64F   | GCC_ARM   |       96344 |      13028 | 32768 | 65540 |    111336 |
| features-storage-tests-cfstore-find2                                 | K64F   | GCC_ARM   |       93192 |      12004 | 32768 | 65540 |    110312 |
| features-storage-tests-cfstore-flash                                 | K64F   | GCC_ARM   |       97784 |      12532 | 32768 | 65540 |    110840 |
| features-storage-tests-cfstore-flush                                 | K64F   | GCC_ARM   |       96464 |      12012 | 32768 | 65540 |    110320 |
| features-storage-tests-cfstore-flush2                                | K64F   | GCC_ARM   |       95056 |      12004 | 32768 | 65540 |    110312 |
| features-storage-tests-cfstore-init                                  | K64F   | GCC_ARM   |       93120 |      12012 | 32768 | 65540 |    110320 |
| features-storage-tests-cfstore-misc                                  | K64F   | GCC_ARM   |       96808 |      12516 | 32768 | 65540 |    110824 |
| features-storage-tests-cfstore-open                                  | K64F   | GCC_ARM   |       98632 |      12540 | 32768 | 65540 |    110848 |
| features-storage-tests-cfstore-read                                  | K64F   | GCC_ARM   |       94112 |      12540 | 32768 | 65540 |    110848 |
| features-storage-tests-cfstore-write                                 | K64F   | GCC_ARM   |       94488 |      12004 | 32768 | 65540 |    110312 |
| features-storage-tests-flash_journal-basicapi                        | K64F   | GCC_ARM   |      104712 |      21236 | 32768 | 65540 |    119544 |
| frameworks-utest-tests-unit_tests-basic_test                         | K64F   | GCC_ARM   |       71534 |      11468 | 32768 | 65540 |    109776 |
| frameworks-utest-tests-unit_tests-case_async_validate                | K64F   | GCC_ARM   |       74598 |      11468 | 32768 | 65540 |    109776 |
| frameworks-utest-tests-unit_tests-case_control_async                 | K64F   | GCC_ARM   |       74630 |      11476 | 32768 | 65540 |    109784 |
| frameworks-utest-tests-unit_tests-case_control_repeat                | K64F   | GCC_ARM   |       72790 |      11452 | 32768 | 65540 |    109760 |
| frameworks-utest-tests-unit_tests-case_selection                     | K64F   | GCC_ARM   |       72302 |      11468 | 32768 | 65540 |    109776 |
| frameworks-utest-tests-unit_tests-case_setup_failure                 | K64F   | GCC_ARM   |       72630 |      11468 | 32768 | 65540 |    109776 |
| frameworks-utest-tests-unit_tests-case_teardown_failure              | K64F   | GCC_ARM   |       72790 |      11468 | 32768 | 65540 |    109776 |
| frameworks-utest-tests-unit_tests-control_type                       | K64F   | GCC_ARM   |       82462 |      11468 | 32768 | 65540 |    109776 |
| frameworks-utest-tests-unit_tests-minimal_async_scheduler            | K64F   | GCC_ARM   |       72182 |      11468 | 32768 | 65540 |    109776 |
| frameworks-utest-tests-unit_tests-minimal_scheduler                  | K64F   | GCC_ARM   |       71998 |      11468 | 32768 | 65540 |    109776 |
| frameworks-utest-tests-unit_tests-test_assertion_failure_test_setup  | K64F   | GCC_ARM   |       71710 |      11460 | 32768 | 65540 |    109768 |
| frameworks-utest-tests-unit_tests-test_setup_case_selection_failure  | K64F   | GCC_ARM   |       71702 |      11468 | 32768 | 65540 |    109776 |
| frameworks-utest-tests-unit_tests-test_setup_failure                 | K64F   | GCC_ARM   |       71710 |      11468 | 32768 | 65540 |    109776 |
| tests-integration-basic                                              | K64F   | GCC_ARM   |       67566 |      10780 | 32768 | 65540 |    109088 |
| tests-integration-threaded_blinky                                    | K64F   | GCC_ARM   |       68326 |      10780 | 32768 | 65540 |    109088 |
| tests-mbed_drivers-c_strings                                         | K64F   | GCC_ARM   |       74438 |      11468 | 32768 | 65540 |    109776 |
| tests-mbed_drivers-callback                                          | K64F   | GCC_ARM   |       88310 |      11972 | 32768 | 65540 |    110280 |
| tests-mbed_drivers-dev_null                                          | K64F   | GCC_ARM   |       90213 |      10784 | 32768 | 65540 |    109092 |
| tests-mbed_drivers-echo                                              | K64F   | GCC_ARM   |       71918 |      11468 | 32768 | 65540 |    109776 |
| tests-mbed_drivers-generic_tests                                     | K64F   | GCC_ARM   |       77624 |      11468 | 32768 | 65540 |    109776 |
| tests-mbed_drivers-rtc                                               | K64F   | GCC_ARM   |       85854 |      11308 | 32768 | 65540 |    109616 |
| tests-mbed_drivers-stl_features                                      | K64F   | GCC_ARM   |       80726 |      11476 | 32768 | 65540 |    109784 |
| tests-mbed_drivers-ticker                                            | K64F   | GCC_ARM   |       70974 |      11308 | 32768 | 65540 |    109616 |
| tests-mbed_drivers-ticker_2                                          | K64F   | GCC_ARM   |       70790 |      11308 | 32768 | 65540 |    109616 |
| tests-mbed_drivers-ticker_3                                          | K64F   | GCC_ARM   |       71038 |      11308 | 32768 | 65540 |    109616 |
| tests-mbed_drivers-timeout                                           | K64F   | GCC_ARM   |       70886 |      11308 | 32768 | 65540 |    109616 |
| tests-mbed_drivers-wait_us                                           | K64F   | GCC_ARM   |       70414 |      11308 | 32768 | 65540 |    109616 |
| tests-mbedmicro-mbed-attributes                                      | K64F   | GCC_ARM   |       71534 |      11460 | 32768 | 65540 |    109768 |
| tests-mbedmicro-mbed-call_before_main                                | K64F   | GCC_ARM   |       73112 |      10780 | 32768 | 65540 |    109088 |
| tests-mbedmicro-mbed-cpp                                             | K64F   | GCC_ARM   |       73400 |      10780 | 32768 | 65540 |    109088 |
| tests-mbedmicro-mbed-div                                             | K64F   | GCC_ARM   |       73176 |      10780 | 32768 | 65540 |    109088 |
| tests-mbedmicro-rtos-mbed-basic                                      | K64F   | GCC_ARM   |       68390 |      10780 | 32768 | 65540 |    109088 |
| tests-mbedmicro-rtos-mbed-isr                                        | K64F   | GCC_ARM   |       74480 |      10780 | 32768 | 65540 |    109088 |
| tests-mbedmicro-rtos-mbed-mail                                       | K64F   | GCC_ARM   |       74992 |      11300 | 32768 | 65540 |    109608 |
| tests-mbedmicro-rtos-mbed-mutex                                      | K64F   | GCC_ARM   |       74048 |      10780 | 32768 | 65540 |    109088 |
| tests-mbedmicro-rtos-mbed-queue                                      | K64F   | GCC_ARM   |       74912 |      11300 | 32768 | 65540 |    109608 |
| tests-mbedmicro-rtos-mbed-semaphore                                  | K64F   | GCC_ARM   |       74296 |      10780 | 32768 | 65540 |    109088 |
| tests-mbedmicro-rtos-mbed-signals                                    | K64F   | GCC_ARM   |       74328 |      10780 | 32768 | 65540 |    109088 |
| tests-mbedmicro-rtos-mbed-threads                                    | K64F   | GCC_ARM   |       75214 |      11460 | 32768 | 65540 |    109768 |
| tests-mbedmicro-rtos-mbed-timer                                      | K64F   | GCC_ARM   |       68430 |      10780 | 32768 | 65540 |    109088 |
| tests-storage_abstraction-basicapi                                   | K64F   | GCC_ARM   |      107808 |      28908 | 32768 | 65540 |    127216 |
+----------------------------------------------------------------------+--------+-----------+-------------+------------+-------+-------+-----------+
```

Refactored after code review

Refactored parse() function

Polishing

Moved memory usage reporting function call to test.py to group all reporters in one place

Bug-fix: on ARM toolchain we were not fetching statistics from last element of memap result list
2016-07-07 08:35:20 +01:00
Bogdan Marinescu fbb26a405c Fix tests.py so it can work with application defined targets
With this patch in place, tests.py uses targets names instead of target
instances, which makes it possible to use application defined targets
with tests.
2016-07-05 15:52:53 +03:00
Sam Grove 33cec194c6 Revert "Generalize flag handling" 2016-06-24 16:39:01 -05:00
Jimmy Brisson 7b3ef2179f Make mcu and tool arguments many and update all consumers of them 2016-06-24 14:23:19 -05:00
Jimmy Brisson 7e5deaa7d0 standardize on nargs="*" 2016-06-24 14:23:19 -05:00
Jimmy Brisson 3276854f49 fix parse error in test.py and make -n + -p comma separated 2016-06-24 14:23:19 -05:00
Jimmy Brisson b98c8c1c33 Generalize all appropriate arguments and check for file existance 2016-06-24 14:22:47 -05:00
Jimmy Brisson 43e036d6e1 Move to argparse from optparse 2016-06-24 14:22:47 -05:00
Brian Daniels 1bcd64301a Lower case test names, blob matching test names, and sort test names for prints 2016-06-14 02:14:45 +01:00
Brian Daniels f622c591e8 Handling exceptions throughout test flow 2016-06-14 02:14:44 +01:00
Brian Daniels 6796025e78 Fixes for logs and test logic in tools 2016-06-14 02:14:42 +01:00
Mihail Stoyanov f6acb1ffb4 Forward ported changes to tools 2016-06-10 15:19:02 +01:00