test iocsh functions
This commit is contained in:
+53
-1
@@ -18,11 +18,14 @@
|
||||
#include <epicsExit.h>
|
||||
#include <asTrapWrite.h>
|
||||
#include <generalTimeSup.h>
|
||||
#include <iocsh.h>
|
||||
|
||||
#include "dblocker.h"
|
||||
#include "testioc.h"
|
||||
#include "utilpvt.h"
|
||||
|
||||
#include "capturestd.h"
|
||||
|
||||
#if EPICS_VERSION_INT >= VERSION_INT(3, 15, 0, 2)
|
||||
# define HAVE_lsi
|
||||
#endif
|
||||
@@ -947,11 +950,59 @@ void testMonitorDBE(TestClient& ctxt)
|
||||
testEq(val["value"].as<int32_t>(), 43);
|
||||
}
|
||||
|
||||
void testiocsh(TestClient& ctxt)
|
||||
{
|
||||
testDiag("%s", __func__);
|
||||
|
||||
TestSubscription sub(ctxt.monitor("test:ai")
|
||||
.maskConnected(true)
|
||||
.maskDisconnected(true));
|
||||
|
||||
auto val(sub.waitForUpdate());
|
||||
|
||||
{
|
||||
CaptureStd cap([](){
|
||||
iocshCmd("pvxsr 5");
|
||||
});
|
||||
testStrEq(cap.err(), "");
|
||||
testStrMatch(".*EPICS_PVAS_AUTO_BEACON_ADDR_LIST=NO.*", cap.out());
|
||||
testStrMatch(".*Source: __server.*", cap.out());
|
||||
testStrMatch(".*test:nsec.*", cap.out());
|
||||
testStrMatch(".*State: Running TCP_Port:.*", cap.out());
|
||||
testStrMatch(".*test:ai TX=.*", cap.out());
|
||||
}
|
||||
{
|
||||
CaptureStd cap([](){
|
||||
iocshCmd("pvxsi");
|
||||
});
|
||||
testStrEq(cap.err(), "");
|
||||
testStrMatch(".*Toolchain.*", cap.out());
|
||||
testStrMatch(".*epicsThreadGetCPUs.*", cap.out());
|
||||
testStrMatch(".*EPICS_PVAS_AUTO_BEACON_ADDR_LIST=.*", cap.out());
|
||||
}
|
||||
{
|
||||
CaptureStd cap([](){
|
||||
iocshCmd("pvxrefshow");
|
||||
iocshCmd("pvxrefsave");
|
||||
iocshCmd("pvxrefdiff");
|
||||
});
|
||||
testStrEq(cap.err(), "");
|
||||
testStrMatch(".*StructTop.*", cap.out());
|
||||
}
|
||||
{
|
||||
CaptureStd cap([](){
|
||||
iocshCmd("pvxsl 5");
|
||||
});
|
||||
testStrEq(cap.err(), "");
|
||||
testStrMatch(".*RECORDS.*test:ai.*", cap.out());
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
MAIN(testqsingle)
|
||||
{
|
||||
testPlan(99);
|
||||
testPlan(113);
|
||||
testSetup();
|
||||
pvxs::logger_config_env();
|
||||
generalTimeRegisterCurrentProvider("test", 1, &testTimeCurrent);
|
||||
@@ -996,6 +1047,7 @@ MAIN(testqsingle)
|
||||
testMonitorAIFilt(mctxt);
|
||||
testMonitorDBEAlarm(mctxt);
|
||||
testMonitorDBE(mctxt);
|
||||
testiocsh(mctxt);
|
||||
}
|
||||
timeSim = false;
|
||||
testPutBlock();
|
||||
|
||||
Reference in New Issue
Block a user