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
77646740
Commit
77646740
authored
3 years ago
by
Simon Rose
Browse files
Options
Downloads
Patches
Plain Diff
Added more patch files
parent
31349910
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
+15
-5
15 additions, 5 deletions
tests/test_build.py
with
15 additions
and
5 deletions
tests/test_build.py
+
15
−
5
View file @
77646740
...
...
@@ -9,6 +9,7 @@ from .utils import *
TEST_DATA
=
Path
(
__file__
).
absolute
().
parent
/
"
data
"
MODULE_VERSION
=
"
0.0.0+0
"
MODULE_VERSION_NO_BUILD
=
"
0.0.0
"
DB_FILE
=
"""
record(ai,
"
TEST
"
) {
...
...
@@ -28,6 +29,12 @@ index 1806ff6..8701832 100644
"""
def
create_patch_file
(
path
,
desc
):
path
.
parent
.
mkdir
(
parents
=
True
,
exist_ok
=
True
)
with
open
(
path
,
"
w
"
)
as
f
:
f
.
write
(
PATCH_FILE
.
format
(
desc
=
desc
))
@pytest.mark.parametrize
(
"
wrapper
"
,
[{
"
templates
"
:
"
database.db
"
,
"
sources
"
:
""
,
"
dbds
"
:
""
,
"
headers
"
:
""
}],
...
...
@@ -38,10 +45,12 @@ def test_patch(wrapper):
with
open
(
db_path
,
"
w
"
)
as
f
:
f
.
write
(
DB_FILE
)
patch_path
=
wrapper
/
"
patch
"
/
"
Site
"
/
MODULE_VERSION
/
"
apply.p0.patch
"
patch_path
.
parent
.
mkdir
(
parents
=
True
)
with
open
(
patch_path
,
"
w
"
)
as
f
:
f
.
write
(
PATCH_FILE
.
format
(
desc
=
"
OK
"
))
patch_dir
=
wrapper
/
"
patch
"
/
"
Site
"
create_patch_file
(
patch_dir
/
MODULE_VERSION
/
"
apply.p0.patch
"
,
"
OK
"
)
create_patch_file
(
patch_dir
/
MODULE_VERSION_NO_BUILD
/
"
dont-apply.p0.patch
"
,
"
Bad
"
)
create_patch_file
(
patch_dir
/
(
MODULE_VERSION
+
"
-dont-apply.p0.patch
"
),
"
Bad
"
)
rc
,
outs
,
_
=
run_make
(
wrapper
,
...
...
@@ -58,5 +67,6 @@ def test_patch(wrapper):
assert
'
field(DESC,
"
OK
"
)
'
in
db_contents
assert
not
"
Bad
"
in
db_contents
run_make
(
wrapper
,
"
build
"
,
__DEBUG_VERSION
=
MODULE_VERSION
)
rc
,
_
,
_
=
run_make
(
wrapper
,
"
build
"
,
__DEBUG_VERSION
=
MODULE_VERSION
)
assert
rc
==
0
assert
any
((
wrapper
/
TEST_MODULE_NAME
).
glob
(
"
O.*
"
))
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