GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — linuxcnc/tests at master · caohm/linuxcnc

Expand file tree

/

tests

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

tests

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
abort/feed-rate
abort/feed-rate
 
 
abs.0
abs.0
 
 
alias.0
alias.0
 
 
and-or-not-mux.0
and-or-not-mux.0
 
 
basic
basic
 
 
biquad
biquad
 
 
build
build
 
 
ccomp
ccomp
 
 
counter-encoder.0
counter-encoder.0
 
 
edge
edge
 
 
flipflop.0
flipflop.0
 
 
hal-link-unlink
hal-link-unlink
 
 
halcompile
halcompile
 
 
halmodule.0
halmodule.0
 
 
halmodule.1
halmodule.1
 
 
halrun-getopt-reset
halrun-getopt-reset
 
 
halui
halui
 
 
hard-limits
hard-limits
 
 
hm2-idrom
hm2-idrom
 
 
ilowpass
ilowpass
 
 
interp
interp
 
 
io-startup
io-startup
 
 
lathe
lathe
 
 
limit3.0
limit3.0
 
 
limit3.1
limit3.1
 
 
limit3.2
limit3.2
 
 
linuxcncrsh-tcp
linuxcncrsh-tcp
 
 
linuxcncrsh
linuxcncrsh
 
 
loadrt.1
loadrt.1
 
 
loadrt.2
loadrt.2
 
 
lowlevel/mutex
lowlevel/mutex
 
 
m70-m73
m70-m73
 
 
mdi-queue-length
mdi-queue-length
 
 
mdi-queue
mdi-queue
 
 
mdi-while-queuebuster-waitflag
mdi-while-queuebuster-waitflag
 
 
modparam.0
modparam.0
 
 
module-loading
module-loading
 
 
motion-logger
motion-logger
 
 
motion
motion
 
 
multiclick
multiclick
 
 
mux
mux
 
 
near.0
near.0
 
 
overrun
overrun
 
 
oword
oword
 
 
realtime-math
realtime-math
 
 
remap
remap
 
 
rs274ngc-startup
rs274ngc-startup
 
 
rtapi_printf.0
rtapi_printf.0
 
 
save.0
save.0
 
 
save.1
save.1
 
 
source.0
source.0
 
 
startup-state
startup-state
 
 
statbuffer-g5x-abort
statbuffer-g5x-abort
 
 
stepgen.0
stepgen.0
 
 
stepgen.1
stepgen.1
 
 
stepgen.2
stepgen.2
 
 
symbols.0
symbols.0
 
 
symbols.1
symbols.1
 
 
t0
t0
 
 
tclsh-extensions
tclsh-extensions
 
 
threads.0
threads.0
 
 
threads.1
threads.1
 
 
timedelay.0
timedelay.0
 
 
tlo
tlo
 
 
toolchanger
toolchanger
 
 
trajectory-planner/circular-arcs
trajectory-planner/circular-arcs
 
 
twopass-personality
twopass-personality
 
 
twopass
twopass
 
 
uspace/spawnv-root
uspace/spawnv-root
 
 
.gitignore
.gitignore
 
 
README
README
 
 

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.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.