Skip to content

Commit a2c1f44

Browse files
OPCUA-3291 OPCUA-3292 OPCUA-3257 Several fixes (#97)
* Adding automatic tests and fixing setting value * Pre-Commit update * libsocketcan auto-downloaded and configured * Update gitlab and remove obsolete * Fix path image * Missing image: * Add cstdint * Add cstdint * Alma 10 with Python 3.12, no need to force python version * Fix test * Execute modprobe * Precommit * No Windows modprobe * Undo not needed
1 parent 96d77e9 commit a2c1f44

32 files changed

Lines changed: 145 additions & 171 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ __pycache__/
33
.env
44
/public
55
*.cpython*
6+
.github/*.md

.gitlab-ci.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
image: gitlab-registry.cern.ch/linuxsupport/alma9-base:latest
1+
image: gitlab-registry.cern.ch/linuxsupport/alma10-base:latest
22

33
stages:
44
- unstagged
@@ -11,9 +11,6 @@ include:
1111
rules:
1212
- if: $CI_PIPELINE_SOURCE == "api" # Source Github-Gitlab bridge
1313
- if: $PIPELINE == "normal"
14-
- local: ci/gitlab/docker.yml
15-
rules:
16-
- if: $DOCKER_GENERATION == "true"
1714

1815
# Empty job, as gitlab-ci requires at least one job
1916
empty:

.pre-commit-config.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ repos:
55
- id: clang-format
66
args: ["-style=Google"]
77
- id: cppcheck
8+
args: ["--check-level=exhaustive"]
89
- id: cpplint
910
args: ["--filter=-legal/copyright"]
1011

1112
- repo: https://github.com/pre-commit/pre-commit-hooks
12-
rev: v4.6.0
13+
rev: v6.0.0
1314
hooks:
1415
- id: trailing-whitespace
1516
- id: check-added-large-files
@@ -29,7 +30,7 @@ repos:
2930
- id: mixed-line-ending
3031

3132
- repo: https://github.com/psf/black
32-
rev: 24.4.2
33+
rev: 25.12.0
3334
hooks:
3435
- id: black
3536

CMakeLists.txt

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ set(CMAKE_CXX_STANDARD 17)
77
set(CMAKE_CXX_STANDARD_REQUIRED ON)
88
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
99

10-
include_directories(src/include
11-
${PROJECT_BINARY_DIR}/src/include/)
10+
include_directories(
11+
src/include
12+
${PROJECT_BINARY_DIR}/src/include/
13+
)
1214

1315
include(cmake/version.cmake)
1416

@@ -23,16 +25,17 @@ set(SOURCES
2325

2426
include(cmake/env.cmake)
2527

26-
2728
set(VENDOR_SOURCES
2829
src/main/CanVendorAnagate.cpp
2930
)
3031

3132
if (UNIX)
33+
include(cmake/libsocketcan.cmake)
34+
include_directories(${LIBSOCKETCAN_INCLUDE_DIR})
3235
list(APPEND VENDOR_SOURCES
33-
src/main/CanVendorSocketCan.cpp
34-
src/main/CanVendorSocketCanSystec.cpp
35-
)
36+
src/main/CanVendorSocketCan.cpp
37+
src/main/CanVendorSocketCanSystec.cpp
38+
)
3639
endif()
3740

3841
if (NOT DEFINED CAN_MODULE_MAIN_ONLY)
@@ -44,31 +47,36 @@ endif()
4447

4548
include(cmake/anagate.cmake)
4649

50+
4751
add_library(CanModuleMain ${SOURCES} ${VENDOR_SOURCES})
48-
target_include_directories(CanModuleMain PUBLIC ${LOGIT_INCLUDE} ${anagate_SOURCE_DIR}/)
52+
53+
target_include_directories(CanModuleMain PUBLIC
54+
${LOGIT_INCLUDE}
55+
${anagate_SOURCE_DIR}/
56+
)
57+
4958
if (UNIX)
5059
target_link_libraries(CanModuleMain PUBLIC
51-
${anagate_SOURCE_DIR}/Linux64/CentOS_9/libCANDLLStaticRelease64.a
52-
${anagate_SOURCE_DIR}/Linux64/CentOS_9/libAnaGateStaticRelease.a
53-
${anagate_SOURCE_DIR}/Linux64/CentOS_9/libAnaGateExtStaticRelease.a
54-
socketcan)
60+
${anagate_SOURCE_DIR}/Linux64/CentOS_9/libCANDLLStaticRelease64.a
61+
${anagate_SOURCE_DIR}/Linux64/CentOS_9/libAnaGateStaticRelease.a
62+
${anagate_SOURCE_DIR}/Linux64/CentOS_9/libAnaGateExtStaticRelease.a
63+
libsocketcan
64+
)
5565
else()
5666
target_link_libraries(CanModuleMain PUBLIC
57-
${anagate_SOURCE_DIR}/Win64/AnaGateCanDll64.lib)
58-
file(COPY "${anagate_SOURCE_DIR}/Win64/AnaGateCan64.dll" DESTINATION "${CMAKE_BINARY_DIR}/Release")
67+
${anagate_SOURCE_DIR}/Win64/AnaGateCanDll64.lib
68+
)
69+
file(COPY "${anagate_SOURCE_DIR}/Win64/AnaGateCan64.dll"
70+
DESTINATION "${CMAKE_BINARY_DIR}/Release")
5971
endif()
6072

61-
# Treat warnings as errors
6273
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
63-
target_compile_options(CanModuleMain PRIVATE -Wall -Wextra -Werror)
74+
target_compile_options(CanModuleMain PRIVATE -Wall -Wextra -Werror)
6475
elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
65-
# target_compile_options(CanModuleMain PRIVATE /W4 /WX)
66-
# I need to disable that feature due to a macro redefinition
67-
# in the header of Anagate software
76+
# Disabled because of AnaGate macro redefinition issues
6877
endif()
6978

7079
if (NOT DEFINED CAN_MODULE_MAIN_ONLY)
71-
# Build Python Support and Google Unit Tests
7280
include(cmake/pybind11.cmake)
7381
include(cmake/gtest.cmake)
7482
endif()

ci/docker/alma9/Dockerfile

Lines changed: 0 additions & 19 deletions
This file was deleted.

ci/docker/alma9/trigger

Lines changed: 0 additions & 2 deletions
This file was deleted.

ci/docker/w2022/Dockerfile

Lines changed: 0 additions & 5 deletions
This file was deleted.

ci/docker/w2022/install.ps1

Lines changed: 0 additions & 24 deletions
This file was deleted.

ci/docker/w2022/trigger

Lines changed: 0 additions & 2 deletions
This file was deleted.

ci/gitlab/docker.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)