Commit Graph

13 Commits

Author SHA1 Message Date
Daisuke Nojiri
c926d7dc7c cts: Fix back-to-back build
Currently eCTS suites share the same directory (e.g. build/stm32l476g
-eval) to put build artifacts even though some files (e.g. board.c)
compile differently suite to suite. So, if cts-i2c-stm32l476g-eval is
built, followed by cts-gpio-stm32l476g-eval, build fails or produces
incorrect binary.

This patch makes eCTS create different directories for each suite.
As a bonus, we can now builds eCTS suites in parallel.

BUG=chromium:654549
BRANCH=none
TEST=make buildall -j (with uncommitted change)

Change-Id: I4abedc917787be5f79b97e0e50d0d08e01bd5f9d
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/398281
2016-10-14 16:05:49 -07:00
Daisuke Nojiri
473ecbe2b3 cts: Add real interrupt test
Interrupt test checks whether DUT can be interrupted by an interrupt
and an interrupt handler can be invoked as expected.

Note the previous interrupt test ported from test/interrupt.c runs in
an emulated environment on the host, thus does not test the real
interrupt capability of the chip.

BUG=chromium:653195
BRANCH=none
TEST=Run cts.py -m interrupt

Change-Id: I21cecff07594f048633d1c1b699fb3a1876379e0
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/363943
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-10-07 21:51:54 -07:00
Daisuke Nojiri
8c22c2dcd7 cts: Add a return code indicating timeout
This patch adds CTS_RC_TIMEOUT, which is returned when test
encounters some sort of timeout.

BUG=none
BRANCH=none
TEST=Run cts.py -m i2c. Make buildall

Change-Id: I6d5cbcdde40f24e797e795f30f002da7621d089e
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/393330
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-10-05 20:58:18 -07:00
Daisuke Nojiri
cab4ccf3f9 cts: Fix error message for uart port being occupied
This patch fixes the error messages displayed when a UART port connected
to DUT or TH is being occupied.

BUG=none
BRANCH=none
TEST=run cts.py -m i2c

Change-Id: I3fbb4068e8ee3af7a1b04f70ae70b3d870a19d2e
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/393327
2016-10-05 17:11:35 -07:00
Daisuke Nojiri
a51cee362a cts: Fail script when build or flash fails
This change makes cts.py fail when building or flashing a module for
DUT or TH fails.

BUG=none
BRANCH=none
TEST=Made cts.py fail by injecting build and flash error

Change-Id: Iec1e11f4a8c261eb4c989b118df218e86cb6f5f1
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/393326
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-10-05 14:33:33 -07:00
Daisuke Nojiri
d6b0a1cc88 cts: Refactor cts.py
Noteworthy changes:
- Move Board and its child classes in common/board.py
- Separate flashing and resetting. Flashing used to imply running tests.
- Move up constants up for better visibility
- Change default suite to 'meta'
- Removed redundant code
- Lots of renames (all lower case names, shorter names, etc.)

BUG=none
BRANCH=none
TEST=Ran meta test and verify the results match the expectations

Change-Id: I158d96e2ee104767d25b2e721d5206e528600381
Reviewed-on: https://chromium-review.googlesource.com/383911
Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-09-13 22:22:18 -07:00
Chris Chen
67f6964aef cts: Debug message support added to cts tests
You can now add debug messages into a cts test and
they will be displayed with the test report html page.

The macro to use is CTS_DEBUG_PRINTF

Adding debug messages can potentially change test
results by slowing down the test, so you can choose
when compiling a test suite if you want the debug
messages present or not by adding --debug as an
argument when you call ./cts --build.

BRANCH=None
BUG=None
TEST=Manual
- Add a debug statement to a test
- Build the test suite with --debug specified
- Flash the boards
- Run './cts/cts.py -r'
- Open /tmp/cts_results/<board_name>/<test_suite>.html
  to view see your debug message for the test

Change-Id: Icad8e0ac5cc905010caa4e7616f81572ce6ac771
Reviewed-on: https://chromium-review.googlesource.com/362475
Commit-Ready: Chris Chen <twothreecc@google.com>
Tested-by: Chris Chen <twothreecc@google.com>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-08-10 15:30:25 -07:00
Chris Chen
7bd4984b01 cts: Added parsing for cts suites
Added test recording when calling reset from command
line. These results are printed on the screen and
saved in /tmp/results/<board>/<module>.txt

BRANCH=None
BUG=None
TEST=Manual
- Connect, build and flash boards
- Navigate to ec/cts
- ./cts.py --run
- Find test results /tmp/results/<board>/<module>.txt
- Tests names should be left aligned in one column
  and their results right aligned in a 2nd column

Change-Id: I3429d6092f2bd5d5f6825245f5439ace3f47f1fa
Reviewed-on: https://chromium-review.googlesource.com/360653
Commit-Ready: Chris Chen <twothreecc@google.com>
Tested-by: Chris Chen <twothreecc@google.com>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-07-26 19:42:33 -07:00
Chris Chen
3e98dec612 cts: Added file to list error codes as integers
BRANCH=None
BUG=None
TEST=Manual
- Connect handshake and gpio test lines between th
  and dut
- Build tests
- run 'cat /dev/ttyACM0' in one terminal
- run 'cat /def/ttyACM1' in another
- Flash boards
- All test results print their test name followed
  by a space and and integer error code

Change-Id: If52e9b50705779b3a291e2d0f6b0721a5b6197d8
Reviewed-on: https://chromium-review.googlesource.com/359988
Commit-Ready: Chris Chen <twothreecc@google.com>
Tested-by: Chris Chen <twothreecc@google.com>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-07-21 13:13:43 -07:00
Daisuke Nojiri
ff950203e0 cts: Disambiguate enum cts_error_code
BUG=none
BRANCH=none
TEST=make -j buildall

Change-Id: I8008fcf8ea5a429ec6c3bd2cc59fe86f43d87ada
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/360180
Reviewed-by: Chris Chen <twothreecc@google.com>
2016-07-15 21:39:20 -07:00
Daisuke Nojiri
b783f0b991 cts: Use pointers for test functions
Test functions are listed in cts.testlist and shared by th.c and dut.c.
This way, we can gurantee the two files are in sync. Also, cts.testlist
is used to count the number of tests automatically.

This allows us to use a for loop to execute each test.

BUG=none
BRANCH=none
TEST=build buildall

Change-Id: I0c811405134fad04f5c6914b1ac38835e212cbd2
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/359619
2016-07-15 21:39:18 -07:00
Chris Chen
846741eddb cts: Added GPIO test suite
Contains code for all the gpio tests so far. Code in
cts_task for th and dut is for testing purposes and
test result reporting will be updated in the next
patch.

BRANCH=None
BUG=None
TEST=Manual
- Connect handshake and gpio test lines between th and dut
- Build tests
- run 'cat /dev/ttyACM0' in one terminal
- run 'cat /def/ttyACM1' in another
- Flash boards
- All test results should print either passed or unknown

Change-Id: I7142fb87a6ce0a20c571cde608fbbe60e35898ea
Reviewed-on: https://chromium-review.googlesource.com/359935
Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
2016-07-15 21:39:16 -07:00
Chris Chen
1b8fa6dbe4 cts: Added sync() function
sync() involves 2 gpios on each board, each labeled
GPIO_HANDSHAKE_OUTPUT and GPIO_HANDSHAKE_INPUT on
their respective boards. They both start low,
then the th wiggles his line up and down, waiting
for the dut to mimic it.

BRANCH=None
BUG=None
TEST=manual
- Connect handshake lines to appropriate
  pins on each board (pins found
  in board's gpio.inc)
- Build tests
- Flash boards
- run 'cat /dev/ttyACM0' in one terminal
- run 'cat /dev/ttyACM1' in another
- They should each have printed
  'successful sync'

Change-Id: I61233bca9605ba89c3628c2a65ca9013c56365ea
Reviewed-on: https://chromium-review.googlesource.com/359355
Commit-Ready: Chris Chen <twothreecc@google.com>
Tested-by: Chris Chen <twothreecc@google.com>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
2016-07-12 11:04:41 -07:00