Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dumux-repositories
dumux
Commits
c2d05712
Commit
c2d05712
authored
3 years ago
by
Dennis Gläser
Browse files
Options
Downloads
Patches
Plain Diff
[bin][findtest] use camelcase names
parent
4bd1beb4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2408
Feature/ci integration
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/testing/findtests.py
+8
-8
8 additions, 8 deletions
bin/testing/findtests.py
with
8 additions
and
8 deletions
bin/testing/findtests.py
+
8
−
8
View file @
c2d05712
...
...
@@ -15,12 +15,12 @@ import os
# Check if the set a contains a member of list b
def
has
_c
ommon
_m
ember
(
myset
,
mylist
):
def
has
C
ommon
M
ember
(
myset
,
mylist
):
return
not
myset
.
isdisjoint
(
mylist
)
# make dry run and return the compilation command
def
get
_c
ompile
_c
ommand
(
testConfig
):
def
get
C
ompile
C
ommand
(
testConfig
):
lines
=
subprocess
.
check_output
([
"
make
"
,
"
--dry-run
"
,
testConfig
[
"
target
"
]],
encoding
=
'
ascii
'
).
splitlines
()
...
...
@@ -30,8 +30,8 @@ def get_compile_command(testConfig):
# get the command and folder to compile the given test
def
build
_c
ommand
_and_d
ir
(
testConfig
,
cache
):
compCommand
=
get
_c
ompile
_c
ommand
(
testConfig
)
def
build
C
ommand
AndD
ir
(
testConfig
,
cache
):
compCommand
=
get
C
ompile
C
ommand
(
testConfig
)
if
compCommand
is
None
:
with
open
(
cache
)
as
c
:
data
=
json
.
load
(
c
)
...
...
@@ -44,12 +44,12 @@ def build_command_and_dir(testConfig, cache):
# check if a test is affected by changes in the given files
def
is
_a
ffected
_t
est
(
testConfigFile
,
changed_files
):
def
is
A
ffected
T
est
(
testConfigFile
,
changed_files
):
with
open
(
testConfigFile
)
as
configFile
:
testConfig
=
json
.
load
(
configFile
)
cacheFile
=
"
TestTargets/
"
+
testConfig
[
"
target
"
]
+
"
.json
"
command
,
dir
=
build
_c
ommand
_and_d
ir
(
testConfig
,
cacheFile
)
command
,
dir
=
build
C
ommand
AndD
ir
(
testConfig
,
cacheFile
)
# detect headers included in this test
# -MM skips headers from system directories
...
...
@@ -68,7 +68,7 @@ def is_affected_test(testConfigFile, changed_files):
test_files
=
set
([
os
.
path
.
relpath
(
header
.
lstrip
(
"
.
"
),
projectDir
)
for
header
in
filter
(
isProjectHeader
,
headers
)])
if
has
_c
ommon
_m
ember
(
changed_files
,
test_files
):
if
has
C
ommon
M
ember
(
changed_files
,
test_files
):
return
True
,
testConfig
[
"
name
"
],
testConfig
[
"
target
"
]
return
False
,
testConfig
[
"
name
"
],
testConfig
[
"
target
"
]
...
...
@@ -106,7 +106,7 @@ if __name__ == '__main__':
count
=
0
affectedTests
=
{}
for
test
in
glob
(
"
TestMetaData/*json
"
):
affected
,
name
,
target
=
is
_a
ffected
_t
est
(
test
,
changed_files
)
affected
,
name
,
target
=
is
A
ffected
T
est
(
test
,
changed_files
)
if
affected
:
print
(
"
\t
- {}
"
.
format
(
name
))
affectedTests
[
name
]
=
{
'
target
'
:
target
}
...
...
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