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
ba6aa9f5
Commit
ba6aa9f5
authored
16 years ago
by
Dries Buytaert
Browse files
Options
Downloads
Patches
Plain Diff
- Patch
#291670
by dhubler, Dries: run tests by file.
parent
e2825f47
Loading
Loading
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
scripts/run-tests.sh
+23
-4
23 additions, 4 deletions
scripts/run-tests.sh
with
23 additions
and
4 deletions
scripts/run-tests.sh
+
23
−
4
View file @
ba6aa9f5
...
@@ -114,13 +114,16 @@ function simpletest_script_help() {
...
@@ -114,13 +114,16 @@ function simpletest_script_help() {
--concurrency
[
num]
--concurrency
[
num]
Run tests
in
parallel, up to
[
num] tests at a time.
Run tests
in
parallel, up to
[
num] tests at a time.
This requires
This requires
the Process Control Extension
(
PCNTL
)
to be compiled
in
PHP,
the Process Control Extension
(
PCNTL
)
to be compiled
in
PHP,
not
not
supported under Windows.
supported under Windows.
--all
Run all available tests.
--all
Run all available tests.
--class
Run tests identified by specific class names, instead of group names.
--class
Run tests identified by specific class names, instead of group names.
--file
Run tests identifiled by specific file names, instead of group names.
Specify the path and the extension
(
i.e.
'modules/user/user.test'
)
.
--color
Output the rusults with color highlighting.
--color
Output the rusults with color highlighting.
...
@@ -160,6 +163,7 @@ function simpletest_script_parse_args() {
...
@@ -160,6 +163,7 @@ function simpletest_script_parse_args() {
'concurrency'
=>
1,
'concurrency'
=>
1,
'all'
=>
FALSE,
'all'
=>
FALSE,
'class'
=>
FALSE,
'class'
=>
FALSE,
'file'
=>
FALSE,
'color'
=>
FALSE,
'color'
=>
FALSE,
'verbose'
=>
FALSE,
'verbose'
=>
FALSE,
'test_names'
=>
array
()
,
'test_names'
=>
array
()
,
...
@@ -353,7 +357,7 @@ function simpletest_script_get_test_list() {
...
@@ -353,7 +357,7 @@ function simpletest_script_get_test_list() {
$test_list
=
array_keys
(
$all_tests
)
;
$test_list
=
array_keys
(
$all_tests
)
;
}
}
else
{
else
{
if
(
$args
[
'class
_names
'
])
{
if
(
$args
[
'class'
])
{
// Check
for
valid class names.
// Check
for
valid class names.
foreach
(
$args
[
'test_names'
]
as
$class_name
)
{
foreach
(
$args
[
'test_names'
]
as
$class_name
)
{
if
(
isset
(
$all_tests
[
$class_name
]))
{
if
(
isset
(
$all_tests
[
$class_name
]))
{
...
@@ -361,6 +365,21 @@ function simpletest_script_get_test_list() {
...
@@ -361,6 +365,21 @@ function simpletest_script_get_test_list() {
}
}
}
}
}
}
else if
(
$args
[
'file'
])
{
$files
=
array
()
;
foreach
(
$args
[
'test_names'
]
as
$file
)
{
$files
[
realpath
(
$file
)]
=
1
;
}
// Check
for
valid class names.
foreach
(
$all_tests
as
$class_name
=>
$instance
)
{
$refclass
=
new ReflectionClass
(
$class_name
)
;
$file
=
$refclass
->getFileName
()
;
if
(
isset
(
$files
[
$file
]))
{
$test_list
[]
=
$class_name
;
}
}
}
else
{
else
{
// Check
for
valid group names and get all valid classes
in
group.
// Check
for
valid group names and get all valid classes
in
group.
foreach
(
$args
[
'test_names'
]
as
$group_name
)
{
foreach
(
$args
[
'test_names'
]
as
$group_name
)
{
...
...
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