Changes

Jump to navigation Jump to search
984 bytes added ,  16:24, 23 January 2015
no edit summary
Line 3: Line 3:  
== Overview ==
 
== Overview ==
   −
The ZDTM test-suite is the automated suite that launches individual subtests as processes, waits for them to get prepared, then dumps the process(es) started, then restores them and asks to check whether the restored state is what test thinks to be proper. In order to write more subtests developer should use the API declared below.
+
The ZDTM test-suite is the automated suite that launches individual subtests as processes, waits for them to get prepared, then dumps the process(es) started, then restores them and asks to check whether the restored state is what test thinks to be proper. In order to write more subtests developer should use the API declared below. Tests themselves live in one of <code>test/zdtm/live/</code> sub-directory. The full-cycle suite is the <code>test/zdtm.sh</code> script.
    
== API for test itself ==
 
== API for test itself ==
 +
 +
=== Test body ===
    
The test should clearly describe 3 stages:
 
The test should clearly describe 3 stages:
Line 84: Line 86:  
</pre>
 
</pre>
   −
The ''name'' is some name for the option. The variable of the same name should be declared and the ''--$name'' CLI argument would be passed upon test start (this option would be parsed by <code>test_init()</code> call, so nothing more should be done to have the option available).
+
The ''name'' is some name for the option. The variable of the same name should be declared and the <code>--$name</code> CLI argument would be passed upon test start (this option would be parsed by <code>test_init()</code> call, so nothing more should be done to have the option available).
    
The ''type'' is data type. Currently supported types are ''string'', ''bool'', ''int'', ''uint'', ''long'' and ''ulong''.
 
The ''type'' is data type. Currently supported types are ''string'', ''bool'', ''int'', ''uint'', ''long'' and ''ulong''.
    
Description is just arbitrary text.
 
Description is just arbitrary text.
 +
 +
=== Building and launching ===
 +
 +
Then the test should be added into Makefile. There are several sections where simple tests can be added to.
 +
 +
;<code>TST_NOFILE</code>
 +
:Add your test to this list if the test accepts no options.
 +
 +
;<code>TST_FILE</code>
 +
:Tests here will be started with the <code>--filename $some_name</code> option. The file will ''not'' be created by launcher, test should take care of it itself.
 +
 +
;<code>TST_DIR</code>
 +
:These will be started with the <code>--dirname $some_name</code> option. The directory will ''not'' be created by launcher, test should take care of it itself.
 +
 +
;<code>TST</code>
 +
:These are tests with custom options. For those one should also declare the starting rule in the Makefile like this
 +
<pre>
 +
test.pid: test
 +
$(<D)/$(<F) --pidfile=$@ --outfile=$<.out --OPTIONS-HERE
 +
</pre>
    
== Adding test to automatic suite ==
 
== Adding test to automatic suite ==
    
[[Category: Development]]
 
[[Category: Development]]

Navigation menu