Skip to content
Open
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
4 changes: 2 additions & 2 deletions score/mw/com/impl/traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class ProxyTrait
// Note : at the moment the SkeletonField::Get implementation is not in the branch which means the skeleton and
// proxy side does not have same template parameters.
template <typename SampleType, bool EnableSet = false, bool EnableGet = false, bool EnableNotifier = false>
using Field = ProxyField<SampleType>;
using Field = ProxyField<SampleType, EnableSet, EnableGet, EnableNotifier>;

template <typename MethodSignature>
using Method = ProxyMethod<MethodSignature>;
Expand All @@ -164,7 +164,7 @@ class SkeletonTrait
template <typename SampleType>
using Event = SkeletonEvent<SampleType>;

template <typename SampleType, bool EnableSet = false, bool EnableNotifier = false>
template <typename SampleType, bool EnableGet = false, bool EnableSet = false, bool EnableNotifier = false>
using Field = SkeletonField<SampleType, EnableSet, EnableNotifier>;

template <typename MethodSignature>
Expand Down
6 changes: 5 additions & 1 deletion score/mw/com/impl/traits_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <gtest/gtest.h>
#include <memory>
#include <optional>
#include <type_traits>
#include <utility>
#include <vector>

Expand Down Expand Up @@ -68,10 +69,13 @@ class MyInterface : public InterfaceTrait::Base
public:
using InterfaceTrait::Base::Base;

static constexpr bool kEnableSet{std::is_same_v<InterfaceTrait, SkeletonTrait>};

typename InterfaceTrait::template Event<TestSampleType> some_event{*this, kEventName};
typename InterfaceTrait::template Field<TestSampleType, true> some_field{*this, kFieldName};
typename InterfaceTrait::template Field<TestSampleType, false, kEnableSet> some_field{*this, kFieldName};
typename InterfaceTrait::template Method<TestMethodType> some_method{*this, kMethodName};
};

using MyProxy = AsProxy<MyInterface>;
using MySkeleton = AsSkeleton<MyInterface>;

Expand Down
22 changes: 22 additions & 0 deletions score/mw/com/test/common_test_resources/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,28 @@ load("@rules_cc//cc:defs.bzl", "cc_library")
load("@score_baselibs//score/language/safecpp:toolchain_features.bzl", "COMPILER_WARNING_FEATURES")
load("//quality/unit_testing:unit_testing.bzl", "cc_unit_test")

cc_library(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving these should be a separate commit. You can read my comment here to better understand how commits should look / why we split them up: #385 (comment)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. pushed these changes with separate commit.

name = "proxy_container",
srcs = ["proxy_container.cpp"],
hdrs = ["proxy_container.h"],
features = COMPILER_WARNING_FEATURES,
visibility = ["//score/mw/com/test:__subpackages__"],
deps = [
"//score/mw/com",
],
)

cc_library(
name = "skeleton_container",
srcs = ["skeleton_container.cpp"],
hdrs = ["skeleton_container.h"],
features = COMPILER_WARNING_FEATURES,
visibility = ["//score/mw/com/test:__subpackages__"],
deps = [
"//score/mw/com",
],
)

cc_library(
name = "bigdata_type",
srcs = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
*
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/
#include "score/mw/com/test/methods/methods_test_resources/proxy_container.h"
#include "score/mw/com/test/common_test_resources/proxy_container.h"
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
*
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/
#include "score/mw/com/test/methods/methods_test_resources/skeleton_container.h"
#include "score/mw/com/test/common_test_resources/skeleton_container.h"
88 changes: 0 additions & 88 deletions score/mw/com/test/field_initial_value/service.cpp

This file was deleted.

12 changes: 12 additions & 0 deletions score/mw/com/test/fields/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# *******************************************************************************
# Copyright (c) 2026 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ cc_binary(
features = COMPILER_WARNING_FEATURES + [
"aborts_upon_exception",
],
visibility = ["//score/mw/com/test/field_initial_value:__pkg__"],
visibility = ["//score/mw/com/test/fields/field_initial_value:__pkg__"],
deps = [
":test_datatype",
"//score/mw/com",
"//score/mw/com/test/common_test_resources:sctf_test_runner",
"//score/mw/com/test/common_test_resources:fail_test",
"//score/mw/com/test/common_test_resources:stop_token_sig_term_handler",
"//score/mw/com/test/methods/methods_test_resources:process_synchronizer",
"@score_baselibs//score/mw/log",
],
)
Expand All @@ -56,11 +58,12 @@ cc_binary(
features = COMPILER_WARNING_FEATURES + [
"aborts_upon_exception",
],
visibility = ["//score/mw/com/test/field_initial_value:__pkg__"],
visibility = ["//score/mw/com/test/fields/field_initial_value:__pkg__"],
deps = [
":test_datatype",
"//score/mw/com",
"//score/mw/com/test/common_test_resources:sctf_test_runner",
"//score/mw/com/test/methods/methods_test_resources:process_synchronizer",
"@score_baselibs//score/mw/log",
],
)
Expand All @@ -75,7 +78,7 @@ pkg_application(
],
visibility = [
"//platform/aas/test/mw/com:__pkg__",
"//score/mw/com/test/field_initial_value:__subpackages__",
"//score/mw/com/test/fields/field_initial_value:__subpackages__",
],
)

Expand All @@ -89,6 +92,6 @@ pkg_application(
],
visibility = [
"//platform/aas/test/mw/com:__pkg__",
"//score/mw/com/test/field_initial_value:__subpackages__",
"//score/mw/com/test/fields/field_initial_value:__subpackages__",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
*******************************************************************************/

#include "score/mw/com/test/common_test_resources/sctf_test_runner.h"
#include "score/mw/com/test/field_initial_value/test_datatype.h"
#include "score/mw/com/test/fields/field_initial_value/test_datatype.h"
#include "score/mw/com/test/methods/methods_test_resources/process_synchronizer.h"
#include "score/mw/com/types.h"

#include <score/optional.hpp>
Expand All @@ -21,6 +22,7 @@
#include <cstddef>
#include <future>
#include <iostream>
#include <string>
#include <thread>

namespace score::mw::com::test
Expand All @@ -31,10 +33,19 @@ namespace

constexpr auto kMaxNumSamples{1U};

const std::string kInterprocessNotificationShmPath{"/field_initial_value_interprocess_notification"};

int run_client(const std::size_t num_retries, const std::chrono::milliseconds retry_backoff_time)
{
using score::mw::com::test::TestDataProxy;

auto process_synchronizer_result = ProcessSynchronizer::Create(kInterprocessNotificationShmPath);
if (!process_synchronizer_result.has_value())
{
std::cerr << "Unable to create ProcessSynchronizer, terminating\n";
return -8;
}

auto instance_specifier_result = InstanceSpecifier::Create(std::string{kInstanceSpecifierString});
if (!instance_specifier_result.has_value())
{
Expand Down Expand Up @@ -106,6 +117,7 @@ int run_client(const std::size_t num_retries, const std::chrono::milliseconds re
return -6;
}

process_synchronizer_result->Notify();
return 0;
}

Expand All @@ -122,7 +134,6 @@ int main(int argc, const char** argv)
const auto& run_parameters = test_runner.GetRunParameters();
const auto num_retries = run_parameters.GetNumRetries();
const auto retry_backoff_time = run_parameters.GetRetryBackoffTime();
const auto stop_token = test_runner.GetStopToken();

return score::mw::com::test::run_client(num_retries, retry_backoff_time);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
"logLevelThresholdConsole": "kDebug",
"logMode": "kRemote|kConsole"
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"serviceTypes": [
{
"serviceTypeName": "/score/mw/com/test/field_initial_value",
"serviceTypeName": "/score/mw/com/test/fields/field_initial_value",
"version": {
"major": 1,
"minor": 0
Expand All @@ -22,8 +22,8 @@
],
"serviceInstances": [
{
"instanceSpecifier": "test/field_initial_value",
"serviceTypeName": "/score/mw/com/test/field_initial_value",
"instanceSpecifier": "test/fields/field_initial_value",
"serviceTypeName": "/score/mw/com/test/fields/field_initial_value",
"version": {
"major": 1,
"minor": 0
Expand All @@ -45,4 +45,3 @@
}
]
}

Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ load("//quality/integration_testing:integration_testing.bzl", "integration_test"
pkg_filegroup(
name = "filesystem",
srcs = [
"//score/mw/com/test/field_initial_value:client-pkg",
"//score/mw/com/test/field_initial_value:service-pkg",
"//score/mw/com/test/fields/field_initial_value:client-pkg",
"//score/mw/com/test/fields/field_initial_value:service-pkg",
],
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def client(target, **kwargs):


def service(target, **kwargs):
args = ["--cycle-time", "250"]
args = []
return target.wrap_exec("bin/service", args, cwd="/opt/ServiceApp", **kwargs)


Expand Down
Loading
Loading