aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Elliston <bje@gnu.org>2016-02-24 15:04:57 +1100
committerBen Elliston <bje@gnu.org>2016-02-24 15:04:57 +1100
commitbd8216f07a5a53ac3aa00d547abed9bafc8d6ddd (patch)
tree0a868bad50273b628572a49743fca5ca321a9b76
parent3637775afa01ab249ad400102c152586307d94f2 (diff)
downloaddejagnu-bd8216f07a5a53ac3aa00d547abed9bafc8d6ddd.zip
dejagnu-bd8216f07a5a53ac3aa00d547abed9bafc8d6ddd.tar.gz
dejagnu-bd8216f07a5a53ac3aa00d547abed9bafc8d6ddd.tar.bz2
* lib/utils.exp (prune): Restore this proc.
* doc/ref.xml: Update documentation. * doc/dejagnu.texi: Regenerate. * NEWS: Update. This reverts commit 992fbc3a8f03c3cd5e554eea5361f1a531e9e71f.
-rw-r--r--ChangeLog7
-rw-r--r--NEWS4
-rw-r--r--doc/dejagnu.texi13
-rw-r--r--doc/ref.xml8
-rw-r--r--lib/utils.exp19
5 files changed, 47 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 7bca566..2ca2041 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-02-24 Ben Elliston <bje@gnu.org>
+
+ * lib/utils.exp (prune): Restore this proc.
+ * doc/ref.xml: Update documentation.
+ * doc/dejagnu.texi: Regenerate.
+ * NEWS: Update.
+
2016-02-23 Iain Buclaw <ibuclaw@gdcproject.org>
* lib/libgloss.exp (find_gdc): New proc.
diff --git a/NEWS b/NEWS
index 3387ab1..1d3f672 100644
--- a/NEWS
+++ b/NEWS
@@ -10,8 +10,8 @@ Changes since 1.5.3:
2 if an exception is raised by the Tcl interpreter.
3. runtest now exits with the standard exit codes of programs that are
terminated by the SIGINT, SIGTERM and SIGQUIT signals.
-4. The user-visible utility procedures `absolute', `prune', `psource'
- and `slay' have been removed. If a testsuite uses any of these
+4. The user-visible utility procedures `absolute', `psource' and
+ `slay' have been removed. If a testsuite uses any of these
procedures, a copy of the procedure should be made and placed in
the lib directory of the testsuite.
5. Support was added for testing the D compiler.
diff --git a/doc/dejagnu.texi b/doc/dejagnu.texi
index bff10cf..99dd8f1 100644
--- a/doc/dejagnu.texi
+++ b/doc/dejagnu.texi
@@ -5412,6 +5412,7 @@ tool, and its version number.
* Find Procedure: find procedure.
* Which Procedure: which procedure.
* Grep Procedure: grep procedure.
+* Prune Procedure: prune procedure.
* Runtest_file_p Procedure: runtest_file_p procedure.
* Diff Procedure: diff procedure.
* Setenv Procedure: setenv procedure.
@@ -5498,7 +5499,7 @@ The executable program or shell script to look
for.
@end table
-@node grep procedure, runtest_file_p procedure, which procedure, Utility Procedures
+@node grep procedure, prune procedure, which procedure, Utility Procedures
@subsubsection Grep Procedure
Search the file called @file{filename} (a fully
@@ -5535,7 +5536,15 @@ Prefix the line number to each line where the
regexp matches.
@end table
-@node runtest_file_p procedure, diff procedure, grep procedure, Utility Procedures
+@node prune procedure, runtest_file_p procedure, grep procedure, Utility Procedures
+@subsubsection Prune Procedure
+
+This procedure is deprecated and will be removed in
+the next release of DejaGnu. If a testsuite uses this
+procedure, a copy of the procedure should be made and placed
+in the lib directory of the testsuite.
+
+@node runtest_file_p procedure, diff procedure, prune procedure, Utility Procedures
@subsubsection Runtest_file_p Procedure
Search @emph{runtest}s for
diff --git a/doc/ref.xml b/doc/ref.xml
index b1329e0..05013ae 100644
--- a/doc/ref.xml
+++ b/doc/ref.xml
@@ -3578,6 +3578,14 @@
</variablelist>
</sect4>
+ <sect4 id="prune" xreflabel="prune procedure">
+ <title>Prune Procedure</title>
+ <para>This procedure is deprecated and will be removed in
+ the next release of &dj;. If a testsuite uses this
+ procedure, a copy of the procedure should be made and placed
+ in the lib directory of the testsuite.</para>
+ </sect4>
+
<sect4 id="runtestfilep" xreflabel="runtest_file_p procedure">
<title>Runtest_file_p Procedure</title>
diff --git a/lib/utils.exp b/lib/utils.exp
index 314fc2f..acad5bd 100644
--- a/lib/utils.exp
+++ b/lib/utils.exp
@@ -203,6 +203,25 @@ proc grep { args } {
return $grep_out
}
+#
+# Remove elements based on patterns. elements are delimited by spaces.
+# pattern is the pattern to look for using glob style matching
+# list is the list to check against
+# returns the new list
+#
+proc prune { list pattern } {
+ set tmp {}
+ foreach i $list {
+ verbose "Checking pattern \"$pattern\" against $i" 3
+ if {![string match $pattern $i]} {
+ lappend tmp $i
+ } else {
+ verbose "Removing element $i from list" 3
+ }
+ }
+ return $tmp
+}
+
# Check if a testcase should be run or not
#