@@ -226,6 +226,7 @@ All config options are listed there:
226226``` yaml
227227
228228input : test/*.in
229+ silent : false
229230good_output : test/%input_file_name.out
230231good_err : test/%input_file_name.err
231232need_error_files : false
@@ -266,6 +267,80 @@ prog2:
266267
267268You must identify program by the command it calls.
268269
270+ ### Hooks
271+
272+ You can provide hooks commands for any of testing lifecycle state.
273+
274+ All available hooks are:
275+
276+ * <b >init</b > - called when testing begins
277+ * <b >deinit</b > - called when testing ends
278+ * <b >test_case_start</b > - called when new test file is tested
279+ * <b >test_case_finish</b > - called when the test file was tested
280+ * <b >test_case_fail</b > - called when test fails
281+ * <b >test_case_fail_out</b > - called when test fails on std output (launched after <b >test_case_fail</b >)
282+ * <b >test_case_fail_err</b > - called when test fails on error output (launched after <b >test_case_fail</b >)
283+ * <b >test_case_fail_success</b > - called when test succeeded
284+
285+ ** Please note that:**
286+ You can add mutliple commands that are executed in order from up to the bottom.
287+ If the command begins with ` @ ` character then it's output is directly displayed.
288+ If not then utest can change it to be more readable to the user!
289+
290+ ``` yaml
291+
292+ input : test/*.in
293+ good_output : test/%input_file_name.out
294+ need_error_files : false
295+ executions :
296+ - prog1
297+ - prog2
298+ hooks :
299+ init :
300+ - @echo Testing
301+ - @echo Prepare input...
302+ deinit :
303+ - @echo Goodbye
304+ test_case_fail :
305+ - @echo [%{input_file}] Test case failed for %{param_prog}
306+ test_case_success :
307+ - @echo [%{input_file}] Test case successed for %{param_prog}
308+ test_case_fail_out :
309+ - @echo [%{input_file}] FAILED ON OUTPUT
310+ test_case_fail_err :
311+ - @echo [%{input_file}] FAILED ON ERR
312+ - @echo Whats a shame
313+ test_case_start :
314+ - @echo New test case jsut started %{input_file}
315+ test_case_finish :
316+ - @echo The test case was finished
317+ prog1 :
318+ command : ./test/totest.sh
319+ args : %input_file_name
320+ pipes_out :
321+ - echo 15 > %output
322+ prog2 :
323+ command : echo 159
324+
325+ ```
326+
327+ ### Custom output format
328+
329+ Using ` --tsilent ` flags allows only hooks to write output.
330+ So if you use ` @ ` sign along with hooks (see ** Hooks** section)
331+ you can make utest output any format of the output you want!
332+
333+ Example of outputing ` ERR <file> ` only on errors.
334+
335+ ``` yaml
336+
337+ hooks :
338+ test_case_fail :
339+ - @echo ERR %{input_file}
340+ ```
341+
342+ Simple enough, right?
343+
269344[ badge sts ] : https://img.shields.io/badge/-styczynsky_digital_systems-blue.svg?style=flat-square&logoWidth=20&logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABYAAAAXCAYAAAAP6L%2BeAAAABmJLR0QA%2FwD%2FAP%2BgvaeTAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAB3RJTUUH4AgSEh0nVTTLngAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUHAAAAm0lEQVQ4y2Pc%2Bkz2PwMNAAs2wVMzk4jSbJY%2BD6ccEwONACMsKIh1JSEgbXKeQdr4PO1cPPQMZiGkoC7bkCQD7%2Fx7znDn35AOClK9PEJSBbNYAJz999UGrOLocsM0KHB5EZ%2FXPxiVMDAwMDD8SP3DwJA6kFka5hJCQOBcDwMDAwPDm3%2FbGBj%2BbR8tNrFUTbiAB8tknHI7%2FuTilAMA9aAwA8miDpgAAAAASUVORK5CYII%3D
270345
271346[ badge download ] : https://img.shields.io/badge/-download_me!-green.svg?style=flat-square&logoWidth=10&logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABkAAAArCAYAAACNWyPFAAAABmJLR0QA%2FwD%2FAP%2BgvaeTAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAB3RJTUUH4AgTDjEFFOXcpQAAAM1JREFUWMPt2EsOgzAMBFDPJHD%2F80Jid1G1KpR8SqKu7C2QJzwWsoCZSWedb0Tvg5Q%2FlCOOOOKII4444ogjjvxW8bTjYtK57zNTSoCdNm5VBcmRhdua7SJpKaXhN2hmEmO0fd%2BnANXgl2WxbduGAVUFVbUY9rquPVARyDmDpJCktKBK66pACOE5Ia%2FhUlUhaTPm9xM4ZEJScs6YDXwFH0IYgq6Ay%2Bm6C5WAQyYXo9edUQ2oIr1Q5TPUh4iImJkAsMI1AO3O4u4fiV5AROQBGVB7Fu2akxMAAAAASUVORK5CYII%3D
@@ -276,4 +351,4 @@ You must identify program by the command it calls.
276351
277352[ screenshot 1 ] : https://raw.githubusercontent.com/styczynski/bash-universal-tester/master/static/screenshots/screenshot1.png
278353
279- [ link download latest ] : https://github.com/styczynski/bash-universal-tester/archive/1.6.2 .zip
354+ [ link download latest ] : https://github.com/styczynski/bash-universal-tester/archive/1.8.0 .zip
0 commit comments