Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .ci-local/base-3.14.set
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
MODULES=caPutLog

BASE=3.14
CAPUTLOG=R4.0
2 changes: 2 additions & 0 deletions .ci-local/base-3.15.set
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
MODULES=caPutLog

BASE=3.15
3 changes: 2 additions & 1 deletion .ci-local/base-7.0.set
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
MODULES=pcas
MODULES=pcas caPutLog

BASE=7.0
BASE_RECURSIVE=NO

62 changes: 44 additions & 18 deletions .github/workflows/ci-scripts-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ jobs:
EXTRA: ${{ matrix.extra }}
TEST: ${{ matrix.test }}
SET: ${{ matrix.set }}
JUNIT_PREFIX: ${{ matrix.name }}_${{ matrix.os }}_
SKIP_CAPUTLOG_TESTS: ${{ matrix.skip_caputlog }}

strategy:
fail-fast: false
Expand All @@ -47,30 +49,30 @@ jobs:
set: "base-7.0"
name: "B-7.0 Ub-24 gcc-13 C++11, static"

- os: ubuntu-22.04
- os: ubuntu-24.04
cmp: gcc
configuration: default
set: "base-7.0"
name: "B-7.0 Ub-22 gcc-11"
name: "B-7.0 Ub-24 gcc-13"

- os: ubuntu-22.04
- os: ubuntu-24.04
cmp: gcc
configuration: static
set: "base-7.0"
name: "B-7.0 Ub-22 gcc-11, static"
name: "B-7.0 Ub-24 gcc-13, static"

- os: ubuntu-22.04
- os: ubuntu-24.04
cmp: clang
configuration: default
set: "base-7.0"
name: "B-7.0 Ub-22 clang-11"
name: "B-7.0 Ub-24 clang-18"

- os: ubuntu-22.04
- os: ubuntu-24.04
cmp: clang
configuration: default
extra: "CMD_CXXFLAGS=-std=c++11"
set: "base-7.0"
name: "B-7.0 Ub-22 clang-11 C++11"
name: "B-7.0 Ub-24 clang-18 C++11"

# MacOS and Windows builds need regex library
# - os: macos-latest
Expand All @@ -91,29 +93,29 @@ jobs:
# set: "base-7.0"
# name: "B-7.0 Win-22 MSC-22, debug"

- os: ubuntu-22.04
- os: ubuntu-24.04
cmp: gcc
configuration: default
set: "base-3.15"
name: "B-3.15 Ub-22 gcc-11"
name: "B-3.15 Ub-24 gcc-13"

- os: ubuntu-22.04
- os: ubuntu-24.04
cmp: gcc
configuration: static
set: "base-3.15"
name: "B-3.15 Ub-22 gcc-11, static"
name: "B-3.15 Ub-24 gcc-13, static"

- os: ubuntu-22.04
- name: "B-3.14 Ub-24 gcc-13"
os: ubuntu-24.04
cmp: gcc
configuration: default
set: "base-3.14"
name: "B-3.14 Ub-22 gcc-11"

- os: ubuntu-22.04
- name: "B-3.14 Ub-24 gcc-13, static"
os: ubuntu-24.04
cmp: gcc
configuration: static
set: "base-3.14"
name: "B-3.14 Ub-22 gcc-11, static"

steps:
- uses: actions/checkout@v4
Expand All @@ -124,12 +126,36 @@ jobs:
- name: "apt-get install"
run: |
sudo apt-get update
sudo apt-get -y install qemu-system-x86 g++-mingw-w64-x86-64 gdb python3-all-dbg
sudo pip install pyepics nose2
sudo apt-get -y install qemu-system-x86 g++-mingw-w64-x86-64 gdb
if: runner.os == 'Linux'
- name: Install Python test dependencies with pip
run: |
pip install --break-system-packages pytest pytest-tap pyepics caproto
if: matrix.os == 'ubuntu-24.04'
- name: Install Python test dependencies with pip
run: |
pip install pytest pytest-tap pyepics caproto
if: matrix.os == 'ubuntu-22.04'
- name: Prepare and compile dependencies
run: python .ci/cue.py prepare
- name: Build main module
run: python .ci/cue.py build
- name: Run main module tests
run: python .ci/cue.py test
- name: Collect and show test results
run: python .ci/cue.py test-results
- name: Generate test summary
uses: test-summary/action@v2
with:
paths: |
testTop/pyTestsApp/O.*/*.xml
if: always()
- name: Upload test artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }} - test results
path: |
testTop/pyTestsApp/O.*/*.tap
testTop/pyTestsApp/O.*/*.xml
test-summary.md
if: always()
4 changes: 3 additions & 1 deletion src/gateResources.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@
#include <caPutLog.h>
#include <caPutLogTask.h>
#include <caPutLogAs.h>
#include <caPutJsonLogTask.h>
#if EPICS_VERSION >= 7
#include <caPutJsonLogTask.h>
#endif
#ifdef HAS_caPutLogInit_arg3timeout
#define caPutLogINIT(arg1,arg2) caPutLogInit(arg1, arg2, 0.0)
#else
Expand Down
39 changes: 27 additions & 12 deletions src/gateServer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,13 @@ volatile unsigned long gateServer::quitserver_flag = 0;

void gateServer::mainLoop(void)
{
int not_done=1;
bool finalize = false;

#if defined(RATE_STATS) || defined(CAS_DIAGNOSTICS)
gateRateStatsTimer *statTimer = NULL;
epicsTimerQueueActive *pQueue = NULL;
#endif

// KE: ca_poll should be called every 100 ms
// fdManager::process can block in select for delay time
// so delay must be less than 100 ms to insure ca_poll gets called
Expand Down Expand Up @@ -246,9 +252,8 @@ void gateServer::mainLoop(void)
#if defined(RATE_STATS) || defined(CAS_DIAGNOSTICS)
// Start a default timer queue (true to use shared queue, false to
// have a private one)
epicsTimerQueueActive &queue =
epicsTimerQueueActive::allocate(true);
gateRateStatsTimer *statTimer = new gateRateStatsTimer(queue,
pQueue = &epicsTimerQueueActive::allocate(true);
statTimer = new gateRateStatsTimer(*pQueue,
RATE_STATS_INTERVAL, this);
if(statTimer) {
// Call the expire routine to initialize it
Expand All @@ -268,7 +273,7 @@ void gateServer::mainLoop(void)
#endif

// Main loop
while(not_done) {
while (!finalize) {
#if defined(RATE_STATS) || defined(CAS_DIAGNOSTICS)
loop_count++;
#endif
Expand Down Expand Up @@ -363,8 +368,9 @@ void gateServer::mainLoop(void)
quit_flag=0;
setStat(statQuitFlag,0ul);
// return here will delete gateServer
return;
}
finalize = true;
continue;
}
if(quitserver_flag) {
printf("%s Stopping server (quitServerFlag was set to 1)\n",
timeStamp());
Expand All @@ -377,23 +383,32 @@ void gateServer::mainLoop(void)
if(parentPid >= 0) {
kill(parentPid,SIGTERM);
} else {
exit(0);
}
finalize = true;
}
#endif
} else {
// Doesn't have a server, just quit
exit(0);
}
}
finalize = true;
}
if (finalize)
continue;
}

#ifdef __linux__
# ifndef USE_LINUX_PROC_FOR_CPU
// Get clock for this thread
mainClock=clock();
# endif
#endif
}

#if defined(RATE_STATS) || defined(CAS_DIAGNOSTICS)
if(statTimer) {
statTimer->stop();
delete statTimer;
}
if(pQueue) pQueue->release();
#endif
}

// This is a wrapper around caServer::generateBeaconAnomaly. Generate
Expand Down
1 change: 0 additions & 1 deletion src/gateServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ class gateRateStatsTimer : public epicsTimerNotify
virtual expireStatus expire(const epicsTime &curTime);
void start() { timer.start(*this,interval); }
void stop() { timer.cancel(); }
protected:
virtual ~gateRateStatsTimer() { timer.destroy(); }
private:
double interval;
Expand Down
5 changes: 5 additions & 0 deletions testTop/pyTestsApp/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
exclude = __pycache__,O.*/*.py
max-line-length = 88
select = C,E,F,W,B,B950
extend-ignore = E203, E501
58 changes: 0 additions & 58 deletions testTop/pyTestsApp/GatewayControl.py

This file was deleted.

60 changes: 0 additions & 60 deletions testTop/pyTestsApp/IOCControl.py

This file was deleted.

Loading