Skip to content

Commit f5966b4

Browse files
author
Aliaksandr Adziareika
committed
<TBBAS-2530> Add export static method explicitly
1 parent 987f29b commit f5966b4

File tree

3 files changed

+28
-24
lines changed

3 files changed

+28
-24
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,18 @@ jobs:
3939
with:
4040
opendaq-framework-package-filename: ${{ steps.opendaq-framework.outputs.artefact }}
4141

42-
- name: Archive installed openDAQ
43-
if: runner.os == 'Windows'
44-
shell: pwsh
45-
run: |
46-
Compress-Archive -Path "C:/Program Files/openDAQ" -DestinationPath "$env:RUNNER_TEMP/opendaq.zip"
42+
# - name: Archive installed openDAQ
43+
# if: runner.os == 'Windows'
44+
# shell: pwsh
45+
# run: |
46+
# Compress-Archive -Path "C:/Program Files/openDAQ" -DestinationPath "$env:RUNNER_TEMP/opendaq.zip"
4747

48-
- name: Upload openDAQ artifact
49-
if: runner.os == 'Windows'
50-
uses: actions/upload-artifact@v4
51-
with:
52-
name: opendaq-install
53-
path: ${{ runner.temp }}/opendaq.zip
48+
# - name: Upload openDAQ artifact
49+
# if: runner.os == 'Windows'
50+
# uses: actions/upload-artifact@v4
51+
# with:
52+
# name: opendaq-install
53+
# path: ${{ runner.temp }}/opendaq.zip
5454

5555
# - name: Install Windows dependencies
5656
# id: windows-dependencies-install
@@ -66,6 +66,13 @@ jobs:
6666
if: runner.os == 'Windows'
6767
run: cmake --build build/output --config Release
6868

69+
- name: Run simple device module tests via CTest with GTest report Windows
70+
if: runner.os == 'Windows'
71+
run: |
72+
New-Item -ItemType Directory -Force -Path build/reports | Out-Null
73+
$env:GTEST_OUTPUT = "xml:$PWD/build/reports/gtest-report.xml"
74+
ctest --test-dir build/output --output-on-failure -C Release -V
75+
6976
- name: Configure simple device module with CMake
7077
if: runner.os != 'Windows'
7178
run: cmake -B build/output -S . -G Ninja -DOPENDAQ_ENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Release
@@ -75,6 +82,7 @@ jobs:
7582
run: cmake --build build/output --target all
7683

7784
- name: Run simple device module tests via CTest with GTest report
85+
if: runner.os != 'Windows'
7886
run: |
7987
mkdir -p build/reports
8088
GTEST_OUTPUT=xml:$(pwd)/build/reports/gtest-report.xml ctest --test-dir build/output --output-on-failure -V

example_module/tests/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,12 @@ target_link_libraries(${TEST_APP}
3737
GTest::gmock_main
3838
)
3939
include(GoogleTest)
40-
gtest_discover_tests(${TEST_APP})
40+
# gtest_discover_tests(${TEST_APP})
4141

4242
add_test(NAME ${TEST_APP}
4343
COMMAND $<TARGET_FILE_NAME:${TEST_APP}>
44-
WORKING_DIRECTORY bin
44+
WORKING_DIRECTORY $<TARGET_FILE_DIR:${TEST_APP}
4545
)
46+
47+
set_target_properties(${TEST_APP} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY $<TARGET_FILE_DIR:${TEST_APP}>)
48+

example_module/tests/test_example_module.cpp

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include <example_module/version.h>
66
#include <gmock/gmock.h>
77
#include <opendaq/opendaq.h>
8-
// #include <testutils/testutils.h>
98

109
#include <chrono>
1110
#include <thread>
@@ -19,8 +18,6 @@ using testing::SizeIs;
1918
using namespace daq;
2019
using namespace std::chrono_literals;
2120

22-
using ExampleChannel = modules::example_module::ExampleChannel;
23-
using ExampleDevice = modules::example_module::ExampleDevice;
2421
using ExampleModuleTest = testing::Test;
2522

2623
static ModulePtr CreateModule()
@@ -153,10 +150,9 @@ TEST_F(ExampleModuleTest, GetDeviceType)
153150
DictPtr<IString, IDeviceType> deviceTypes;
154151
ASSERT_NO_THROW(deviceTypes = moduleLib.getAvailableDeviceTypes());
155152

156-
DeviceTypePtr expected = ExampleDevice::CreateType();
157-
StringPtr key = expected.getId();
153+
StringPtr key = "example_dev";
158154
ASSERT_TRUE(deviceTypes.hasKey(key));
159-
ASSERT_EQ(deviceTypes.get(key).getId(), expected.getId());
155+
ASSERT_EQ(deviceTypes.get(key).getId(), key);
160156
}
161157

162158
TEST_F(ExampleModuleTest, GetValueSignals)
@@ -250,9 +246,9 @@ TEST_F(ExampleModuleTest, GetDomainSignal)
250246
RatioPtr tickResolution;
251247
ASSERT_NO_THROW(tickResolution = domainDescriptor.getTickResolution())
252248
<< id << " get domain signal tick resolution failed";
253-
ASSERT_TRUE(tickResolution.assigned()) << "["
249+
ASSERT_TRUE(tickResolution.assigned())
254250
<< id << " domain signal tick resolution is not assigned";
255-
ASSERT_EQ(tickResolution, ExampleChannel::getResolution())
251+
ASSERT_EQ(tickResolution, Ratio(1, 1000000))
256252
<< id << " domain signal tick resolution mismatches";
257253

258254
DataRulePtr dataRule;
@@ -269,9 +265,6 @@ TEST_F(ExampleModuleTest, GetDomainSignal)
269265
StringPtr keyStart = "start";
270266
ASSERT_EQ(dataRule.getParameters().get(keyStart), 0)
271267
<< id << " domain signal data rule \"" << keyStart << "\" parameter mismatches";
272-
273-
ASSERT_EQ(domainDescriptor.getOrigin(), ExampleChannel::getEpoch())
274-
<< id << " domain signal origin mismatches";
275268
}
276269
}
277270

0 commit comments

Comments
 (0)