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
Brian Daniels
51c575dcc6
Fixed traceback in build_api (typo of resources variable in build_library)
2016-07-22 17:49:54 -05:00
Mihail Stoyanov
ac86584c42
Unify common routines in build_api.py
...
Introduce prepare_toolchain() which handles:
* deduplication of src_paths
* config initialization
* toolchain initialization
* toolchain flags
* returns toolchain
Introduce scan_resources() which handles:
* scanning of sources
* scanning of include dirs
* inclusion of addition include dirs
* returns resources
2016-07-22 22:21:39 +01:00
0xc0170
edf015ad92
Merge branch 'master' into release
...
Conflicts:
tools/export/uvision4.py
tools/export/uvision5.py
2016-07-19 08:44:34 +01:00
Jimmy Brisson
6aa2bbb801
[tools/build_api] Retrun truthy value on success from build_*
...
before:
```
$ python tools/build.py -m NRF51_DK --source . -t GCC_ARM,ARM --build build --silent
[SNIP]
Completed in: (3.39)s
Build skipped:
* GCC_ARM::NRF51_DK
* ARM::NRF51_DK
```
after:
```
$ python tools/build.py -m NRF51_DK --source . -t GCC_ARM,ARM --build build --silent
[SNIP]
Completed in: (3.43)s
Build successes:
* GCC_ARM::NRF51_DK
* ARM::NRF51_DK
```
2016-07-14 13:55:51 -05:00
0xc0170
9c3801b7b5
Config - fix - use basetring to check if a target is string
2016-07-13 14:59:48 +01: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
e3d29fe5d2
Improve configuration handling in build_project
...
The configuration object is now created early in the build_project
function. This way, if there's a mbed_app.json that contains a custom
target, that target is taken into account. This is useful (for example)
when compiling tests for an application that defines a custom target.
2016-07-05 15:40:12 +03:00
Bogdan Marinescu
b4e8cf655d
Fixed config-related options for the IAR assembler
...
The IAR assembler doesn't accept '--preinclude', but it accepts -D.
This commit changes the way the config-related macros are propagated
to the IAR assembler to use '-D' instead of '--preinclude'. This is
the only change related to functionality, the others are small,
backward compatible changes to the config code to make passing arguments
to the toolchain instances easier.
Tested by compiled blinky with IAR, GCC_ARM and ARM for K64F.
2016-06-27 15:54:38 +03:00
Mihail Stoyanov
89bb38f683
Fixed exporters to support features
...
Unified how resources are loaded into the configuration system
(Config.load_resources) and applied it to build_api and exporters
2016-06-16 18:12:04 +01:00
Martin Kojtal
1e18ea230a
Merge pull request #1957 from mbedmicro/config_headers
...
Configuration in header files - step 1
2016-06-16 18:47:15 +02:00
Bogdan Marinescu
a164224acf
Changed prefix file name to mbed_conf.h
...
Also changed some function names to make it clear that the prefix
headers feature is only used for config.
2016-06-16 17:01:41 +03:00
Bogdan Marinescu
85eca37d29
Added toolchain support for configuration in prefix headers
...
This commit uses the previously introduced feature of generating
configuration data as a C header file rather than as command line macro
definitions. Each toolchain was modified to use prefix headers if
requested, and build_api.py was modified to set up the toolchain's
prefix header content using the data generated by the config system.
Tested by compiling blinky for GCC and ARMCC. I'm having a few issues
with my IAR license currently, but both ARMCC and IAR use the same
`--preinclude` option for prefix headers, so this shouldn't be an issue.
Note that at the moment all exporters still use the previous
configuration data mechanism (individual macro definitions as opposed to
a prefix header). Exporters will be updated in one or more PRs that will
follow.
2016-06-16 16:13:50 +03:00
Mihail Stoyanov
e44566b319
Fix libraries being built with features support
2016-06-16 00:31:25 +01:00
Mihail Stoyanov
a81746c8f6
Fix for features not being included
...
Also improve compile speed by not re-scanning the source locations
2016-06-15 22:21:31 +01:00
Sam Grove
7e0e6854b9
Merge pull request #1940 from geky/fix-features
...
[build tools] Added better support for features and recursive configs
2016-06-15 18:46:38 +01:00
Mihail Stoyanov
99ed4e03f1
Restore original compile sources routine
2016-06-15 17:18:40 +01:00
Brian Daniels
5a46ac773b
Fixing test builds for devices with softdevices.
...
Previously, .hex files were not copied when building source as a library.
This prevents builds that pre compile source as a library and then
includes the build directory as the only source (because there is no
softdevice present). This PR copies hex files when compiling source
as a library.
2016-06-15 15:21:16 +01:00
Christopher Haster
41daccf8d9
[build tools] Fixed masked out configuration error
2016-06-15 08:38:20 -05:00
Christopher Haster
6da324fa3f
[build tools] Added test coverage for config features feature
2016-06-15 08:38:20 -05:00
Christopher Haster
ce0606a756
[build tools] Added better support for features and recursive configs
...
per @screamerbg
2016-06-15 08:38:20 -05:00
Brian Daniels
6796025e78
Fixes for logs and test logic in tools
2016-06-14 02:14:42 +01:00
Mihail Stoyanov
dcff9b15e7
Minor update to tools - logging of tests and output
2016-06-14 01:57:01 +01:00
Mihail Stoyanov
9dbf80722d
Aligned make.py and build.py options
2016-06-12 01:06:15 +01:00
Mihail Stoyanov
f6acb1ffb4
Forward ported changes to tools
2016-06-10 15:19:02 +01:00
Mihail Stoyanov
9f62d70fbf
Update project generator script to allow working with any source
...
Update test exporters script
Update travis build script
Added config system CLI script
Fixed building of legacy libraries and layouts
2016-06-10 02:24:27 +01:00
Mihail Stoyanov
c2e3001739
Add config system, memap, updates to build_api and toolchains
2016-06-09 23:50:03 +01:00
Mihail Stoyanov
3d45b2cdbb
Renamed workspace_tools folder to tools
2016-06-09 21:34:53 +01:00