aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorBen Elliston <bje@gnu.org>2018-12-04 23:11:26 +1100
committerBen Elliston <bje@gnu.org>2018-12-04 23:11:26 +1100
commitd40bf1fd042de1cd10733157041b3304cd5c9581 (patch)
tree6522611b4645b971c66e7ade57a073b7f5bf5513 /testsuite
parent217b8da593c908ffcf05a320da35afccc3d53645 (diff)
downloaddejagnu-d40bf1fd042de1cd10733157041b3304cd5c9581.zip
dejagnu-d40bf1fd042de1cd10733157041b3304cd5c9581.tar.gz
dejagnu-d40bf1fd042de1cd10733157041b3304cd5c9581.tar.bz2
* testsuite/runtest.all/utils.test: Test grep.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/runtest.all/utils.test19
1 files changed, 18 insertions, 1 deletions
diff --git a/testsuite/runtest.all/utils.test b/testsuite/runtest.all/utils.test
index bd3626f..95181a0 100644
--- a/testsuite/runtest.all/utils.test
+++ b/testsuite/runtest.all/utils.test
@@ -148,6 +148,23 @@ if {[which make] != 0} {
fail "which, make"
}
-# grep args
+### Do not adjust the comment on the next line. The grep test case
+### depends on it.
+
+# Test grep!
+if {[llength [grep ${srcdir}/runtest.all/utils.test "^# Test grep!"]] == 1} {
+ pass "grep, no options"
+} else {
+ fail "grep, no options"
+}
+
+# Test grep with line option..
+set result [grep ${srcdir}/runtest.all/utils.test "^# Test grep!" line]
+if {[llength $result] == 1 && [regexp {^\d+ # Test grep!} [lindex $result 0]]} {
+ pass "grep, line option"
+} else {
+ fail "grep, line option"
+}
+
# diff file_1 file_2
# runtest_file_p