FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pytype/build_scripts/run_tests.py at master · ucifs/pytype · GitHub
ucifs
/
pytype
Public
forked from
google/pytype
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
pytype
/
build_scripts
/
run_tests.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
54 lines (44 loc) · 1.73 KB
Breadcrumbs
pytype
/
build_scripts
/
run_tests.py
Copy path
File metadata and controls
executable file
·
54 lines (44 loc) · 1.73 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#! /usr/bin/python
"""Script to run PyType tests.
Usage:
$> python run_tests.py [TARGET] [TARGET] ...
A TARGET is a fully qualified name of a test target within the PyType
source tree. If no target is specified, all test targets listed in the
CMake files will be run.
"""
from
__future__
import
print_function
import
argparse
import
sys
import
build_utils
def
parse_args
():
"""Parse the args to this script and return them."""
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"targets"
,
metavar
=
"TARGET"
,
nargs
=
"*"
,
help
=
"List of test targets to run."
)
parser
.
add_argument
(
"--fail_fast"
,
"-f"
,
action
=
"store_true"
,
default
=
False
,
help
=
"Fail as soon as one build target fails."
)
parser
.
add_argument
(
"--debug"
,
"-d"
,
action
=
"store_true"
,
default
=
False
,
help
=
"Build targets in the debug mode."
)
args
=
parser
.
parse_args
()
for
target
in
args
.
targets
:
if
"."
in
target
:
_
,
target_name
=
target
.
rsplit
(
"."
,
1
)
else
:
target_name
=
target
if
not
(
target_name
.
startswith
(
"test_"
)
or
target_name
.
endswith
(
"_test"
)):
sys
.
exit
(
"The name '%s' is not a valid test target name."
%
target
)
return
args
def
main
():
opts
=
parse_args
()
targets
=
opts
.
targets
or
[
"test_all"
]
if
not
build_utils
.
run_cmake
(
log_output
=
True
,
debug_build
=
opts
.
debug
):
sys
.
exit
(
1
)
fail_collector
=
build_utils
.
FailCollector
()
print
(
"Running tests (build steps will be executed as required) ...
\n
"
)
if
not
build_utils
.
run_ninja
(
targets
,
fail_collector
,
opts
.
fail_fast
):
fail_collector
.
print_report
()
sys
.
exit
(
1
)
print
(
"!!! All tests passed !!!
\n
"
"Some tests might not have been run because they were already passing."
)
if
__name__
==
"__main__"
:
main
()
Back
|
FazBrowse Home
|
New Git URL