Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
222
Merge Requests
222
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
fa4c50a8
Commit
fa4c50a8
authored
Jan 11, 2017
by
alexpott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2841948
by Mile23, dawehner: Modify run-tests.sh to show file paths of all discovered tests
parent
f182e9d2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
core/scripts/run-tests.sh
core/scripts/run-tests.sh
+40
-0
No files found.
core/scripts/run-tests.sh
View file @
fa4c50a8
...
...
@@ -89,6 +89,36 @@
exit
(
SIMPLETEST_SCRIPT_EXIT_SUCCESS
)
;
}
// List-files and list-files-json provide a way
for
external tools such as the
// testbot to prioritize running changed tests.
// @see https://www.drupal.org/node/2569585
if
(
$args
[
'list-files'
]
||
$args
[
'list-files-json'
])
{
// List all files which could be run as tests.
$test_discovery
=
NULL
;
try
{
$test_discovery
=
\D
rupal::service
(
'test_discovery'
)
;
}
catch
(
Exception
$e
)
{
error_log
((
string
)
$e
)
;
echo
(
string
)
$e
;
exit
(
SIMPLETEST_SCRIPT_EXIT_EXCEPTION
)
;
}
// TestDiscovery::findAllClassFiles
()
gives us a classmap similar to a
// Composer
'classmap'
array.
$test_classes
=
$test_discovery
->findAllClassFiles
()
;
// JSON output is the easiest.
if
(
$args
[
'list-files-json'
])
{
echo
json_encode
(
$test_classes
)
;
exit
(
SIMPLETEST_SCRIPT_EXIT_SUCCESS
)
;
}
// Output the list of files.
else
{
foreach
(
array_values
(
$test_classes
)
as
$test_class
)
{
echo
$test_class
.
"
\n
"
;
}
}
exit
(
SIMPLETEST_SCRIPT_EXIT_SUCCESS
)
;
}
simpletest_script_setup_database
(
TRUE
)
;
if
(
$args
[
'clean'
])
{
...
...
@@ -178,6 +208,14 @@ function simpletest_script_help() {
--list
Display all available
test
groups.
--list-files
Display all discoverable
test
file paths.
--list-files-json
Display all discoverable
test
files as JSON. The array key will be
the
test
class name, and the value will be the file path of the
test.
--clean
Cleans up database tables or directories from previous, failed,
tests and
then
exits
(
no tests are run
)
.
...
...
@@ -309,6 +347,8 @@ function simpletest_script_parse_args() {
'script'
=>
''
,
'help'
=>
FALSE,
'list'
=>
FALSE,
'list-files'
=>
FALSE,
'list-files-json'
=>
FALSE,
'clean'
=>
FALSE,
'url'
=>
''
,
'sqlite'
=>
NULL,
...
...
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