Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
6ce34078
Commit
6ce34078
authored
Oct 14, 2010
by
Jonathan Perkin
Browse files
Options
Browse Files
Download
Plain Diff
Pull in fix from bug#47526 to solve bug#50047.
parents
50ca4bc1
20b4e139
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
4 deletions
+28
-4
unittest/unit.pl
unittest/unit.pl
+28
-4
No files found.
unittest/unit.pl
View file @
6ce34078
...
@@ -14,7 +14,6 @@
...
@@ -14,7 +14,6 @@
# along with this program; if not, write to the Free Software
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
use
Test::
Harness
;
use
File::
Find
;
use
File::
Find
;
use
Getopt::
Long
;
use
Getopt::
Long
;
...
@@ -38,9 +37,10 @@ unit - Run unit tests in directory
...
@@ -38,9 +37,10 @@ unit - Run unit tests in directory
my
$big
=
$ENV
{'
MYTAP_CONFIG
'}
eq
'
big
';
my
$big
=
$ENV
{'
MYTAP_CONFIG
'}
eq
'
big
';
my
$opt_verbose
;
my
$result
=
GetOptions
(
my
$result
=
GetOptions
(
"
big!
"
=>
\
$big
,
"
big!
"
=>
\
$big
,
"
verbose!
"
=>
\
$
Test::Harness::
verbose
,
"
verbose!
"
=>
\
$
opt_
verbose
,
);
);
$ENV
{'
MYTAP_CONFIG
'}
=
$big
?
'
big
'
:
'';
$ENV
{'
MYTAP_CONFIG
'}
=
$big
?
'
big
'
:
'';
...
@@ -60,6 +60,19 @@ Run all unit tests in the current directory and all subdirectories.
...
@@ -60,6 +60,19 @@ Run all unit tests in the current directory and all subdirectories.
=cut
=cut
BEGIN
{
# Test::Harness have been extensively rewritten in newer perl
# versions and is now just a backward compatibility wrapper
# (with a bug causing the HARNESS_PERL_SWITCHES to be mangled)
# Prefer to use TAP::Harness directly if available
if
(
eval
"
use TAP::Harness; 1
")
{
eval
'
sub NEW_HARNESS { 1 }
';
warn
"
using TAP::Harness
";
}
else
{
eval
"
use Test::Harness; 1
"
or
die
"
couldn't find Test::Harness!
";
eval
'
sub NEW_HARNESS { 0 }
';
}
}
sub
_find_test_files
(@)
{
sub
_find_test_files
(@)
{
my
@dirs
=
@_
;
my
@dirs
=
@_
;
...
@@ -102,8 +115,19 @@ sub run_cmd (@) {
...
@@ -102,8 +115,19 @@ sub run_cmd (@) {
if
(
@files
>
0
)
{
if
(
@files
>
0
)
{
# Removing the first './' from the file names
# Removing the first './' from the file names
foreach
(
@files
)
{
s!^\./!!
}
foreach
(
@files
)
{
s!^\./!!
}
$ENV
{'
HARNESS_PERL_SWITCHES
'}
.=
'
-e "exec @ARGV"
';
runtests
@files
;
if
(
NEW_HARNESS
())
{
my
%
args
=
(
exec
=>
[
],
verbosity
=>
$opt_verbose
);
my
$harness
=
TAP::
Harness
->
new
(
\%
args
);
$harness
->
runtests
(
@files
);
}
else
{
$ENV
{'
HARNESS_VERBOSE
'}
=
$opt_verbose
;
$ENV
{'
HARNESS_PERL_SWITCHES
'}
.=
'
-e "exec @ARGV"
';
runtests
(
@files
);
}
}
}
}
}
Write
Preview
Markdown
is supported
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