tests: add and use bt_grep_ok
[babeltrace.git] / tests / cli / test-help.sh
index a950adc633672bff5f85bd0adb4c9ba405856244..882f6c533f49d9b588ae713d7eafbcf35f01883f 100755 (executable)
@@ -32,8 +32,10 @@ is_empty()
 bt_cli "${stdout}" "${stderr}" help ctf
 ok $? "help ctf plugin exit status"
 
-bt_grep --silent 'Description: CTF input and output' "${stdout}"
-ok $? "help ctf plugin expected output"
+bt_grep_ok \
+       'Description: CTF input and output' \
+       "${stdout}" \
+       "help ctf plugin expected output"
 
 is_empty "${stderr}"
 ok $? "help ctf plugin produces no error"
@@ -42,8 +44,10 @@ ok $? "help ctf plugin produces no error"
 bt_cli "${stdout}" "${stderr}" help src.ctf.fs
 ok $? "help src.ctf.fs component class exit status"
 
-bt_grep --silent 'Description: Read CTF traces from the file system.' "${stdout}"
-ok $? "help src.ctf.fs component class expected output"
+bt_grep_ok \
+       'Description: Read CTF traces from the file system.' \
+       "${stdout}" \
+       "help src.ctf.fs component class expected output"
 
 is_empty "${stderr}"
 ok $? "help src.ctf.fs component class produces no error"
@@ -52,8 +56,10 @@ ok $? "help src.ctf.fs component class produces no error"
 bt_cli "${stdout}" "${stderr}" help
 isnt $? 0 "help without parameter exit status"
 
-bt_grep --silent "Missing plugin name or component class descriptor." "${stderr}"
-ok $? "help without parameter produces expected error"
+bt_grep_ok \
+       "Missing plugin name or component class descriptor." \
+       "${stderr}" \
+       "help without parameter produces expected error"
 
 is_empty "${stdout}"
 ok $? "help without parameter produces no output"
@@ -62,8 +68,10 @@ ok $? "help without parameter produces no output"
 bt_cli "${stdout}" "${stderr}" help ctf fs
 isnt $? 0  "help with too many parameters exit status"
 
-bt_grep --silent "Extraneous command-line argument specified to \`help\` command:" "${stderr}"
-ok $? "help with too many parameters produces expected error"
+bt_grep_ok \
+       "Extraneous command-line argument specified to \`help\` command:" \
+       "${stderr}" \
+       "help with too many parameters produces expected error"
 
 is_empty "${stdout}"
 ok $? "help with too many parameters produces no output"
@@ -72,8 +80,10 @@ ok $? "help with too many parameters produces no output"
 bt_cli "${stdout}" "${stderr}" help zigotos
 isnt $? 0 "help with unknown plugin name"
 
-bt_grep --silent 'Cannot find plugin: plugin-name="zigotos"' "${stderr}"
-ok $? "help with unknown plugin name produces expected error"
+bt_grep_ok \
+       'Cannot find plugin: plugin-name="zigotos"' \
+       "${stderr}" \
+       "help with unknown plugin name produces expected error"
 
 is_empty "${stdout}"
 ok $? "help with unknown plugin name produces no output"
@@ -82,18 +92,24 @@ ok $? "help with unknown plugin name produces no output"
 bt_cli "${stdout}" "${stderr}" help src.ctf.bob
 isnt $? 0 "help with unknown component class name"
 
-bt_grep --silent 'Cannot find component class: plugin-name="ctf", comp-cls-name="bob", comp-cls-type=SOURCE' "${stderr}"
-ok $? "help with unknown component class name produces expected error"
+bt_grep_ok \
+       'Cannot find component class: plugin-name="ctf", comp-cls-name="bob", comp-cls-type=SOURCE' \
+       "${stderr}" \
+       "help with unknown component class name produces expected error"
 
-bt_grep --silent 'Description: CTF input and output' "${stdout}"
-ok $? "help with unknown component class name prints plugin help"
+bt_grep_ok \
+       'Description: CTF input and output' \
+       "${stdout}" \
+       "help with unknown component class name prints plugin help"
 
 # Test with unknown component class plugin
 bt_cli "${stdout}" "${stderr}" help src.bob.fs
 isnt $? 0 "help with unknown component class plugin"
 
-bt_grep --silent 'Cannot find plugin: plugin-name="bob"' "${stderr}"
-ok $? "help with unknown component class plugin produces expected error"
+bt_grep_ok \
+       'Cannot find plugin: plugin-name="bob"' \
+       "${stderr}" \
+       "help with unknown component class plugin produces expected error"
 
 is_empty "${stdout}"
 ok $? "help with unknown component class plugin produces no output"
This page took 0.024933 seconds and 4 git commands to generate.