summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2012-10-10 10:38:07 -0700
committerGerrit <chrome-bot@google.com>2012-11-01 17:20:45 -0700
commit4f410f5468c1ce813450485753ae6f77bca8b7cd (patch)
tree4b2f8e856a2b0774195bf348c05a30ff1f6f549c
parent4769627290a2cdfa851b76f2d1a550654b3b04fb (diff)
downloadchrome-ec-4f410f5468c1ce813450485753ae6f77bca8b7cd.tar.gz
Add initial keyscan test and key matrix
Add a few very basic tests and the required key matrix information. The key matrix is for snow, and the tests are just enough to exercise the feature. BUG=chrome-os-partner:12179 BRANCH=none TEST=manual for now: On snow: ./ectool keyscan 10000 key_sequence.txt See that the test passes. Change-Id: Ibe5a6fe5333102ba7f37be4b526185a48b3c1ae8 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35120 Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--test/key_sequence.txt50
-rw-r--r--test/test-matrix.binbin0 -> 296 bytes
2 files changed, 50 insertions, 0 deletions
diff --git a/test/key_sequence.txt b/test/key_sequence.txt
new file mode 100644
index 0000000000..e9289f4745
--- /dev/null
+++ b/test/key_sequence.txt
@@ -0,0 +1,50 @@
+# Key test sequence
+#
+# Format is <beat>[ <keys>]
+#
+# Note that there must be a single space between <beat> and <keys>, if present.
+# The time is in units of beats, where the beat can be selected according to
+# taste. A typical beat value would be 10ms, meaning that the beat counter
+# will move on every 10,000us.
+#
+# The format of keys is a list of ascii characters, or & followed by a numeric
+# ascii value, or * followed by a numeric keycode value. Spaces are ignored
+# (use '*32' for space).
+#
+# Examples:
+# abc - press a, b and c
+# a &20 - press a and space
+# *58 &13 - press KEY_CAPSLOCK and return (ctrl-m)
+#
+# It is possible for the beat counter to move forward at a variable speed.
+# Provided that keyboard repeat does not occur, this should produce the same
+# result.
+
+test 2-key rollover abc
+expect abc
+# Press a, then b, then release a, then release b
+seq 0
+seq 1 a
+seq 3 ab
+seq 4 abc
+seq 5 b
+seq 8
+seq 9
+endtest
+
+test another
+expect a
+seq 0
+seq 5 a
+seq 10
+endtest
+
+test fast
+expect ab
+seq 0
+seq 10 a
+seq 20 ab
+seq 30 b
+seq 40
+endtest
+
diff --git a/test/test-matrix.bin b/test/test-matrix.bin
new file mode 100644
index 0000000000..e48c761f77
--- /dev/null
+++ b/test/test-matrix.bin
Binary files differ