Skip to content

Commit 4539b8a

Browse files
committed
CI: add simple simulated IOC for testing
1 parent 4708474 commit 4539b8a

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

.github/workflows/testing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
3434
export EPICS_CA_AUTO_ADDR_LIST=NO
3535
export EPICS_CA_ADDR_LIST=127.0.0.1
36-
python -m caproto.ioc_examples.simple &
36+
python ioc/sim_ioc.py &
3737
3838
- name: Test with pytest
3939
run: |

ioc/sim_ioc.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
from textwrap import dedent
2+
3+
from caproto.server import PVGroup, ioc_arg_parser, pvproperty, run
4+
5+
6+
class SimpleIOC(PVGroup):
7+
"""
8+
An IOC with three uncoupled read/writable PVs.
9+
10+
Scalar PVs
11+
----------
12+
A (int)
13+
B (float)
14+
15+
Array PVs
16+
---------
17+
C (array of int)
18+
"""
19+
20+
A = pvproperty(
21+
value=1,
22+
doc="An integer",
23+
)
24+
B = pvproperty(value=2.0, doc="A float")
25+
C = pvproperty(value=[1, 2, 3], doc="An array of integers (max length 3)")
26+
27+
28+
if __name__ == "__main__":
29+
ioc_options, run_options = ioc_arg_parser(default_prefix="simple:", desc=dedent(SimpleIOC.__doc__))
30+
ioc = SimpleIOC(**ioc_options)
31+
run(ioc.pvdb, **run_options)

0 commit comments

Comments
 (0)