Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Applications
tor-browser-bundle-testsuite
Commits
0a5385ae
Unverified
Commit
0a5385ae
authored
Aug 17, 2014
by
boklm
Browse files
Move the command test type to its own file
parent
df6af6db
Changes
2
Hide whitespace changes
Inline
Side-by-side
TBBTestSuite/BrowserBundleTests.pm
View file @
0a5385ae
...
...
@@ -11,11 +11,11 @@ use File::Type;
use
File::
Copy
;
use
JSON
;
use
Digest::
SHA
qw(sha256_hex)
;
use
IO::
CaptureOutput
qw(capture_exec)
;
use
LWP::
UserAgent
;
use
TBBTestSuite::
Common
qw(exit_error winpath
get_var
)
;
use
TBBTestSuite::
Common
qw(exit_error winpath)
;
use
TBBTestSuite::
Options
qw($options)
;
use
TBBTestSuite::Tests::
VirusTotal
qw(virustotal_run)
;
use
TBBTestSuite::Tests::
Command
qw(command_run)
;
use
TBBTestSuite::Tests::
TorBootstrap
;
our
(
@ISA
,
@EXPORT_OK
);
...
...
@@ -449,24 +449,6 @@ sub selenium_run {
check_modified_files
(
$tbbinfos
,
$test
);
}
sub
command_run
{
my
(
$tbbinfos
,
$test
)
=
@_
;
$test
->
{
results
}{
success
}
=
1
;
my
$files
=
get_var
(
$test
->
{
files
},
$tbbinfos
,
$test
);
for
my
$file
(
@$files
)
{
my
(
$out
,
$err
,
$success
)
=
capture_exec
(
@
{
$test
->
{
command
}},
$file
);
if
(
$success
&&
$test
->
{
check_output
})
{
$success
=
$test
->
{
check_output
}(
$out
);
}
if
(
!
$success
)
{
$test
->
{
results
}{
success
}
=
0
;
$file
=~
s/^$tbbinfos->{tbbdir}\///
;
push
@
{
$test
->
{
results
}{
failed
}},
$file
;
next
;
}
}
}
sub
set_tbbpaths
{
my
(
$tbbinfos
)
=
@_
;
if
(
$options
->
{
newlayout
})
{
...
...
TBBTestSuite/Tests/Command.pm
0 → 100644
View file @
0a5385ae
package
TBBTestSuite::Tests::
Command
;
use
strict
;
use
IO::
CaptureOutput
qw(capture_exec)
;
use
TBBTestSuite::
Common
qw(get_var)
;
our
(
@ISA
,
@EXPORT_OK
);
BEGIN
{
require
Exporter
;
@ISA
=
qw(Exporter)
;
@EXPORT_OK
=
qw(command_run)
;
}
sub
command_run
{
my
(
$tbbinfos
,
$test
)
=
@_
;
$test
->
{
results
}{
success
}
=
1
;
my
$files
=
get_var
(
$test
->
{
files
},
$tbbinfos
,
$test
);
for
my
$file
(
@$files
)
{
my
(
$out
,
$err
,
$success
)
=
capture_exec
(
@
{
$test
->
{
command
}},
$file
);
if
(
$success
&&
$test
->
{
check_output
})
{
$success
=
$test
->
{
check_output
}(
$out
);
}
if
(
!
$success
)
{
$test
->
{
results
}{
success
}
=
0
;
$file
=~
s/^$tbbinfos->{tbbdir}\///
;
push
@
{
$test
->
{
results
}{
failed
}},
$file
;
next
;
}
}
}
1
;
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