Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
765b02a1
Commit
765b02a1
authored
May 22, 2009
by
Robert Ricci
Browse files
Add a few more functions useful for some of my recent testfiles.
parent
7435eb20
Changes
1
Hide whitespace changes
Inline
Side-by-side
testsuite/assign/common.pm
View file @
765b02a1
...
...
@@ -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.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment