Commit Graph

23 Commits

Author SHA1 Message Date
Rob Mohr
5e844a9b67 Use cipd openocd on Linux
Change-Id: I1e5432223482f7102c0d6f36fe1034f63cc9bc51
2020-01-10 17:39:52 +00:00
Armando Montanez
c0ad978eac pw_target_runner: Update name change in docs
Updates pw_target_runner (and other) docs to reflect the name change
from pw_test_server to pw_target_runner.

Change-Id: Iffa81088b81a1b83c285949c73fbf93e23f478a3
2020-01-07 18:08:33 +00:00
Armando Montanez
975449b025 stm32f429i-disc1: Update docs
Update docs to reflect improvements to device detection and
pw_target_runner.

Change-Id: Iac29e2efcf976977e6b9bbbf710dcdacd4eae266
2020-01-06 18:19:14 +00:00
Armando Montanez
1644f12c0e stm32f429i-disc1: Fix unit test runner -v flag
The --verbose flag for stm32f429i_disc1_unit_test_runner wasn't properly
changing log level when run as a standalone utility. This change ensures
the -v/--verbose flag properly sets the logging level to debug.

Change-Id: Icf767b3b31834447b1b5d089b05585bc22061999
2020-01-03 23:21:05 +00:00
Armando Montanez
4ec8414d55 stm32f429i-disc1: Cross-platform board detection
Switch to using pyserial's list_ports tool to detect attached
STM32F429I-DISC1 boards. Theoretically, this allows autodetection to
work as expected on macOS/Windows as well.

Change-Id: I8fbde757bbd7a167103b07d6a073bbbbe3053e65
2020-01-03 01:21:26 +00:00
Alexei Frolov
fb27737cd6 Print an error if a host tool is running on copy
If a host tool is running when the pw_host_tool tries to copy a newer
version into the host_tools/ directory, the copy fails. This change
prints out a user-friendly error indicating the problem.

Change-Id: I7b25f709150f40e1ad9c8c7e63cbfa9f9f9a53e5
2020-01-02 20:49:48 +00:00
Alexei Frolov
59a83b41bb Update stm32f429i test server
This change updates the stm32f429i test server and client scripts to use
pw_target_runner instead of pw_test_server.

Change-Id: I82dd2b043c5517571cecff6c0e306056507fc950
2019-12-26 23:25:25 +00:00
Alexei Frolov
514de20e4a Fix stm32f429i test client
* Correctly specify the path to the client script from GN.
* Use subprocess instead of pw_cli.process to remove dependency on
  pw_cli and reduce output log clutter.
* Set test run target as Ninja default.

Change-Id: Iae01eae107a8eb52e26e772120d2f6ed8052ee37
2019-12-14 00:11:17 +00:00
Armando Montanez
8c235cec60
stm32f429i-disc1: Add unit test server
Adds a build argument to the stm32f429i-disc1 target that enables
running tests via the pw_test_server.

Change-Id: I76c98fa25d27c771251e41de8631f156572f7731
2019-12-13 11:33:17 -08:00
Armando Montanez
5104cd68bc pw_cpu_exception: Add CPU exception module
This change introduces pw_cpu_exception, a facade that provides a
high-level interface for handling CPU exceptions.

Change-Id: I1f98ac82dd54040448b2e2ac32a392c49cb6dfba
2019-12-13 11:26:08 -08:00
Armando Montanez
050eae89d2 stm32f429i-disc1: Enable hardware FPU
* Add Cortex-M4 toolchains with floating point hardware instructions.
 * Update stm32f429i-disc1 to use hardware fpu toolchain by default.
 * Add code to enable FPU in pw_dumb_io.

Verified tests that use floating point operations continue to pass.

Change-Id: I76bc7eeaf457eca1abacbc60992648d63dc85bf2
2019-12-13 00:33:46 +00:00
Armando Montanez
0874558cf3 docs: Add 'targets' section
Creates a new section in the docs for target documentation, and adds
some documentation for the stm32f429i-disc1 target.

Change-Id: I0ffbfa56a97458d850834fc0f670b32885b0d2b5
2019-12-12 21:15:16 +00:00
Armando Montanez
8f1139f5d7 stm32f429i-disc1: Automatic board detection
Introduce automatic STM32F429I-DISC1 board detection on linux, and
integrate it with the test target runer so the com port doesn't need to
be specified.

Change-Id: I2d8aa67bd03501934e9f2404f8afcef75e7d6aca
2019-12-06 23:22:18 +00:00
Wyatt Hepler
becb431e5f Apply pw format to the repository
Change-Id: I3c8e4f956dfe6c9e81d3069f72c30c5950852074
2019-12-05 09:31:11 -08:00
Rob Mohr
e11d715936 Add #! line to stm32f429i test runner.
Change-Id: Ida76b2683b6a24e9c60f2fa943672b9c5ed2f23d
2019-12-03 13:28:59 -08:00
Armando Montanez
47b0c5c1cd Use openocd provided by CIPD
Updates Pigweed tools to use OpenOCD provided by CIPD.

Change-Id: Iea80343373bc5d36d223dd327b854e89ee9e274a
2019-12-03 19:50:43 +00:00
Armando Montanez
7753c3edc5 stm32f429i-disc1: improve test runner integration
- Try to use pw_cli logger for test output format.
 - Log each line of captured subprocess output individually.
 - Minor tweaks to log statements.

Example:

...
20191202 14:38:19 OUT [26656] INF [       OK ] Format.ArgumentLargerThanBuffer_ReturnsResourceExhausted
20191202 14:38:19 OUT [26656] INF [ RUN      ] Format.CallFormatWithVaList_CallsCorrectFormatOverload
20191202 14:38:19 OUT [26656] INF [       OK ] Format.CallFormatWithVaList_CallsCorrectFormatOverload
20191202 14:38:19 OUT [26656] INF [==========] Done running all tests.
20191202 14:38:19 OUT [26656] INF [  PASSED  ] 6 test(s).
20191202 14:38:19 OUT [26656] INF [  FAILED  ] 1 test(s).
20191202 14:38:19 OUT [26656] ERR Test suite had one or more failures
20191202 14:38:19 ERR stm32f429i_disc1_unit_test_runner exited with status 1
20191202 14:38:19 INF Test  9/10: [FAIL] format_test
...

Change-Id: I99798f5c7d4770c4cf5def7ae621a374cad7f89b
2019-12-03 00:22:55 +00:00
Armando Montanez
89f02d77cd Simplify stm32f429i-disc1 test runner UI
- Change some info-level logs to be debug.
 - Include openocd config file in python module.
 - Provide default value for openocd_config command line argument.
 - Shorter log format.
 - Don't log backtrace for caught TestingFailure exceptions.

New example output (with test_runner.py):
~/pigweed/pigweed$ pw test --root out/stm32f429i-disc1/ --runner stm32f429i_disc1_unit_test_runner -- --port /dev/ttyACM0

 ▒█████▄   █▓  ▄███▒  ▒█    ▒█ ░▓████▒ ░▓████▒ ▒▓████▄
  ▒█░  █░ ░█▒ ██▒ ▀█▒ ▒█░ █ ▒█  ▒█   ▀  ▒█   ▀  ▒█  ▀█▌
  ▒█▄▄▄█░ ░█▒ █▓░ ▄▄░ ▒█░ █ ▒█  ▒███    ▒███    ░█   █▌
  ▒█▀     ░█░ ▓█   █▓ ░█░ █ ▒█  ▒█   ▄  ▒█   ▄  ░█  ▄█▌
  ▒█      ░█░ ░▓███▀   ▒█▓▀▓█░ ░▓████▒ ░▓████▒ ▒▓████▀

20191202 10:45:09 AM INF Scanning for tests...
20191202 10:45:09 AM INF Found 4 test groups (10 tests).
20191202 10:45:09 AM INF Running test groups //pw_status:tests, //pw_preprocessor:tests, //pw_string:tests, //pw_span:tests
20191202 10:45:09 AM INF Test  1/10: [RUN] format_test
2019-12-02 10:45:09 INFO | Flashing firmware to device...
2019-12-02 10:45:10 INFO | Successfully flashed firmware to device!
2019-12-02 10:45:10 INFO |
[==========] Running all tests.
[ RUN      ] Format.ValidFormatString_Succeeds
[       OK ] Format.ValidFormatString_Succeeds
[ RUN      ] Format.ValidFormatStringAndArguments_Succeeds
[       OK ] Format.ValidFormatStringAndArguments_Succeeds
[ RUN      ] Format.InvalidConversionSpecifier_ReturnsInvalidArgumentAndTerminates
../../pw_string/format_test.cc:51: Failure
      Expected: Status::INVALID_ARGUMENT == result.status()
        Actual: 3 == OK
../../pw_string/format_test.cc:52: Failure
      Expected: "" equals buffer
        Actual:  equals abc 12345
[  FAILED  ] Format.InvalidConversionSpecifier_ReturnsInvalidArgumentAndTerminates
[ RUN      ] Format.EmptyBuffer_ReturnsResourceExhausted
[       OK ] Format.EmptyBuffer_ReturnsResourceExhausted
[ RUN      ] Format.FormatLargerThanBuffer_ReturnsResourceExhausted
[       OK ] Format.FormatLargerThanBuffer_ReturnsResourceExhausted
[ RUN      ] Format.ArgumentLargerThanBuffer_ReturnsResourceExhausted
[       OK ] Format.ArgumentLargerThanBuffer_ReturnsResourceExhausted
[ RUN      ] Format.CallFormatWithVaList_CallsCorrectFormatOverload
[       OK ] Format.CallFormatWithVaList_CallsCorrectFormatOverload
[==========] Done running all tests.
[  PASSED  ] 6 test(s).
[  FAILED  ] 1 test(s).

2019-12-02 10:45:10 ERROR | Test suite had one or more failures.

Change-Id: I8ca4af75bb04ffb8f4a50d26e5ac0ef41e7d762a
2019-12-02 19:45:14 +00:00
Wyatt Hepler
1a96094ce6 Fix copyright notices
- Add missing copright header in conf.py.
- Fix inconsistent copyright notice line breaking.

Change-Id: Ib78f7768643069c49ff986a48a176df9fd06e891
2019-11-27 22:34:02 +00:00
Armando Montanez
3e1b5eb752 Reduce stm32f429i-disc1 test flake
The stm32f429i-disc1 test runner had some flakiness caused by a race
condition between the device and host. This change ensures all the
device test output is captured.

Change-Id: Ic1c68b2e680ab50536c747d31498ef46442afc41
2019-11-26 00:48:59 +00:00
Armando Montanez
2fe3b8de67 Add serial test runner for stm32f429i-disc1
Adds a script that flashes and runs a test on the stm32f429i-disc1
development board. Requires openocd and pyserial.

Example output:
~/pigweed/pigweed$ stm32f429i_disc1_unit_test_runner out/stm32f429i-disc1/obj/pw_unit_test/framework_test.elf --openocd-config targets/stm32f429i-disc1/openocd_stm32f4xx.cfg --port /dev/ttyACM0
TEST - 2019-11-25 13:50:43 - INFO - Launching test binary out/stm32f429i-disc1/obj/pw_unit_test/framework_test.elf
TEST - 2019-11-25 13:50:43 - INFO - Flashing firmware to device...
TEST - 2019-11-25 13:50:44 - INFO - Successfully flashed firmware to device!
TEST - 2019-11-25 13:50:44 - INFO - Test passed!

Change-Id: I111387bd967700e3eab6764a14b1890caedeb68d
2019-11-26 00:48:20 +00:00
Wyatt Hepler
8a823ceebb Size report for pw::string::Format
Add size report comparing pw::string::Format to std::snprintf.

Report with arm-none-eabi-gcc at -Os:

            Using pw::string::Format instead of snprintf
            ────────────────────────────────────────────
┌────────────────────────────┬───────────┬────────┬───────┬────────┐
│            Label           │  Segment  │ Before │ Delta │  After │
├════════════════════════════┼═══════════┼════════┼═══════┼════════┤
│    One string, return size │ SEG FLASH │  2,840 │   +80 │  2,920 │
├────────────────────────────┼───────────┼────────┼───────┼────────┤
│ Ten strings, handle errors │     (all) │ (same) │     0 │ (same) │
├────────────────────────────┼───────────┼────────┼───────┼────────┤
│   Fifty calls, same buffer │ SEG FLASH │  3,816 │   -72 │  3,744 │
└────────────────────────────┴───────────┴────────┴───────┴────────┘

Change-Id: Id484530320b0334cddf676a49ad79444fbbbde9b
2019-11-19 12:58:31 -08:00
Armando Montanez
a69244e4c1 Add stm32f429i-disc1 target and pw_dumb_io
Adds both the stm32f429i-disc1 target and a pw_dumb_io uart-based
backend.

Change-Id: If24379118fc2877485653d61ca66ceeb59ef920a
2019-11-16 00:14:52 +00:00