linuxcnc/tests
Chris Radek 1b33be6aef Test for bug424
This exercises the three possibilities that can come after a #

 <name>
 unary or binary operator
 integer
2018-03-19 22:18:59 -05:00
..
abort/feed-rate tests: enable the abort-vs-feed-rate test created a few commits ago 2016-10-20 13:34:27 -05:00
abs.0
alias.0
and-or-not-mux.0
basic
biquad
build
ccomp Fix bug 160: surprise motion after g41/no move/g40 2016-10-21 13:58:50 -05:00
comp
comp-extralib
counter-encoder.0
edge
flipflop.0
hal-link-unlink
halmodule.0
halui tests: make timeouts simpler & smarter in halui/jogging test 2017-06-18 13:45:28 -06:00
hard-limits hard-limits test: try again to detect end-of-motion 2016-07-27 14:33:29 -06:00
hm2-idrom tests: fixup hm2-idrom test to match new hm2 PD error message 2017-04-22 16:32:38 -06:00
ilowpass tests: add a test of ilowpass with low gain 2017-04-10 11:50:52 -06:00
interp Test for bug424 2018-03-19 22:18:59 -05:00
io-startup
lathe
limit3 limit3 tests: move old limit3.[0-2] to limit3 directory 2018-01-11 19:24:15 -06:00
linuxcncrsh
linuxcncrsh-tcp
loadrt.1
loadrt.2
m70-m73
mdi-queue
mdi-queue-length tests: add a test of stat.queued_mdi_commands 2017-02-10 15:02:14 -07:00
mdi-while-queuebuster-waitflag Add mdi-while-queuebuster-waitflag regression test 2016-09-21 18:46:21 -05:00
modparam.0
module-loading
motion
motion-logger Merge remote-tracking branch 'origin/2.6' into 2.7 2016-10-04 11:59:35 -06:00
multiclick
mux
near.0
overrun
oword
realtime-math tests: verify that the exported realtime math functions exist, except for round() 2015-12-23 11:42:13 -07:00
remap Merge branch 'remap-dup-oword-lcnc-2.6' of https://github.com/zultron/machinekit into 2.6 2016-09-24 13:36:23 -05:00
rs274ngc-startup tests: fix a cut/paste error 2016-09-03 07:56:04 -06:00
rtapi_printf.0
save.0
save.1
source.0
startup-state tests: protect sim.var file, dpkg removes *.orig 2018-01-17 09:21:20 -07:00
statbuffer-g5x-abort skip the tests that fail without the task fixes 2016-07-28 22:34:16 -06:00
stepgen.0
stepgen.1
stepgen.2
symbols.0 tests: fix a compiler warning that fails this test on Jessie 2015-12-27 15:46:01 -07:00
symbols.1
t0 t0 tests: let introspection complete before continuing the test 2017-05-31 21:13:32 +00:00
threads.0
threads.1
timedelay.0
tlo
toolchanger test: add tests of reloading the loaded tool 2018-02-21 17:38:11 -07:00
trajectory-planner/circular-arcs
usercomp.0
.gitignore
README

The HAL test suite
~~~~~~~~~~~~~~~~~~~
The tests in these directories serve to test the behavior of HAL components.

Each subdirectory of this directory may contain a test item.  The runtests
script recurses through the directory structure, so multiple tests could
be structured as
	tests/
		xyz.0
		xyz.1
		xyz.2
or
	tests/
		xyz/
			0	
			1	
			2	


Two types of tests are supported: Regression tests, in which the output is
tested against a "known good" output, and functional tests, in which the
output is fed to a program that can determine whether it is correct or not


Running the tests
~~~~~~~~~~~~~~~~~
Currently, tests only work with the "run in place" configuration.  They
can be run by executing (from the top emc2 directory)
	scripts/runtests tests
A subset of the tests can also be run:
	scripts/runtests tests/xyz tests/a*
The directories named on the commandline are searched recursively for
'test.hal' or 'test.sh' files, and a directory with such a file is
assumed to contain a regression test or a functional test.

Tests may contain files other than the ones specified below.  For instance,
when using 'streamer' data as test input, a shell script with
"halstreamer<<EOF" and a "here document" will generally be present.
(see and-or-not-mux.0/runstreamer for an example)

Regression Tests
~~~~~~~~~~~~~~~~
A regression test should consist of these three files:
	README
		A human-readable file describing the test
	test.hal *or* test.sh *or* test
		The test script to execute.  test.hal is executed with
		'halrun -f', test.sh is executed with 'bash -x', and
		test is executed as ./test
	expected
		A file whose contents are compared with the stdout of
			halrun -f test.hal

A typical regression test will load several components, usually including
'threads' and 'sampler', and often including 'streamer', then collect samples
from some number of calls to the realtime thread, then exit.

Regression test "test.hal" files will almost always include the line
	setexact_for_test_suite_only
which causes HAL to act as though the requested base_period was available.
Otherwise, results will differ slightly depending on the actual base_period
and regression tests will fail.

The test passes if the expected and actual output are identical.
Otherwise, the test fails.


Functional Tests
~~~~~~~~~~~~~~~~
A functional test should consist of three files:
	README
		A human-readable file describing the test
	test.hal *or* test.sh *or* test
		The test script to execute.  test.hal is executed with
		'halrun -f', test.sh is executed with 'bash -x', and
		test is executed as ./test
	checkresult
		An executable file (such as a shell or python script)
		which determines if the stdout of
			halrun -f test.hal
		indicates success or failure

Regression test "test.hal" files will often include the line
	setexact_for_test_suite_only
which causes HAL to act as though the requested base_period was available.
Otherwise, results will differ slightly depending on the actual base_period,
which could affect whether 'checkresult' gives an accurate result.

A typical regression test will load several components, usually including
'threads' and 'sample', then collect samples from some number of calls
to the realtime thread, then exit.  'checkresult' will look at the output
and see if it indicates success.

The test passes if the command "checkresult actual" returns a shell
success value (exit code 0).  Otherwise, the test fails.