Commit 765b02a1 authored by Robert Ricci's avatar Robert Ricci

Add a few more functions useful for some of my recent testfiles.

parent 7435eb20
......@@ -22,6 +22,32 @@ sub lsptop($) {
return @filenames;
}
#
# Same for top/
#
sub lstop($) {
my ($pattern) = @_;
my @filenames = `ls -1 top/$pattern`;
@filenames = map { `basename $_` } @filenames;
chomp @filenames;
return @filenames;
}
#
# Filter a list, returning on the elements for which the given fucntion
# returns true
#
sub filter(&@) {
my ($fref, @list) = @_;
my @rv = ();
foreach my $elt (@list) {
if (&$fref($elt)) {
push @rv, $elt;
}
}
return @rv;
}
#
# Parse a file describing some tests to run - really, it's just some perl code
# to execute that's expected to set certain variables.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment