Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
e3-require
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
ESS EPICS Environment
wrappers
e3-require
Commits
1e94d01c
Commit
1e94d01c
authored
3 years ago
by
Simon Rose
Browse files
Options
Downloads
Patches
Plain Diff
Added test for missing source file
parent
55c46933
No related branches found
No related tags found
1 merge request
!38
E3-233: Add tests
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_build.py
+24
-4
24 additions, 4 deletions
tests/test_build.py
with
24 additions
and
4 deletions
tests/test_build.py
+
24
−
4
View file @
1e94d01c
import
re
import
pytest
from
.utils
import
TEST_MODULE_NAME
,
run_make
...
...
@@ -5,6 +7,8 @@ from .utils import TEST_MODULE_NAME, run_make
MODULE_VERSION
=
"
0.0.0+0
"
MODULE_VERSION_NO_BUILD
=
"
0.0.0
"
RE_MISSING_FILE
=
"
No rule to make target [`
'
]{filename}
'"
DB_FILE
=
"""
record(ai,
"
TEST
"
) {
}
...
...
@@ -75,10 +79,26 @@ def test_patch(wrapper):
[{
"
templates
"
:
""
,
"
sources
"
:
""
,
"
dbds
"
:
"
nonexistent.dbd
"
,
"
headers
"
:
""
}],
indirect
=
True
,
)
def
test_missing_file
(
wrapper
):
def
test_missing_
dbd_
file
(
wrapper
):
rc
,
_
,
errs
=
run_make
(
wrapper
,
"
build
"
)
# TODO: This should probably be a regex, since the quote marks seem to
# depend on the make version.
assert
"
No rule to make target `../nonexistent.dbd
'"
in
errs
.
decode
(
"
utf-8
"
)
assert
rc
==
2
assert
re
.
search
(
RE_MISSING_FILE
.
format
(
filename
=
re
.
escape
(
"
../nonexistent.dbd
"
)),
errs
.
decode
(
"
utf-8
"
),
)
@pytest.mark.parametrize
(
"
wrapper
"
,
[{
"
templates
"
:
""
,
"
sources
"
:
"
nonexistent.c
"
,
"
dbds
"
:
""
,
"
headers
"
:
""
}],
indirect
=
True
,
)
def
test_missing_source_file
(
wrapper
):
rc
,
_
,
errs
=
run_make
(
wrapper
,
"
build
"
)
assert
rc
==
2
assert
re
.
search
(
RE_MISSING_FILE
.
format
(
filename
=
re
.
escape
(
"
nonexistent.o
"
)),
errs
.
decode
(
"
utf-8
"
),
)
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