summaryrefslogtreecommitdiff
path: root/cts/common/cts_common.h
Commit message (Collapse)AuthorAgeFilesLines
* eCTS: Print start marker before syncDaisuke Nojiri2017-06-271-18/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes each test print start marker before sync. This will allow us to distinguish the failure before even sync is attempted (CTS_RC_DID_NOT_START, thus probably caused by the previous test) and the failure caused by the hanging partner, in which case the one good and alive will be stuck in sync (and should return _DID_NOT_END or even better _BAD_SYNC once we implement timeout in sync). This patch also: * Adds did_not_start_test to and removes debug_test from meta suite * Consolidates test runner loops into common cts_main_loop * Removes dut_common.h and th_common.h * Removes debug print macro and CTS_DEBUG * Replaces all infinite loops after tests with task_wait_event(-1) * Removes meaningless comments and debug printfs * Removes CTS_TEST_ID_* * Adds sync() to task suite BUG=chromium:736104 BRANCH=none TEST=Run run_ects.sh and verify all tests pass Change-Id: I6ccdf26afac6b8e8cb16483c5d75e4e77e7962f4 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/545176
* eCTS: Convert hook test suite to current formatDaisuke Nojiri2017-06-271-0/+2
| | | | | | | | | | | | | | | | | | This patch updates the hook test suite so that it can be run within the current framework. BUG=chromium:736047 BRANCH=none TEST=cts.py -m hook test name TH_RETURN_CODE DUT_RETURN_CODE TH_STR DUT_STR RESULT test_init_hook SUCCESS SUCCESS 1 1 PASS test_ticks SUCCESS SUCCESS 1 1 PASS test_priority SUCCESS SUCCESS 1 1 PASS test_deferred SUCCESS SUCCESS 1 1 PASS Change-Id: I3e7f29da61e794b06b03241f3d7706c2db94b5be Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/545084
* cts: Add real interrupt testDaisuke Nojiri2016-10-071-1/+2
| | | | | | | | | | | | | | | | | | 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>
* cts: Debug message support added to cts testsChris Chen2016-08-101-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* cts: Added file to list error codes as integersChris Chen2016-07-211-5/+3
| | | | | | | | | | | | | | | | | | | | 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>
* cts: Disambiguate enum cts_error_codeDaisuke Nojiri2016-07-151-4/+4
| | | | | | | | | | | 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>
* cts: Use pointers for test functionsDaisuke Nojiri2016-07-151-0/+2
| | | | | | | | | | | | | | | | 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
* cts: Added sync() functionChris Chen2016-07-121-0/+26
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>