From 26414a69824a37a65c0fb3a6c423f4cb6c1ef068 Mon Sep 17 00:00:00 2001 From: Cody McGinnis Date: Fri, 28 Aug 2020 16:21:31 -0400 Subject: fix(docs): move testing docs to website docs --- docs/docs/dev-tests.md | 23 +++++++++++++++++++++++ docs/sidebars.js | 1 + 2 files changed, 24 insertions(+) create mode 100644 docs/docs/dev-tests.md (limited to 'docs') diff --git a/docs/docs/dev-tests.md b/docs/docs/dev-tests.md new file mode 100644 index 0000000..1709ccd --- /dev/null +++ b/docs/docs/dev-tests.md @@ -0,0 +1,23 @@ +# Basics +Running tests requires native [posix support](./dev-posix-board). Any folder under `/app/tests` +containing `native_posix.keymap` will be selected when running `./run-test.sh all`. + +`test_case/events.patterns` contains sed patterns that will select the interesting output from the +application + +`test_case/keycode_events.snapshot` contains the expected output after applying `events.pattern` to +the output + +`test_case/native_posix.keymap` defines the keys and the mock key presses. Most tests include a +common keymap for their test set + +## Creating a New Test Set +1. Copy the test set that most closely resembles the tests you will be creating. +2. Rename the newly created test set to the behavior you're testing e.g, toggle-layer +3. Modify `behavior_keymap.dtsi` to create a keymap using the behavior and related behaviors +4. Modify `test_case/native_posix.keymap` for a simulated use case +5. Modify `test_case/events.patterns` to collect relevant logs to the test + - See: [sed manual](https://www.gnu.org/software/sed/manual/sed.html) and + [tutorial](https://www.digitalocean.com/community/tutorials/the-basics-of-using-the-sed-stream-editor-to-manipulate-text-in-linux) +6. Modify `test_case/keycode_events.snapshot` for to include the expected output +7. Repeat steps 4 to 6 for every test case \ No newline at end of file diff --git a/docs/sidebars.js b/docs/sidebars.js index 51313fc..d426667 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -20,6 +20,7 @@ module.exports = { "dev-setup", "dev-boards-shields-keymaps", "dev-posix-board", + "dev-tests", ], "Dev Guides": ["dev-guide-new-shield", "dev-guide-usb-logging"], }, -- cgit v1.2.3 From 205a54baeb75f631795c3de34948e5e9f1af0083 Mon Sep 17 00:00:00 2001 From: Cody McGinnis Date: Fri, 28 Aug 2020 16:21:31 -0400 Subject: fix(docs): update the testing docs --- docs/docs/dev-tests.md | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'docs') diff --git a/docs/docs/dev-tests.md b/docs/docs/dev-tests.md index 1709ccd..68d4725 100644 --- a/docs/docs/dev-tests.md +++ b/docs/docs/dev-tests.md @@ -1,15 +1,11 @@ -# Basics -Running tests requires native [posix support](./dev-posix-board). Any folder under `/app/tests` -containing `native_posix.keymap` will be selected when running `./run-test.sh all`. - -`test_case/events.patterns` contains sed patterns that will select the interesting output from the -application +--- +id: dev-tests +title: Tests +sidebar_label: Tests +--- -`test_case/keycode_events.snapshot` contains the expected output after applying `events.pattern` to -the output - -`test_case/native_posix.keymap` defines the keys and the mock key presses. Most tests include a -common keymap for their test set +Running tests requires [native posix support](./dev-posix-board). Any folder under `/app/tests` +containing `native_posix.keymap` will be selected when running `./run-test.sh all`. ## Creating a New Test Set 1. Copy the test set that most closely resembles the tests you will be creating. @@ -20,4 +16,5 @@ common keymap for their test set - See: [sed manual](https://www.gnu.org/software/sed/manual/sed.html) and [tutorial](https://www.digitalocean.com/community/tutorials/the-basics-of-using-the-sed-stream-editor-to-manipulate-text-in-linux) 6. Modify `test_case/keycode_events.snapshot` for to include the expected output -7. Repeat steps 4 to 6 for every test case \ No newline at end of file +7. Rename the `test_case` folder to describe the test. +8. Repeat steps 4 to 7 for every test case \ No newline at end of file -- cgit v1.2.3