Merge lp:~epics-documenters/epics-appdev/ioc-shutdown into lp:~epics-documenters/epics-appdev/3.16

Proposed by Ralph Lange
Status: Merged
Merged at revision: 60
Proposed branch: lp:~epics-documenters/epics-appdev/ioc-shutdown
Merge into: lp:~epics-documenters/epics-appdev/3.16
Diff against target: 60 lines (+24/-1)
2 files modified
tex/generalPurposeTasks.tex (+4/-1)
tex/libCom.tex (+20/-0)
To merge this branch: bzr merge lp:~epics-documenters/epics-appdev/ioc-shutdown
Reviewer Review Type Date Requested Status
Andrew Johnson Needs Fixing
Review via email: mp+190513@code.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
Andrew Johnson (anj) wrote :

Docs need revising to cover the ioc-shutdown2 changes.

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tex/generalPurposeTasks.tex'
2--- tex/generalPurposeTasks.tex 2010-11-15 18:16:16 +0000
3+++ tex/generalPurposeTasks.tex 2013-10-11 00:45:39 +0000
4@@ -127,6 +127,7 @@
5 The following calls are provided:
6
7 \index{callbackInit}
8+\index{callbackShutdown}
9 \index{callbackSetCallback}
10 \index{callbackSetPriority}
11 \index{callbackSetUser}
12@@ -141,6 +142,7 @@
13 Notes:
14 \begin{verbatim}
15 void callbackInit(void);
16+void callbackShutdown(void);
17
18 void callbackSetCallback(void *pcallbackFunction,
19 CALLBACK *pcallback);
20@@ -160,7 +162,8 @@
21 \end{verbatim}
22
23 \begin{itemize}
24-\item \verb|callbackInit| is performed automatically at IOC initialization, thus user code never calls this function.
25+\item \verb|callbackInit| and \verb|callbackShutdown| are performed automatically at IOC initialization or shutdown,
26+thus user code never calls these functions.
27
28 \item \verb|callbackSetCallback|, \verb|callbackSetPriority|, \verb|callbackSetUser|, and \verb|callbackGetUser| are
29 actually macros.
30
31=== modified file 'tex/libCom.tex'
32--- tex/libCom.tex 2012-01-17 18:04:20 +0000
33+++ tex/libCom.tex 2013-10-11 00:45:39 +0000
34@@ -1567,6 +1567,26 @@
35 call to the runTestFunc() routine.
36 The last test program or the harness program itself must finish by calling epicsExit() which triggers the test summary mechanism to generate its result outputs (from an epicsAtExit callback routine).
37
38+Some tests require the context of an IOC to be run. This conflicts with the idea of running multiple tests within a test harness, as iocInit() is only allowed to be called once, and some parts of the full IOC (e.g., the rsrv CA server) can not be shut down cleanly.
39+The function iocBuildNoCA() allows to start an IOC without its Channel Access parts, so that it can be shutdown quite cleany using iocShutdown(). This feature is only intended to be used from test programs. Do not use it on productional IOCs. After building the IOC using iocBuildNoCA() or iocBuild(), it has to be started by calling iocRun(). The suggested call sequence in a test program that needs to run the IOC without Channel Access is:
40+
41+\begin{verbatim}
42+#include "iocInit.h"
43+
44+MAIN(iocTest)
45+{
46+ iocBuildNoCA() || iocRun();
47+
48+[... test code ...]
49+
50+ iocShutdown();
51+ dbFreeBase(pdbbase);
52+ registryFree();
53+ pdbbase = NULL;
54+ return testDone();
55+}
56+\end{verbatim}
57+
58 To make it easier to create a single test program that can be built for both the embedded and workstation operating system harnesses, the header file \verb|testMain.h| provides a convenience macro MAIN() that adjusts the name of the test program according to the platform it is running on: main() on workstations and a regular function name on embedded systems.
59
60 \index{testMain.h}

Subscribers

People subscribed via source and target branches

to all changes: