Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
4378277e
Commit
4378277e
authored
10 years ago
by
Angie Byron
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2390749
by alexpott: run-tests.sh should allow single test methods to be run
parent
9eb4efb9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/scripts/run-tests.sh
+17
-5
17 additions, 5 deletions
core/scripts/run-tests.sh
with
17 additions
and
5 deletions
core/scripts/run-tests.sh
+
17
−
5
View file @
4378277e
...
@@ -159,6 +159,8 @@ function simpletest_script_help() {
...
@@ -159,6 +159,8 @@ function simpletest_script_help() {
(
e.g.,
'node'
)
(
e.g.,
'node'
)
--class
Run tests identified by specific class names, instead of group names.
--class
Run tests identified by specific class names, instead of group names.
A specific
test
method can be added,
for
example,
'Drupal\book\Tests\BookTest::testBookExport'
.
--file
Run tests identified by specific file names, instead of group names.
--file
Run tests identified by specific file names, instead of group names.
Specify the path and the extension
Specify the path and the extension
...
@@ -625,10 +627,19 @@ function simpletest_script_run_one_test($test_id, $test_class) {
...
@@ -625,10 +627,19 @@ function simpletest_script_run_one_test($test_id, $test_class) {
global
$args
;
global
$args
;
try
{
try
{
$test
=
new
$test_class
(
$test_id
)
;
if
(
strpos
(
$test_class
,
'::'
)
>
0
)
{
list
(
$class_name
,
$method
)
=
explode
(
'::'
,
$test_class
, 2
)
;
$methods
=
[
$method
]
;
}
else
{
$class_name
=
$test_class
;
// Use empty array to run all the
test
methods.
$methods
=
array
()
;
}
$test
=
new
$class_name
(
$test_id
)
;
$test
->dieOnFail
=
(
bool
)
$args
[
'die-on-fail'
]
;
$test
->dieOnFail
=
(
bool
)
$args
[
'die-on-fail'
]
;
$test
->verbose
=
(
bool
)
$args
[
'verbose'
]
;
$test
->verbose
=
(
bool
)
$args
[
'verbose'
]
;
$test
->run
()
;
$test
->run
(
$methods
)
;
simpletest_script_reporter_display_summary
(
$test_class
,
$test
->results
)
;
simpletest_script_reporter_display_summary
(
$test_class
,
$test
->results
)
;
...
@@ -774,7 +785,8 @@ function simpletest_script_get_test_list() {
...
@@ -774,7 +785,8 @@ function simpletest_script_get_test_list() {
if
(
$args
[
'class'
])
{
if
(
$args
[
'class'
])
{
$test_list
=
array
()
;
$test_list
=
array
()
;
foreach
(
$args
[
'test_names'
]
as
$test_class
)
{
foreach
(
$args
[
'test_names'
]
as
$test_class
)
{
if
(
class_exists
(
$test_class
))
{
list
(
$class_name
,
)
=
explode
(
'::'
,
$test_class
, 2
)
;
if
(
class_exists
(
$class_name
))
{
$test_list
[]
=
$test_class
;
$test_list
[]
=
$test_class
;
}
}
else
{
else
{
...
@@ -783,8 +795,8 @@ function simpletest_script_get_test_list() {
...
@@ -783,8 +795,8 @@ function simpletest_script_get_test_list() {
foreach
(
$groups
as
$group
)
{
foreach
(
$groups
as
$group
)
{
$all_classes
=
array_merge
(
$all_classes
, array_keys
(
$group
))
;
$all_classes
=
array_merge
(
$all_classes
, array_keys
(
$group
))
;
}
}
simpletest_script_print_error
(
'Test class not found: '
.
$
test_
class
)
;
simpletest_script_print_error
(
'Test class not found: '
.
$class
_name
)
;
simpletest_script_print_alternatives
(
$
test_
class
,
$all_classes
, 6
)
;
simpletest_script_print_alternatives
(
$class
_name
,
$all_classes
, 6
)
;
exit
(
1
)
;
exit
(
1
)
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment