Skip to content

Commit a60dd88

Browse files
committed
docs: apply some bugfixes from master to writing-tests.adoc
1 parent 2d1c2f6 commit a60dd88

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

docs/src/code/writing-tests.adoc

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
== The test framework
55

66
The code base has unit and integration tests that can be executed
7-
automatically to ensure the program work as intended. Such tests are
7+
automatically to ensure the program works as intended. Such tests are
88
often written to trigger a bug and to ensure the bug is detected if it
9-
resurface in the future, but also to validate behavior of components
9+
resurfaces in the future, but also to validate behavior of components
1010
and interfaces.
1111

1212
The tests are collected in the `tests/` directory. The individual tests
@@ -34,7 +34,7 @@ _test.hal_ below the directories specified on the command line, or under
3434
`tests/` if no command line argument is specified. These files
3535
represent three different ways to run the tests.
3636

37-
The _runtests_ script accept the following arguments, see the output
37+
The _runtests_ script accepts the following arguments, see the output
3838
from `scripts/runtests -h` for the authorative list:
3939
----
4040
-n do not remove temporary files for successful tests.
@@ -59,23 +59,23 @@ tests:
5959
.Test script (only one of these three)
6060

6161
test::
62-
A program executed and its exit code and output is checked using
62+
A program that is executed and its exit code and output checked using
6363
either checkresult or expected.
6464

6565
test.sh::
66-
A bash script executed and its exit code and output is checked using
66+
A bash script that is executed and its exit code and output checked using
6767
either checkresult or expected.
6868

6969
test.hal::
70-
A HAL script executed using `halrun -f test.hal` and its exit code
71-
and output is checked using either checkresult or expected.
70+
A HAL script that is executed using `halrun -f test.hal` and its exit code
71+
and output checked using either checkresult or expected.
7272

7373
.Test evaluation
7474

7575
expected::
76-
A file whos content is compared to the output from running the test
76+
A file whose content is compared to the output from running the test
7777
scripts. If the test output is identical to the content of the
78-
expected file, the test succeed.
78+
expected file, the test succeeds.
7979

8080
checkresult::
8181
An excutable file to perform more complex validation than just comparing
@@ -85,7 +85,7 @@ checkresult::
8585
is consulted to validate the test output.
8686

8787
xfail::
88-
If this file exist, a test failure is expected and do not cause
88+
If this file exist, a test failure is expected and does not cause
8989
runtests to return an exit code signaling an error.
9090

9191
skip::
@@ -94,20 +94,20 @@ checkresult::
9494
control::
9595
This file can be used to flag specific needs in the test. At the
9696
moment, the use of _sudo_ can be flagged, and tests requiring sudo
97-
can be skipped when using `runtests -u`. To flag such requirement,
97+
can be skipped when using `runtests -u`. To flag such requirements,
9898
add a line with `Restrictions: sudo` to this file.
9999

100100
== Some testing approaches
101101

102-
There are various ways to structure a test, depending on what one want
102+
There are various ways to structure a test, depending on what one wants
103103
to test. Here are a few ideas on how to do it.
104104

105105
=== Non-interactive "GUI"
106106

107107
If you want to test some operations in the user interface, a useful
108108
approach is is to write a custom "GUI" simulating the operations.
109109
This can be done by creating a normal LinuxCNC setup and pointing the
110-
[DISPLAY] DISPLAY value to a script that do the operations needed to
110+
[DISPLAY] DISPLAY value to a script that does the operations needed to
111111
test the behaviour.
112112

113113
Examples of this approach can be found in `tests/halui/jogging/` and
@@ -118,7 +118,7 @@ Examples of this approach can be found in `tests/halui/jogging/` and
118118
Using the _sampler_ and _halsampler_ HAL components, one can set up a
119119
HAL configuration and collect pin value settings and changes and dump
120120
the result to stdout (or a file). The end result can then be compared
121-
with the expected output to verify if HAL behave as expected.
121+
with the expected output to verify if HAL behaves as expected.
122122

123123
Examples of this approach can be found in `tests/multiclick/` and
124124
`tests/stepgen.2/`.

0 commit comments

Comments
 (0)