summaryrefslogtreecommitdiff
path: root/test/hooks.c
Commit message (Collapse)AuthorAgeFilesLines
* Update license boilerplate text in source code filesMike Frysinger2022-09-121-1/+1
| | | | | | | | | | | | | | | Normally we don't do this, but enough changes have accumulated that we're doing a tree-wide one-off update of the name & style. BRANCH=none BUG=chromium:1098010 TEST=`repo upload` works Change-Id: Icd3a1723c20595356af83d190b2c6a9078b3013b Signed-off-by: Mike Frysinger <vapier@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3891203 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* tree-wide: const-ify argv for console commandsCaveh Jalali2022-09-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | This updates the API for console commands from "int cmd(int argc, char **argv)" to "int cmd(int argc, const char **argv)" which is more accurate and in line with common convention. BRANCH=none BUG=b:244387210 TEST="make buildall" passes TEST="zmake build -a" passes TEST="util/compare_build.sh -b all" passes TEST="./twister -v -T zephyr/test" passes Cq-Depend: chrome-internal:4960125 Cq-Depend: chrome-internal:4959932 Change-Id: I57de9f35b85b8f3c7119df36aefb2abf25d2625f Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3863941 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* test/hooks.c: Format with clang-formatJack Rosenthal2022-07-011-6/+3
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: Iadd3037bdedd42ab6320588fdaacf58dc43c212b Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3730506 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* test: Pass commandline arguments to run_testTom Hughes2020-05-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | run_test is called by the "runtest" console command. Console commands can take arguments, so pass along the arguments to run_test to allow parameters to be passed to run_test. The following command was used for automatic replacement: git grep --name-only 'void run_test(void)' |\ xargs sed -i 's#void run_test(void)#void run_test(int argc, char **argv)##' BRANCH=none BUG=b:155897971 TEST=make buildall -j TEST=Build and flash flash_write_protect test > runtest 1 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ib20b955d5ec6b98f525c94c24aadefd7a6a320a5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2209418 Reviewed-by: Yicheng Li <yichengli@chromium.org> Commit-Queue: Yicheng Li <yichengli@chromium.org> Tested-by: Yicheng Li <yichengli@chromium.org>
* test: add repeating deferred testJett Rink2020-01-311-0/+26
| | | | | | | | | | | | | | | Adding simple unit test that ensures that a deferred call can call itself and won't repeat forever. I thought this might be a problem, but it wasn't. We might as well add this code as a unit test. BRANCH=none BUG=none TEST=test passes Change-Id: Ie9791606e4a401821594df122481f22d87eadbbd Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2025073 Reviewed-by: Diana Z <dzigterman@chromium.org>
* LICENSE: remove unnecessary (c) after CopyrightTom Hughes2019-06-191-1/+1
| | | | | | | | | | | | | | | | Ran the following command: git grep -l 'Copyright (c)' | \ xargs sed -i 's/Copyright (c)/Copyright/g' BRANCH=none BUG=none TEST=make buildall -j Change-Id: I6cc4a0f7e8b30d5b5f97d53c031c299f3e164ca7 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1663262 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* Deferred: Use deferred_data instead of function pointerAnton Staaf2016-04-181-7/+11
| | | | | | | | | | | | | | | | | | | | | Previously calls to hook_call_deferred were passed the function to call, which was then looked up in the .rodata.deferred section with a linear search. This linear search can be replaced with a subtract by passing the pointer to the deferred_data object created when DECLARE_DEFERRED was invoked. Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=None BUG=None CQ-DEPEND=CL:*255812 TEST=make buildall -j Change-Id: I951dd1541302875b102dd086154cf05591694440 Reviewed-on: https://chromium-review.googlesource.com/334315 Commit-Ready: Bill Richardson <wfrichar@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Fix an integer underflow bug in hooks testVic (Chun-Ju) Yang2014-01-081-1/+1
| | | | | | | | | | | | | | | The variable 'interval' is declared as unsigned integer, and this sometimes causes an integer underflow when substracting it by SECOND, and in turns leads to false test failure. Changing it to signed integer. BUG=chrome-os-partner:19236 TEST=Repeatedly run hooks test BRANCH=None Change-Id: Ic6d8001f90fb8756b6bdadf811a668c02fbccb34 Signed-off-by: Vic (Chun-Ju) Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/181882 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Clean up hook priorties on LM4Randall Spangler2013-11-041-0/+1
| | | | | | | | | | | | | | | | | | | | Fan no longer needs a special priority to wait for the host memmap to become available, since LPC inits earlier. I2C and PECI don't need explicit ordering on freq change. Thermal now uses the explicit prio for temp sensors done. Commented hook test. BUG=chromium:314768 BRANCH=none TEST=boot link; enable/disable PLL; verify fanset and temps commands work afterwards. Change-Id: I71766614dff2950dd307acd0635405e6b59e330a Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/175601 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Add boot key testVic Yang2013-09-051-2/+2
| | | | | | | | | | | | | This checks boot key combination like Power-F3-ESC and Power-F3-Down can be properly detected. BUG=chrome-os-partner:19236 TEST=Pass kb_scan test BRANCH=None Change-Id: I180918977299219a8421798dac2ab9fed84ef9a2 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/167802
* Lessen timing constraints in hooks testVic Yang2013-07-231-3/+3
| | | | | | | | | | | | | | HOOK_TICK and HOOK_SECOND aren't firing with precise interval. Let's lessen the timing constraints. BUG=chromium:263288 TEST=Pass all tests BRANCH=None Change-Id: Ic093c2a27ed1b8621469a4097e567b80d1eeb50d Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/63144 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* More hooks unit testVic Yang2013-06-131-0/+10
| | | | | | | | | | | | | Checks we cannot call non-registered deferred functions. BUG=chrome-os-partner:19236 TEST=Pass the test. BRANCH=None Change-Id: I6cf67f85c7749632627819cc05e6809c040fb697 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/58330 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Adjust hooks test timingVic Yang2013-05-171-11/+16
| | | | | | | | | | | | | | | | We unit test to be as less time sensitive as possible. This change adjusts the timing in the test to ensure we have enough time for context switching. Otherwise we get false negative sometimes. BUG=chrome-os-partner:19236 TEST=Repeatedly run the test and see it passes. BRANCH=None Change-Id: I90c1200641cb02f95bd7631bd2870ad21b21bffc Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/51562 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Relax timing constraints in hooks testVic Yang2013-05-151-2/+2
| | | | | | | | | | | | | | Current timing constraints are too tight that the test sometimes fails when it shouldn't. BUG=chrome-os-partner:19236 TEST=Pass the test BRANCH=None Change-Id: Ib94ff44691ba36f14dbf02319d0371770b5ece5d Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/51250 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Add hook testVic Yang2013-05-141-0/+127
Test of hook functionality. BUG=chrome-os-partner:19236 TEST=Pass the test BRANCH=None Change-Id: I4700f3061edd0707932e935a719fc73c3976892e Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/50957 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>