From f1bef3757aca0959e5308bd63ae251c2a797a4be Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 26 Nov 2024 10:28:46 +0800 Subject: [PATCH 01/26] feat: add c++ ten_env_tester_proxy.h to unified c++ intf file --- core/include/ten_runtime/binding/cpp/ten.h | 39 ++++++++++------------ 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/core/include/ten_runtime/binding/cpp/ten.h b/core/include/ten_runtime/binding/cpp/ten.h index f5ad62d2f..dfd5b578b 100644 --- a/core/include/ten_runtime/binding/cpp/ten.h +++ b/core/include/ten_runtime/binding/cpp/ten.h @@ -9,28 +9,25 @@ // This header file should be the only header file where outside world should // include in the C++ programming language. -// clang-format off -#include "ten_runtime/binding/cpp/internal/common.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/ten_env.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/ten_env_proxy.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/msg/msg.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/msg/cmd/cmd.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/msg/cmd/start_graph.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/msg/cmd/stop_graph.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/msg/cmd/close_app.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/msg/cmd_result.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/msg/data.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/msg/video_frame.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/msg/audio_frame.h" // IWYU pragma: export -// 'extension.h' must be in front of 'addon.h' -#include "ten_runtime/binding/cpp/internal/extension.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/test/extension_tester.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/test/env_tester.h" // IWYU pragma: export -// clang-format on - #include "ten_runtime/addon/extension/extension.h" // IWYU pragma: export #include "ten_runtime/addon/extension_group/extension_group.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/addon.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/app.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/internal/addon.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/internal/app.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/internal/common.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/internal/extension.h" // IWYU pragma: export #include "ten_runtime/binding/cpp/internal/extension_impl.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/internal/msg/audio_frame.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/internal/msg/cmd/close_app.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/internal/msg/cmd/cmd.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/internal/msg/cmd/start_graph.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/internal/msg/cmd/stop_graph.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/internal/msg/cmd_result.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/internal/msg/data.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/internal/msg/msg.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/internal/msg/video_frame.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/internal/ten_env.h" // IWYU pragma: export #include "ten_runtime/binding/cpp/internal/ten_env_impl.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/internal/ten_env_proxy.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/internal/test/env_tester.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/internal/test/env_tester_proxy.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/internal/test/extension_tester.h" // IWYU pragma: export From b15e74e462dc46b3672fed97fdeb102c3cc989cb Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 26 Nov 2024 10:39:04 +0800 Subject: [PATCH 02/26] refactor: change c++ internal/ folder name to detail/ --- .../binding/cpp/{internal => detail}/addon.h | 4 +- .../binding/cpp/{internal => detail}/app.h | 4 +- .../binding/cpp/{internal => detail}/common.h | 0 .../cpp/{internal => detail}/extension.h | 14 +++--- .../cpp/{internal => detail}/extension_impl.h | 6 +-- .../{internal => detail}/msg/audio_frame.h | 2 +- .../{internal => detail}/msg/cmd/close_app.h | 2 +- .../cpp/{internal => detail}/msg/cmd/cmd.h | 2 +- .../msg/cmd/start_graph.h | 2 +- .../{internal => detail}/msg/cmd/stop_graph.h | 2 +- .../cpp/{internal => detail}/msg/cmd_result.h | 2 +- .../cpp/{internal => detail}/msg/data.h | 2 +- .../cpp/{internal => detail}/msg/msg.h | 0 .../{internal => detail}/msg/video_frame.h | 2 +- .../cpp/{internal => detail}/ten_env.h | 10 ++--- .../cpp/{internal => detail}/ten_env_impl.h | 6 +-- .../cpp/{internal => detail}/ten_env_proxy.h | 2 +- .../{internal => detail}/test/env_tester.h | 10 ++--- .../test/env_tester_proxy.h | 2 +- .../test/extension_tester.h | 10 ++--- .../cpp/experimental/ten_client_proxy.h | 4 +- core/include/ten_runtime/binding/cpp/ten.h | 40 ++++++++--------- .../msg/cmd/cmd_result_internal_accessor.h | 2 +- .../binding/cpp/internal/msg/cmd/timeout.h | 2 +- .../binding/cpp/internal/msg/cmd/timer.h | 2 +- .../cpp/internal/ten_env_internal_accessor.h | 2 +- .../ten_runtime/binding/cpp/ten.h | 44 +++++++++---------- .../py_init_extension_cpp/src/main.cc | 4 +- tests/common/client/cpp/msgpack_tcp.h | 4 +- .../default_extension_cpp/src/main.cc | 6 +-- .../cpp/multi_apps/client/client.cc | 2 +- .../audio_frame_test/create_from_json.cc | 2 +- .../cmd_conversion_path_nested_5.cc | 2 +- .../cmd_result_test/multiple_result_2.cc | 2 +- .../cmd_result_test/multiple_result_3.cc | 2 +- .../smoke/data_test/create_from_json.cc | 2 +- .../command/command_stop_graph_actively.cc | 2 +- .../dest/no_audio_frame_dest.cc | 4 +- .../error/error_client_send_json.cc | 2 +- .../error/failed_to_connect_to_remote.cc | 2 +- .../graph/graph_loop_multiple_circle.cc | 2 +- ...ultiple_circle_through_cmd_with_default.cc | 2 +- .../32_threads_attempt_to_suspend_5.cc | 2 +- .../start_predefined_graph_cross_app.cc | 2 +- .../start_two_predefined_graphs.cc | 2 +- .../extension_test/util/binding/cpp/check.h | 2 +- tests/ten_runtime/smoke/msg_test/msg_12.cc | 2 +- tests/ten_runtime/smoke/msg_test/msg_9.cc | 2 +- .../smoke/schema_test/schema_on_cmd.cc | 2 +- .../smoke/standalone_test/basic.cc | 2 +- .../smoke/standalone_test/basic_graph.cc | 6 +-- .../basic_graph_outer_thread_1.cc | 8 ++-- .../basic_graph_outer_thread_2.cc | 8 ++-- .../smoke/standalone_test/on_cmd.cc | 2 +- .../smoke/ten_env_call_timing/on_xxx_done.cc | 2 +- .../video_frame_test/create_from_json.cc | 2 +- 56 files changed, 132 insertions(+), 132 deletions(-) rename core/include/ten_runtime/binding/cpp/{internal => detail}/addon.h (99%) rename core/include/ten_runtime/binding/cpp/{internal => detail}/app.h (98%) rename core/include/ten_runtime/binding/cpp/{internal => detail}/common.h (100%) rename core/include/ten_runtime/binding/cpp/{internal => detail}/extension.h (98%) rename core/include/ten_runtime/binding/cpp/{internal => detail}/extension_impl.h (90%) rename core/include/ten_runtime/binding/cpp/{internal => detail}/msg/audio_frame.h (99%) rename core/include/ten_runtime/binding/cpp/{internal => detail}/msg/cmd/close_app.h (95%) rename core/include/ten_runtime/binding/cpp/{internal => detail}/msg/cmd/cmd.h (97%) rename core/include/ten_runtime/binding/cpp/{internal => detail}/msg/cmd/start_graph.h (97%) rename core/include/ten_runtime/binding/cpp/{internal => detail}/msg/cmd/stop_graph.h (95%) rename core/include/ten_runtime/binding/cpp/{internal => detail}/msg/cmd_result.h (97%) rename core/include/ten_runtime/binding/cpp/{internal => detail}/msg/data.h (98%) rename core/include/ten_runtime/binding/cpp/{internal => detail}/msg/msg.h (100%) rename core/include/ten_runtime/binding/cpp/{internal => detail}/msg/video_frame.h (98%) rename core/include/ten_runtime/binding/cpp/{internal => detail}/ten_env.h (99%) rename core/include/ten_runtime/binding/cpp/{internal => detail}/ten_env_impl.h (87%) rename core/include/ten_runtime/binding/cpp/{internal => detail}/ten_env_proxy.h (99%) rename core/include/ten_runtime/binding/cpp/{internal => detail}/test/env_tester.h (95%) rename core/include/ten_runtime/binding/cpp/{internal => detail}/test/env_tester_proxy.h (98%) rename core/include/ten_runtime/binding/cpp/{internal => detail}/test/extension_tester.h (96%) diff --git a/core/include/ten_runtime/binding/cpp/internal/addon.h b/core/include/ten_runtime/binding/cpp/detail/addon.h similarity index 99% rename from core/include/ten_runtime/binding/cpp/internal/addon.h rename to core/include/ten_runtime/binding/cpp/detail/addon.h index 43f6ec2b7..253cd647f 100644 --- a/core/include/ten_runtime/binding/cpp/internal/addon.h +++ b/core/include/ten_runtime/binding/cpp/detail/addon.h @@ -12,8 +12,8 @@ #include "ten_runtime/addon/addon.h" #include "ten_runtime/addon/extension/extension.h" #include "ten_runtime/binding/common.h" -#include "ten_runtime/binding/cpp/internal/common.h" -#include "ten_runtime/binding/cpp/internal/ten_env.h" +#include "ten_runtime/binding/cpp/detail/common.h" +#include "ten_runtime/binding/cpp/detail/ten_env.h" #include "ten_runtime/ten_env/ten_env.h" #include "ten_utils/lib/path.h" // IWYU pragma: export diff --git a/core/include/ten_runtime/binding/cpp/internal/app.h b/core/include/ten_runtime/binding/cpp/detail/app.h similarity index 98% rename from core/include/ten_runtime/binding/cpp/internal/app.h rename to core/include/ten_runtime/binding/cpp/detail/app.h index 431b8efc4..041e2e9ec 100644 --- a/core/include/ten_runtime/binding/cpp/internal/app.h +++ b/core/include/ten_runtime/binding/cpp/detail/app.h @@ -11,8 +11,8 @@ #include "ten_runtime/app/app.h" #include "ten_runtime/binding/common.h" -#include "ten_runtime/binding/cpp/internal/common.h" -#include "ten_runtime/binding/cpp/internal/ten_env.h" +#include "ten_runtime/binding/cpp/detail/common.h" +#include "ten_runtime/binding/cpp/detail/ten_env.h" #include "ten_runtime/ten.h" #include "ten_utils/macro/check.h" diff --git a/core/include/ten_runtime/binding/cpp/internal/common.h b/core/include/ten_runtime/binding/cpp/detail/common.h similarity index 100% rename from core/include/ten_runtime/binding/cpp/internal/common.h rename to core/include/ten_runtime/binding/cpp/detail/common.h diff --git a/core/include/ten_runtime/binding/cpp/internal/extension.h b/core/include/ten_runtime/binding/cpp/detail/extension.h similarity index 98% rename from core/include/ten_runtime/binding/cpp/internal/extension.h rename to core/include/ten_runtime/binding/cpp/detail/extension.h index ca7540f2c..f312e715c 100644 --- a/core/include/ten_runtime/binding/cpp/internal/extension.h +++ b/core/include/ten_runtime/binding/cpp/detail/extension.h @@ -14,13 +14,13 @@ #include #include "ten_runtime/binding/common.h" -#include "ten_runtime/binding/cpp/internal/common.h" -#include "ten_runtime/binding/cpp/internal/msg/audio_frame.h" -#include "ten_runtime/binding/cpp/internal/msg/cmd/cmd.h" -#include "ten_runtime/binding/cpp/internal/msg/cmd/stop_graph.h" -#include "ten_runtime/binding/cpp/internal/msg/data.h" -#include "ten_runtime/binding/cpp/internal/msg/video_frame.h" -#include "ten_runtime/binding/cpp/internal/ten_env.h" +#include "ten_runtime/binding/cpp/detail/common.h" +#include "ten_runtime/binding/cpp/detail/msg/audio_frame.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd/cmd.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd/stop_graph.h" +#include "ten_runtime/binding/cpp/detail/msg/data.h" +#include "ten_runtime/binding/cpp/detail/msg/video_frame.h" +#include "ten_runtime/binding/cpp/detail/ten_env.h" #include "ten_runtime/extension/extension.h" #include "ten_runtime/msg/cmd/stop_graph/cmd.h" #include "ten_runtime/msg/msg.h" diff --git a/core/include/ten_runtime/binding/cpp/internal/extension_impl.h b/core/include/ten_runtime/binding/cpp/detail/extension_impl.h similarity index 90% rename from core/include/ten_runtime/binding/cpp/internal/extension_impl.h rename to core/include/ten_runtime/binding/cpp/detail/extension_impl.h index 189ba6598..51ba4c51d 100644 --- a/core/include/ten_runtime/binding/cpp/internal/extension_impl.h +++ b/core/include/ten_runtime/binding/cpp/detail/extension_impl.h @@ -12,9 +12,9 @@ #include #include -#include "ten_runtime/binding/cpp/internal/extension.h" -#include "ten_runtime/binding/cpp/internal/msg/cmd/close_app.h" -#include "ten_runtime/binding/cpp/internal/msg/cmd/start_graph.h" +#include "ten_runtime/binding/cpp/detail/extension.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd/close_app.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd/start_graph.h" #include "ten_runtime/msg/msg.h" namespace ten { diff --git a/core/include/ten_runtime/binding/cpp/internal/msg/audio_frame.h b/core/include/ten_runtime/binding/cpp/detail/msg/audio_frame.h similarity index 99% rename from core/include/ten_runtime/binding/cpp/internal/msg/audio_frame.h rename to core/include/ten_runtime/binding/cpp/detail/msg/audio_frame.h index 308e0b408..809dd9ef0 100644 --- a/core/include/ten_runtime/binding/cpp/internal/msg/audio_frame.h +++ b/core/include/ten_runtime/binding/cpp/detail/msg/audio_frame.h @@ -11,7 +11,7 @@ #include #include -#include "ten_runtime/binding/cpp/internal/msg/msg.h" +#include "ten_runtime/binding/cpp/detail/msg/msg.h" #include "ten_runtime/msg/audio_frame/audio_frame.h" #include "ten_utils/lib/smart_ptr.h" diff --git a/core/include/ten_runtime/binding/cpp/internal/msg/cmd/close_app.h b/core/include/ten_runtime/binding/cpp/detail/msg/cmd/close_app.h similarity index 95% rename from core/include/ten_runtime/binding/cpp/internal/msg/cmd/close_app.h rename to core/include/ten_runtime/binding/cpp/detail/msg/cmd/close_app.h index d80c6cda8..23a334b53 100644 --- a/core/include/ten_runtime/binding/cpp/internal/msg/cmd/close_app.h +++ b/core/include/ten_runtime/binding/cpp/detail/msg/cmd/close_app.h @@ -10,7 +10,7 @@ #include -#include "ten_runtime/binding/cpp/internal/msg/cmd/cmd.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd/cmd.h" #include "ten_runtime/msg/cmd/close_app/cmd.h" namespace ten { diff --git a/core/include/ten_runtime/binding/cpp/internal/msg/cmd/cmd.h b/core/include/ten_runtime/binding/cpp/detail/msg/cmd/cmd.h similarity index 97% rename from core/include/ten_runtime/binding/cpp/internal/msg/cmd/cmd.h rename to core/include/ten_runtime/binding/cpp/detail/msg/cmd/cmd.h index b70cab604..9f4f86003 100644 --- a/core/include/ten_runtime/binding/cpp/internal/msg/cmd/cmd.h +++ b/core/include/ten_runtime/binding/cpp/detail/msg/cmd/cmd.h @@ -10,7 +10,7 @@ #include -#include "ten_runtime/binding/cpp/internal/msg/msg.h" +#include "ten_runtime/binding/cpp/detail/msg/msg.h" #include "ten_runtime/msg/cmd/cmd.h" #include "ten_runtime/msg/msg.h" #include "ten_utils/lib/smart_ptr.h" diff --git a/core/include/ten_runtime/binding/cpp/internal/msg/cmd/start_graph.h b/core/include/ten_runtime/binding/cpp/detail/msg/cmd/start_graph.h similarity index 97% rename from core/include/ten_runtime/binding/cpp/internal/msg/cmd/start_graph.h rename to core/include/ten_runtime/binding/cpp/detail/msg/cmd/start_graph.h index 97423e43d..4d9af28be 100644 --- a/core/include/ten_runtime/binding/cpp/internal/msg/cmd/start_graph.h +++ b/core/include/ten_runtime/binding/cpp/detail/msg/cmd/start_graph.h @@ -10,7 +10,7 @@ #include -#include "ten_runtime/binding/cpp/internal/msg/cmd/cmd.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd/cmd.h" #include "ten_runtime/msg/cmd/start_graph/cmd.h" namespace ten { diff --git a/core/include/ten_runtime/binding/cpp/internal/msg/cmd/stop_graph.h b/core/include/ten_runtime/binding/cpp/detail/msg/cmd/stop_graph.h similarity index 95% rename from core/include/ten_runtime/binding/cpp/internal/msg/cmd/stop_graph.h rename to core/include/ten_runtime/binding/cpp/detail/msg/cmd/stop_graph.h index 533657b61..a27c8e2e1 100644 --- a/core/include/ten_runtime/binding/cpp/internal/msg/cmd/stop_graph.h +++ b/core/include/ten_runtime/binding/cpp/detail/msg/cmd/stop_graph.h @@ -10,7 +10,7 @@ #include -#include "ten_runtime/binding/cpp/internal/msg/cmd/cmd.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd/cmd.h" #include "ten_runtime/msg/cmd/stop_graph/cmd.h" #include "ten_utils/lib/smart_ptr.h" diff --git a/core/include/ten_runtime/binding/cpp/internal/msg/cmd_result.h b/core/include/ten_runtime/binding/cpp/detail/msg/cmd_result.h similarity index 97% rename from core/include/ten_runtime/binding/cpp/internal/msg/cmd_result.h rename to core/include/ten_runtime/binding/cpp/detail/msg/cmd_result.h index 02ee4a818..5f7ab79b1 100644 --- a/core/include/ten_runtime/binding/cpp/internal/msg/cmd_result.h +++ b/core/include/ten_runtime/binding/cpp/detail/msg/cmd_result.h @@ -10,7 +10,7 @@ #include -#include "ten_runtime/binding/cpp/internal/msg/msg.h" +#include "ten_runtime/binding/cpp/detail/msg/msg.h" #include "ten_runtime/common/status_code.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_utils/lang/cpp/lib/value.h" diff --git a/core/include/ten_runtime/binding/cpp/internal/msg/data.h b/core/include/ten_runtime/binding/cpp/detail/msg/data.h similarity index 98% rename from core/include/ten_runtime/binding/cpp/internal/msg/data.h rename to core/include/ten_runtime/binding/cpp/detail/msg/data.h index 97b51bb72..04d532c28 100644 --- a/core/include/ten_runtime/binding/cpp/internal/msg/data.h +++ b/core/include/ten_runtime/binding/cpp/detail/msg/data.h @@ -12,7 +12,7 @@ #include #include -#include "ten_runtime/binding/cpp/internal/msg/msg.h" +#include "ten_runtime/binding/cpp/detail/msg/msg.h" #include "ten_runtime/msg/data/data.h" #include "ten_utils/lang/cpp/lib/buf.h" #include "ten_utils/lib/smart_ptr.h" diff --git a/core/include/ten_runtime/binding/cpp/internal/msg/msg.h b/core/include/ten_runtime/binding/cpp/detail/msg/msg.h similarity index 100% rename from core/include/ten_runtime/binding/cpp/internal/msg/msg.h rename to core/include/ten_runtime/binding/cpp/detail/msg/msg.h diff --git a/core/include/ten_runtime/binding/cpp/internal/msg/video_frame.h b/core/include/ten_runtime/binding/cpp/detail/msg/video_frame.h similarity index 98% rename from core/include/ten_runtime/binding/cpp/internal/msg/video_frame.h rename to core/include/ten_runtime/binding/cpp/detail/msg/video_frame.h index 954f7b944..acba01f74 100644 --- a/core/include/ten_runtime/binding/cpp/internal/msg/video_frame.h +++ b/core/include/ten_runtime/binding/cpp/detail/msg/video_frame.h @@ -12,7 +12,7 @@ #include #include -#include "ten_runtime/binding/cpp/internal/msg/msg.h" +#include "ten_runtime/binding/cpp/detail/msg/msg.h" #include "ten_runtime/msg/video_frame/video_frame.h" #include "ten_utils/lib/smart_ptr.h" diff --git a/core/include/ten_runtime/binding/cpp/internal/ten_env.h b/core/include/ten_runtime/binding/cpp/detail/ten_env.h similarity index 99% rename from core/include/ten_runtime/binding/cpp/internal/ten_env.h rename to core/include/ten_runtime/binding/cpp/detail/ten_env.h index e6a6702b8..446d7533f 100644 --- a/core/include/ten_runtime/binding/cpp/internal/ten_env.h +++ b/core/include/ten_runtime/binding/cpp/detail/ten_env.h @@ -10,11 +10,11 @@ #include #include "ten_runtime/binding/common.h" -#include "ten_runtime/binding/cpp/internal/msg/audio_frame.h" -#include "ten_runtime/binding/cpp/internal/msg/cmd/cmd.h" -#include "ten_runtime/binding/cpp/internal/msg/cmd_result.h" -#include "ten_runtime/binding/cpp/internal/msg/data.h" -#include "ten_runtime/binding/cpp/internal/msg/video_frame.h" +#include "ten_runtime/binding/cpp/detail/msg/audio_frame.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd/cmd.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd_result.h" +#include "ten_runtime/binding/cpp/detail/msg/data.h" +#include "ten_runtime/binding/cpp/detail/msg/video_frame.h" #include "ten_runtime/common/errno.h" #include "ten_runtime/msg/cmd_result/cmd_result.h" #include "ten_runtime/ten.h" diff --git a/core/include/ten_runtime/binding/cpp/internal/ten_env_impl.h b/core/include/ten_runtime/binding/cpp/detail/ten_env_impl.h similarity index 87% rename from core/include/ten_runtime/binding/cpp/internal/ten_env_impl.h rename to core/include/ten_runtime/binding/cpp/detail/ten_env_impl.h index 4563932df..af850f111 100644 --- a/core/include/ten_runtime/binding/cpp/internal/ten_env_impl.h +++ b/core/include/ten_runtime/binding/cpp/detail/ten_env_impl.h @@ -8,9 +8,9 @@ #include -#include "ten_runtime/binding/cpp/internal/addon.h" -#include "ten_runtime/binding/cpp/internal/extension.h" -#include "ten_runtime/binding/cpp/internal/ten_env.h" +#include "ten_runtime/binding/cpp/detail/addon.h" +#include "ten_runtime/binding/cpp/detail/extension.h" +#include "ten_runtime/binding/cpp/detail/ten_env.h" #include "ten_utils/lang/cpp/lib/error.h" namespace ten { diff --git a/core/include/ten_runtime/binding/cpp/internal/ten_env_proxy.h b/core/include/ten_runtime/binding/cpp/detail/ten_env_proxy.h similarity index 99% rename from core/include/ten_runtime/binding/cpp/internal/ten_env_proxy.h rename to core/include/ten_runtime/binding/cpp/detail/ten_env_proxy.h index fddf8e30e..26c2111e7 100644 --- a/core/include/ten_runtime/binding/cpp/internal/ten_env_proxy.h +++ b/core/include/ten_runtime/binding/cpp/detail/ten_env_proxy.h @@ -6,7 +6,7 @@ // #pragma once -#include "ten_runtime/binding/cpp/internal/ten_env.h" +#include "ten_runtime/binding/cpp/detail/ten_env.h" #include "ten_runtime/ten_env_proxy/ten_env_proxy.h" using ten_extension_t = struct ten_extension_t; diff --git a/core/include/ten_runtime/binding/cpp/internal/test/env_tester.h b/core/include/ten_runtime/binding/cpp/detail/test/env_tester.h similarity index 95% rename from core/include/ten_runtime/binding/cpp/internal/test/env_tester.h rename to core/include/ten_runtime/binding/cpp/detail/test/env_tester.h index ec9569ea2..a26190306 100644 --- a/core/include/ten_runtime/binding/cpp/internal/test/env_tester.h +++ b/core/include/ten_runtime/binding/cpp/detail/test/env_tester.h @@ -9,11 +9,11 @@ #include #include "ten_runtime/binding/common.h" -#include "ten_runtime/binding/cpp/internal/msg/audio_frame.h" -#include "ten_runtime/binding/cpp/internal/msg/cmd/cmd.h" -#include "ten_runtime/binding/cpp/internal/msg/cmd_result.h" -#include "ten_runtime/binding/cpp/internal/msg/data.h" -#include "ten_runtime/binding/cpp/internal/msg/video_frame.h" +#include "ten_runtime/binding/cpp/detail/msg/audio_frame.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd/cmd.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd_result.h" +#include "ten_runtime/binding/cpp/detail/msg/data.h" +#include "ten_runtime/binding/cpp/detail/msg/video_frame.h" #include "ten_runtime/test/env_tester.h" #include "ten_utils/lang/cpp/lib/error.h" diff --git a/core/include/ten_runtime/binding/cpp/internal/test/env_tester_proxy.h b/core/include/ten_runtime/binding/cpp/detail/test/env_tester_proxy.h similarity index 98% rename from core/include/ten_runtime/binding/cpp/internal/test/env_tester_proxy.h rename to core/include/ten_runtime/binding/cpp/detail/test/env_tester_proxy.h index ab735a066..1a67f6cee 100644 --- a/core/include/ten_runtime/binding/cpp/internal/test/env_tester_proxy.h +++ b/core/include/ten_runtime/binding/cpp/detail/test/env_tester_proxy.h @@ -9,7 +9,7 @@ #include -#include "ten_runtime/binding/cpp/internal/test/env_tester.h" +#include "ten_runtime/binding/cpp/detail/test/env_tester.h" #include "ten_runtime/test/env_tester_proxy.h" using ten_env_tester_t = struct ten_env_tester_t; diff --git a/core/include/ten_runtime/binding/cpp/internal/test/extension_tester.h b/core/include/ten_runtime/binding/cpp/detail/test/extension_tester.h similarity index 96% rename from core/include/ten_runtime/binding/cpp/internal/test/extension_tester.h rename to core/include/ten_runtime/binding/cpp/detail/test/extension_tester.h index 66b03d420..591526cf8 100644 --- a/core/include/ten_runtime/binding/cpp/internal/test/extension_tester.h +++ b/core/include/ten_runtime/binding/cpp/detail/test/extension_tester.h @@ -9,11 +9,11 @@ #include #include "ten_runtime/binding/common.h" -#include "ten_runtime/binding/cpp/internal/msg/audio_frame.h" -#include "ten_runtime/binding/cpp/internal/msg/cmd/cmd.h" -#include "ten_runtime/binding/cpp/internal/msg/data.h" -#include "ten_runtime/binding/cpp/internal/msg/video_frame.h" -#include "ten_runtime/binding/cpp/internal/test/env_tester.h" +#include "ten_runtime/binding/cpp/detail/msg/audio_frame.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd/cmd.h" +#include "ten_runtime/binding/cpp/detail/msg/data.h" +#include "ten_runtime/binding/cpp/detail/msg/video_frame.h" +#include "ten_runtime/binding/cpp/detail/test/env_tester.h" #include "ten_runtime/test/extension_tester.h" #include "ten_utils/macro/check.h" diff --git a/core/include/ten_runtime/binding/cpp/experimental/ten_client_proxy.h b/core/include/ten_runtime/binding/cpp/experimental/ten_client_proxy.h index e720b1108..09ac8903d 100644 --- a/core/include/ten_runtime/binding/cpp/experimental/ten_client_proxy.h +++ b/core/include/ten_runtime/binding/cpp/experimental/ten_client_proxy.h @@ -6,8 +6,8 @@ // #pragma once -#include "ten_runtime/binding/cpp/internal/test/env_tester_proxy.h" -#include "ten_runtime/binding/cpp/internal/test/extension_tester.h" +#include "ten_runtime/binding/cpp/detail/test/env_tester_proxy.h" +#include "ten_runtime/binding/cpp/detail/test/extension_tester.h" #include "ten_utils/log/log.h" namespace ten { diff --git a/core/include/ten_runtime/binding/cpp/ten.h b/core/include/ten_runtime/binding/cpp/ten.h index dfd5b578b..fcb7ef615 100644 --- a/core/include/ten_runtime/binding/cpp/ten.h +++ b/core/include/ten_runtime/binding/cpp/ten.h @@ -11,23 +11,23 @@ #include "ten_runtime/addon/extension/extension.h" // IWYU pragma: export #include "ten_runtime/addon/extension_group/extension_group.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/addon.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/app.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/common.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/extension.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/extension_impl.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/msg/audio_frame.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/msg/cmd/close_app.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/msg/cmd/cmd.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/msg/cmd/start_graph.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/msg/cmd/stop_graph.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/msg/cmd_result.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/msg/data.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/msg/msg.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/msg/video_frame.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/ten_env.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/ten_env_impl.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/ten_env_proxy.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/test/env_tester.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/test/env_tester_proxy.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/test/extension_tester.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/addon.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/app.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/common.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/extension.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/extension_impl.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/msg/audio_frame.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/msg/cmd/close_app.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/msg/cmd/cmd.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/msg/cmd/start_graph.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/msg/cmd/stop_graph.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/msg/cmd_result.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/msg/data.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/msg/msg.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/msg/video_frame.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/ten_env.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/ten_env_impl.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/ten_env_proxy.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/test/env_tester.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/test/env_tester_proxy.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/test/extension_tester.h" // IWYU pragma: export diff --git a/core/include_internal/ten_runtime/binding/cpp/internal/msg/cmd/cmd_result_internal_accessor.h b/core/include_internal/ten_runtime/binding/cpp/internal/msg/cmd/cmd_result_internal_accessor.h index 49aac9959..72c540d20 100644 --- a/core/include_internal/ten_runtime/binding/cpp/internal/msg/cmd/cmd_result_internal_accessor.h +++ b/core/include_internal/ten_runtime/binding/cpp/internal/msg/cmd/cmd_result_internal_accessor.h @@ -6,7 +6,7 @@ // #pragma once -#include "ten_runtime/binding/cpp/internal/msg/cmd_result.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd_result.h" namespace ten { diff --git a/core/include_internal/ten_runtime/binding/cpp/internal/msg/cmd/timeout.h b/core/include_internal/ten_runtime/binding/cpp/internal/msg/cmd/timeout.h index db6a684ca..ad2b5b7e1 100644 --- a/core/include_internal/ten_runtime/binding/cpp/internal/msg/cmd/timeout.h +++ b/core/include_internal/ten_runtime/binding/cpp/internal/msg/cmd/timeout.h @@ -11,7 +11,7 @@ #include #include "include_internal/ten_runtime/msg/cmd_base/cmd/timeout/cmd.h" -#include "ten_runtime/binding/cpp/internal/msg/cmd/cmd.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd/cmd.h" namespace ten { diff --git a/core/include_internal/ten_runtime/binding/cpp/internal/msg/cmd/timer.h b/core/include_internal/ten_runtime/binding/cpp/internal/msg/cmd/timer.h index 48f60ff7c..7112897a1 100644 --- a/core/include_internal/ten_runtime/binding/cpp/internal/msg/cmd/timer.h +++ b/core/include_internal/ten_runtime/binding/cpp/internal/msg/cmd/timer.h @@ -11,7 +11,7 @@ #include #include "include_internal/ten_runtime/msg/cmd_base/cmd/timer/cmd.h" -#include "ten_runtime/binding/cpp/internal/msg/cmd/cmd.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd/cmd.h" namespace ten { diff --git a/core/include_internal/ten_runtime/binding/cpp/internal/ten_env_internal_accessor.h b/core/include_internal/ten_runtime/binding/cpp/internal/ten_env_internal_accessor.h index e2e4eb4d0..0a4048a76 100644 --- a/core/include_internal/ten_runtime/binding/cpp/internal/ten_env_internal_accessor.h +++ b/core/include_internal/ten_runtime/binding/cpp/internal/ten_env_internal_accessor.h @@ -6,7 +6,7 @@ // #pragma once -#include "ten_runtime/binding/cpp/internal/ten_env.h" +#include "ten_runtime/binding/cpp/detail/ten_env.h" namespace ten { diff --git a/core/include_internal/ten_runtime/binding/cpp/ten.h b/core/include_internal/ten_runtime/binding/cpp/ten.h index 35ec44351..cee619908 100644 --- a/core/include_internal/ten_runtime/binding/cpp/ten.h +++ b/core/include_internal/ten_runtime/binding/cpp/ten.h @@ -10,29 +10,29 @@ // include in the C++ programming language. // clang-format off -#include "ten_runtime/binding/cpp/internal/common.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/ten_env.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/ten_env_proxy.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/msg/msg.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/msg/cmd/cmd.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/msg/cmd/start_graph.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/msg/cmd/stop_graph.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/msg/cmd/close_app.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/msg/cmd_result.h" // IWYU pragma: export -#include "include_internal/ten_runtime/binding/cpp/internal/msg/cmd/timeout.h" // IWYU pragma: export -#include "include_internal/ten_runtime/binding/cpp/internal/msg/cmd/timer.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/msg/data.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/msg/video_frame.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/msg/audio_frame.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/test/extension_tester.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/common.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/ten_env.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/ten_env_proxy.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/msg/msg.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/msg/cmd/cmd.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/msg/cmd/start_graph.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/msg/cmd/stop_graph.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/msg/cmd/close_app.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/msg/cmd_result.h" // IWYU pragma: export +#include "include_internal/ten_runtime/binding/cpp/detail/msg/cmd/timeout.h" // IWYU pragma: export +#include "include_internal/ten_runtime/binding/cpp/detail/msg/cmd/timer.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/msg/data.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/msg/video_frame.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/msg/audio_frame.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/test/extension_tester.h" // IWYU pragma: export // 'extension.h' must be in front of 'addon.h' -#include "ten_runtime/binding/cpp/internal/extension.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/extension.h" // IWYU pragma: export // clang-format on -#include "include_internal/ten_runtime/binding/cpp/internal/extension_impl.h" // IWYU pragma: export -#include "include_internal/ten_runtime/binding/cpp/internal/ten_env_impl.h" // IWYU pragma: export -#include "include_internal/ten_runtime/binding/cpp/internal/ten_env_internal_accessor.h" // IWYU pragma: export +#include "include_internal/ten_runtime/binding/cpp/detail/extension_impl.h" // IWYU pragma: export +#include "include_internal/ten_runtime/binding/cpp/detail/ten_env_impl.h" // IWYU pragma: export +#include "include_internal/ten_runtime/binding/cpp/detail/ten_env_internal_accessor.h" // IWYU pragma: export #include "ten_runtime/addon/extension/extension.h" // IWYU pragma: export #include "ten_runtime/addon/extension_group/extension_group.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/addon.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/app.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/internal/ten_env_impl.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/addon.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/app.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/ten_env_impl.h" // IWYU pragma: export diff --git a/packages/core_extensions/py_init_extension_cpp/src/main.cc b/packages/core_extensions/py_init_extension_cpp/src/main.cc index a502cda28..297bfa1fe 100644 --- a/packages/core_extensions/py_init_extension_cpp/src/main.cc +++ b/packages/core_extensions/py_init_extension_cpp/src/main.cc @@ -8,13 +8,13 @@ #include "include_internal/ten_runtime/addon/extension/extension.h" #include "include_internal/ten_runtime/app/metadata.h" -#include "include_internal/ten_runtime/binding/cpp/internal/ten_env_internal_accessor.h" +#include "include_internal/ten_runtime/binding/cpp/detail/ten_env_internal_accessor.h" #include "include_internal/ten_runtime/binding/python/common.h" #include "include_internal/ten_runtime/common/base_dir.h" #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/metadata/manifest.h" #include "include_internal/ten_runtime/ten_env/metadata.h" -#include "ten_runtime/binding/cpp/internal/ten_env.h" +#include "ten_runtime/binding/cpp/detail/ten_env.h" #include "ten_runtime/binding/cpp/ten.h" #include "ten_utils/container/list_str.h" #include "ten_utils/lib/module.h" diff --git a/tests/common/client/cpp/msgpack_tcp.h b/tests/common/client/cpp/msgpack_tcp.h index ff02abe35..910012f55 100644 --- a/tests/common/client/cpp/msgpack_tcp.h +++ b/tests/common/client/cpp/msgpack_tcp.h @@ -11,10 +11,10 @@ #include #include -#include "include_internal/ten_runtime/binding/cpp/internal/msg/cmd/cmd_result_internal_accessor.h" +#include "include_internal/ten_runtime/binding/cpp/detail/msg/cmd/cmd_result_internal_accessor.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" #include "include_internal/ten_utils/log/log.h" -#include "ten_runtime/binding/cpp/internal/msg/cmd_result.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd_result.h" #include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" diff --git a/tests/ten_runtime/integration/cpp/check_start_graph/check_start_graph_source/ten_packages/extension/default_extension_cpp/src/main.cc b/tests/ten_runtime/integration/cpp/check_start_graph/check_start_graph_source/ten_packages/extension/default_extension_cpp/src/main.cc index 5db3e6245..d5dd5742c 100644 --- a/tests/ten_runtime/integration/cpp/check_start_graph/check_start_graph_source/ten_packages/extension/default_extension_cpp/src/main.cc +++ b/tests/ten_runtime/integration/cpp/check_start_graph/check_start_graph_source/ten_packages/extension/default_extension_cpp/src/main.cc @@ -8,9 +8,9 @@ #include #include -#include "ten_runtime/binding/cpp/internal/msg/cmd/close_app.h" -#include "ten_runtime/binding/cpp/internal/msg/cmd/start_graph.h" -#include "ten_runtime/binding/cpp/internal/ten_env.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd/close_app.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd/start_graph.h" +#include "ten_runtime/binding/cpp/detail/ten_env.h" #include "ten_runtime/binding/cpp/ten.h" bool started = false; diff --git a/tests/ten_runtime/integration/cpp/multi_apps/client/client.cc b/tests/ten_runtime/integration/cpp/multi_apps/client/client.cc index de71d0051..0f224d61c 100644 --- a/tests/ten_runtime/integration/cpp/multi_apps/client/client.cc +++ b/tests/ten_runtime/integration/cpp/multi_apps/client/client.cc @@ -6,7 +6,7 @@ // #include -#include "ten_runtime/binding/cpp/internal/msg/cmd/start_graph.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd/start_graph.h" #include "ten_utils/macro/check.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/smoke/audio_frame_test/create_from_json.cc b/tests/ten_runtime/smoke/audio_frame_test/create_from_json.cc index 1582eea2a..fd1bb06b6 100644 --- a/tests/ten_runtime/smoke/audio_frame_test/create_from_json.cc +++ b/tests/ten_runtime/smoke/audio_frame_test/create_from_json.cc @@ -10,7 +10,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_runtime/binding/cpp/internal/msg/audio_frame.h" +#include "ten_runtime/binding/cpp/detail/msg/audio_frame.h" #include "ten_runtime/msg/audio_frame/audio_frame.h" #include "ten_utils/lib/thread.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_5.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_5.cc index 357247058..8a2361045 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_5.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_5.cc @@ -9,7 +9,7 @@ #include #include "gtest/gtest.h" -#include "include_internal/ten_runtime/binding/cpp/internal/ten_env_internal_accessor.h" +#include "include_internal/ten_runtime/binding/cpp/detail/ten_env_internal_accessor.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" #include "ten_utils/lib/thread.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/smoke/cmd_result_test/multiple_result_2.cc b/tests/ten_runtime/smoke/cmd_result_test/multiple_result_2.cc index 959c76cb4..b348eb47f 100644 --- a/tests/ten_runtime/smoke/cmd_result_test/multiple_result_2.cc +++ b/tests/ten_runtime/smoke/cmd_result_test/multiple_result_2.cc @@ -9,7 +9,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_runtime/binding/cpp/internal/ten_env.h" +#include "ten_runtime/binding/cpp/detail/ten_env.h" #include "ten_utils/lib/thread.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" diff --git a/tests/ten_runtime/smoke/cmd_result_test/multiple_result_3.cc b/tests/ten_runtime/smoke/cmd_result_test/multiple_result_3.cc index ce042b83f..a913d7254 100644 --- a/tests/ten_runtime/smoke/cmd_result_test/multiple_result_3.cc +++ b/tests/ten_runtime/smoke/cmd_result_test/multiple_result_3.cc @@ -9,7 +9,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_runtime/binding/cpp/internal/ten_env.h" +#include "ten_runtime/binding/cpp/detail/ten_env.h" #include "ten_utils/lib/thread.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" diff --git a/tests/ten_runtime/smoke/data_test/create_from_json.cc b/tests/ten_runtime/smoke/data_test/create_from_json.cc index 96406e867..34248e078 100644 --- a/tests/ten_runtime/smoke/data_test/create_from_json.cc +++ b/tests/ten_runtime/smoke/data_test/create_from_json.cc @@ -10,7 +10,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_runtime/binding/cpp/internal/msg/data.h" +#include "ten_runtime/binding/cpp/detail/msg/data.h" #include "ten_utils/lib/thread.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" diff --git a/tests/ten_runtime/smoke/extension_test/command/command_stop_graph_actively.cc b/tests/ten_runtime/smoke/extension_test/command/command_stop_graph_actively.cc index a222da22f..c20b0bb37 100644 --- a/tests/ten_runtime/smoke/extension_test/command/command_stop_graph_actively.cc +++ b/tests/ten_runtime/smoke/extension_test/command/command_stop_graph_actively.cc @@ -9,7 +9,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_runtime/binding/cpp/internal/msg/cmd/stop_graph.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd/stop_graph.h" #include "ten_utils/lib/thread.h" #include "ten_utils/lib/time.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/smoke/extension_test/dest/no_audio_frame_dest.cc b/tests/ten_runtime/smoke/extension_test/dest/no_audio_frame_dest.cc index 97a33f85d..12776fc1e 100644 --- a/tests/ten_runtime/smoke/extension_test/dest/no_audio_frame_dest.cc +++ b/tests/ten_runtime/smoke/extension_test/dest/no_audio_frame_dest.cc @@ -10,8 +10,8 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_runtime/binding/cpp/internal/msg/cmd/start_graph.h" -#include "ten_runtime/binding/cpp/internal/ten_env.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd/start_graph.h" +#include "ten_runtime/binding/cpp/detail/ten_env.h" #include "ten_utils/lang/cpp/lib/error.h" #include "ten_utils/lib/thread.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/smoke/extension_test/error/error_client_send_json.cc b/tests/ten_runtime/smoke/extension_test/error/error_client_send_json.cc index 5e080c364..9cadf7cda 100644 --- a/tests/ten_runtime/smoke/extension_test/error/error_client_send_json.cc +++ b/tests/ten_runtime/smoke/extension_test/error/error_client_send_json.cc @@ -8,7 +8,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_runtime/binding/cpp/internal/msg/cmd/start_graph.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd/start_graph.h" #include "ten_runtime/msg/cmd/start_graph/cmd.h" #include "ten_runtime/ten_env/internal/metadata.h" #include "ten_utils/lib/error.h" diff --git a/tests/ten_runtime/smoke/extension_test/error/failed_to_connect_to_remote.cc b/tests/ten_runtime/smoke/extension_test/error/failed_to_connect_to_remote.cc index 6e2237a21..d4fe48815 100644 --- a/tests/ten_runtime/smoke/extension_test/error/failed_to_connect_to_remote.cc +++ b/tests/ten_runtime/smoke/extension_test/error/failed_to_connect_to_remote.cc @@ -6,7 +6,7 @@ // #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_runtime/binding/cpp/internal/msg/cmd/start_graph.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd/start_graph.h" #include "ten_runtime/common/status_code.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle.cc index a66f0a0c4..77bc93bd2 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle.cc @@ -9,7 +9,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_runtime/binding/cpp/internal/ten_env.h" +#include "ten_runtime/binding/cpp/detail/ten_env.h" #include "ten_utils/lib/thread.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle_through_cmd_with_default.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle_through_cmd_with_default.cc index 29777099f..438ad0588 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle_through_cmd_with_default.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle_through_cmd_with_default.cc @@ -10,7 +10,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_runtime/binding/cpp/internal/ten_env.h" +#include "ten_runtime/binding/cpp/detail/ten_env.h" #include "ten_utils/lib/thread.h" #include "ten_utils/log/log.h" #include "tests/common/client/cpp/msgpack_tcp.h" diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_5.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_5.cc index 3aa49e41d..20b3c06cf 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_5.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_5.cc @@ -12,7 +12,7 @@ #include #include "gtest/gtest.h" -#include "include_internal/ten_runtime/binding/cpp/internal/msg/cmd/timer.h" +#include "include_internal/ten_runtime/binding/cpp/detail/msg/cmd/timer.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" #include "ten_runtime/msg/msg.h" #include "ten_utils/lang/cpp/lib/value.h" diff --git a/tests/ten_runtime/smoke/extension_test/start_graph/start_predefined_graph_cross_app.cc b/tests/ten_runtime/smoke/extension_test/start_graph/start_predefined_graph_cross_app.cc index e1564cee6..34924c7e0 100644 --- a/tests/ten_runtime/smoke/extension_test/start_graph/start_predefined_graph_cross_app.cc +++ b/tests/ten_runtime/smoke/extension_test/start_graph/start_predefined_graph_cross_app.cc @@ -6,7 +6,7 @@ // #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_runtime/binding/cpp/internal/msg/cmd/start_graph.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd/start_graph.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" diff --git a/tests/ten_runtime/smoke/extension_test/start_graph/start_two_predefined_graphs.cc b/tests/ten_runtime/smoke/extension_test/start_graph/start_two_predefined_graphs.cc index 4fec9c509..de3091bf3 100644 --- a/tests/ten_runtime/smoke/extension_test/start_graph/start_two_predefined_graphs.cc +++ b/tests/ten_runtime/smoke/extension_test/start_graph/start_two_predefined_graphs.cc @@ -8,7 +8,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_runtime/binding/cpp/internal/msg/cmd/start_graph.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd/start_graph.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" diff --git a/tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h b/tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h index e03d9a861..343a56308 100644 --- a/tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h +++ b/tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h @@ -13,7 +13,7 @@ #include "gtest/gtest.h" #include "nlohmann/json.hpp" -#include "ten_runtime/binding/cpp/internal/msg/cmd_result.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd_result.h" #include "ten_runtime/common/status_code.h" namespace ten_test { diff --git a/tests/ten_runtime/smoke/msg_test/msg_12.cc b/tests/ten_runtime/smoke/msg_test/msg_12.cc index 2bcdd82dd..506cf7785 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_12.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_12.cc @@ -10,7 +10,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_runtime/binding/cpp/internal/msg/cmd/cmd.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd/cmd.h" #include "ten_utils/lib/thread.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" diff --git a/tests/ten_runtime/smoke/msg_test/msg_9.cc b/tests/ten_runtime/smoke/msg_test/msg_9.cc index dcd771b66..9f7977048 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_9.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_9.cc @@ -10,7 +10,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_runtime/binding/cpp/internal/msg/cmd/cmd.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd/cmd.h" #include "ten_utils/lib/thread.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" diff --git a/tests/ten_runtime/smoke/schema_test/schema_on_cmd.cc b/tests/ten_runtime/smoke/schema_test/schema_on_cmd.cc index 6dce4a331..ddcc2022e 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_on_cmd.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_on_cmd.cc @@ -8,7 +8,7 @@ #include #include "gtest/gtest.h" -#include "include_internal/ten_runtime/binding/cpp/internal/ten_env_internal_accessor.h" +#include "include_internal/ten_runtime/binding/cpp/detail/ten_env_internal_accessor.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" #include "ten_runtime/common/status_code.h" #include "ten_utils/lib/thread.h" diff --git a/tests/ten_runtime/smoke/standalone_test/basic.cc b/tests/ten_runtime/smoke/standalone_test/basic.cc index 3f12b0343..71c0d7d15 100644 --- a/tests/ten_runtime/smoke/standalone_test/basic.cc +++ b/tests/ten_runtime/smoke/standalone_test/basic.cc @@ -6,7 +6,7 @@ // #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_runtime/binding/cpp/internal/extension.h" +#include "ten_runtime/binding/cpp/detail/extension.h" #include "ten_runtime/common/status_code.h" #include "ten_utils/lang/cpp/lib/value.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" diff --git a/tests/ten_runtime/smoke/standalone_test/basic_graph.cc b/tests/ten_runtime/smoke/standalone_test/basic_graph.cc index 41deb32d6..96e2e360f 100644 --- a/tests/ten_runtime/smoke/standalone_test/basic_graph.cc +++ b/tests/ten_runtime/smoke/standalone_test/basic_graph.cc @@ -9,9 +9,9 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_runtime/binding/cpp/internal/extension.h" -#include "ten_runtime/binding/cpp/internal/ten_env_proxy.h" -#include "ten_runtime/binding/cpp/internal/test/env_tester.h" +#include "ten_runtime/binding/cpp/detail/extension.h" +#include "ten_runtime/binding/cpp/detail/ten_env_proxy.h" +#include "ten_runtime/binding/cpp/detail/test/env_tester.h" #include "ten_runtime/common/status_code.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/macro/check.h" diff --git a/tests/ten_runtime/smoke/standalone_test/basic_graph_outer_thread_1.cc b/tests/ten_runtime/smoke/standalone_test/basic_graph_outer_thread_1.cc index 71146ccae..b8fa7712b 100644 --- a/tests/ten_runtime/smoke/standalone_test/basic_graph_outer_thread_1.cc +++ b/tests/ten_runtime/smoke/standalone_test/basic_graph_outer_thread_1.cc @@ -10,10 +10,10 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_runtime/binding/cpp/internal/extension.h" -#include "ten_runtime/binding/cpp/internal/ten_env_proxy.h" -#include "ten_runtime/binding/cpp/internal/test/env_tester.h" -#include "ten_runtime/binding/cpp/internal/test/env_tester_proxy.h" +#include "ten_runtime/binding/cpp/detail/extension.h" +#include "ten_runtime/binding/cpp/detail/ten_env_proxy.h" +#include "ten_runtime/binding/cpp/detail/test/env_tester.h" +#include "ten_runtime/binding/cpp/detail/test/env_tester_proxy.h" #include "ten_runtime/common/status_code.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/lib/time.h" diff --git a/tests/ten_runtime/smoke/standalone_test/basic_graph_outer_thread_2.cc b/tests/ten_runtime/smoke/standalone_test/basic_graph_outer_thread_2.cc index acfe510cf..b2bd369d6 100644 --- a/tests/ten_runtime/smoke/standalone_test/basic_graph_outer_thread_2.cc +++ b/tests/ten_runtime/smoke/standalone_test/basic_graph_outer_thread_2.cc @@ -10,10 +10,10 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_runtime/binding/cpp/internal/extension.h" -#include "ten_runtime/binding/cpp/internal/ten_env_proxy.h" -#include "ten_runtime/binding/cpp/internal/test/env_tester.h" -#include "ten_runtime/binding/cpp/internal/test/env_tester_proxy.h" +#include "ten_runtime/binding/cpp/detail/extension.h" +#include "ten_runtime/binding/cpp/detail/ten_env_proxy.h" +#include "ten_runtime/binding/cpp/detail/test/env_tester.h" +#include "ten_runtime/binding/cpp/detail/test/env_tester_proxy.h" #include "ten_runtime/common/status_code.h" #include "ten_utils/lang/cpp/lib/value.h" #include "ten_utils/macro/check.h" diff --git a/tests/ten_runtime/smoke/standalone_test/on_cmd.cc b/tests/ten_runtime/smoke/standalone_test/on_cmd.cc index 69ec6d2ec..f894cd404 100644 --- a/tests/ten_runtime/smoke/standalone_test/on_cmd.cc +++ b/tests/ten_runtime/smoke/standalone_test/on_cmd.cc @@ -6,7 +6,7 @@ // #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_runtime/binding/cpp/internal/extension.h" +#include "ten_runtime/binding/cpp/detail/extension.h" #include "ten_runtime/common/status_code.h" #include "ten_utils/lang/cpp/lib/value.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" diff --git a/tests/ten_runtime/smoke/ten_env_call_timing/on_xxx_done.cc b/tests/ten_runtime/smoke/ten_env_call_timing/on_xxx_done.cc index e81943825..7e27f83cd 100644 --- a/tests/ten_runtime/smoke/ten_env_call_timing/on_xxx_done.cc +++ b/tests/ten_runtime/smoke/ten_env_call_timing/on_xxx_done.cc @@ -9,7 +9,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_runtime/binding/cpp/internal/ten_env.h" +#include "ten_runtime/binding/cpp/detail/ten_env.h" #include "ten_utils/lib/thread.h" #include "tests/common/client/cpp/msgpack_tcp.h" #include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" diff --git a/tests/ten_runtime/smoke/video_frame_test/create_from_json.cc b/tests/ten_runtime/smoke/video_frame_test/create_from_json.cc index 03fa2694c..50e062732 100644 --- a/tests/ten_runtime/smoke/video_frame_test/create_from_json.cc +++ b/tests/ten_runtime/smoke/video_frame_test/create_from_json.cc @@ -10,7 +10,7 @@ #include "gtest/gtest.h" #include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_runtime/binding/cpp/internal/msg/video_frame.h" +#include "ten_runtime/binding/cpp/detail/msg/video_frame.h" #include "ten_runtime/msg/video_frame/video_frame.h" #include "ten_utils/lib/thread.h" #include "tests/common/client/cpp/msgpack_tcp.h" From f617f69165a94d8b1158fa809a45d16cdb9b21ec Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 26 Nov 2024 10:43:44 +0800 Subject: [PATCH 03/26] feat: add c++ ten_env_tester_proxy.h to unified c++ intf file --- .../cpp/{internal => detail}/extension_impl.h | 0 .../msg/cmd/cmd_result_internal_accessor.h | 0 .../{internal => detail}/msg/cmd/timeout.h | 0 .../cpp/{internal => detail}/msg/cmd/timer.h | 0 .../cpp/{internal => detail}/ten_env_impl.h | 0 .../ten_env_internal_accessor.h | 0 .../ten_runtime/binding/cpp/ten.h | 41 +++++++++---------- 7 files changed, 20 insertions(+), 21 deletions(-) rename core/include_internal/ten_runtime/binding/cpp/{internal => detail}/extension_impl.h (100%) rename core/include_internal/ten_runtime/binding/cpp/{internal => detail}/msg/cmd/cmd_result_internal_accessor.h (100%) rename core/include_internal/ten_runtime/binding/cpp/{internal => detail}/msg/cmd/timeout.h (100%) rename core/include_internal/ten_runtime/binding/cpp/{internal => detail}/msg/cmd/timer.h (100%) rename core/include_internal/ten_runtime/binding/cpp/{internal => detail}/ten_env_impl.h (100%) rename core/include_internal/ten_runtime/binding/cpp/{internal => detail}/ten_env_internal_accessor.h (100%) diff --git a/core/include_internal/ten_runtime/binding/cpp/internal/extension_impl.h b/core/include_internal/ten_runtime/binding/cpp/detail/extension_impl.h similarity index 100% rename from core/include_internal/ten_runtime/binding/cpp/internal/extension_impl.h rename to core/include_internal/ten_runtime/binding/cpp/detail/extension_impl.h diff --git a/core/include_internal/ten_runtime/binding/cpp/internal/msg/cmd/cmd_result_internal_accessor.h b/core/include_internal/ten_runtime/binding/cpp/detail/msg/cmd/cmd_result_internal_accessor.h similarity index 100% rename from core/include_internal/ten_runtime/binding/cpp/internal/msg/cmd/cmd_result_internal_accessor.h rename to core/include_internal/ten_runtime/binding/cpp/detail/msg/cmd/cmd_result_internal_accessor.h diff --git a/core/include_internal/ten_runtime/binding/cpp/internal/msg/cmd/timeout.h b/core/include_internal/ten_runtime/binding/cpp/detail/msg/cmd/timeout.h similarity index 100% rename from core/include_internal/ten_runtime/binding/cpp/internal/msg/cmd/timeout.h rename to core/include_internal/ten_runtime/binding/cpp/detail/msg/cmd/timeout.h diff --git a/core/include_internal/ten_runtime/binding/cpp/internal/msg/cmd/timer.h b/core/include_internal/ten_runtime/binding/cpp/detail/msg/cmd/timer.h similarity index 100% rename from core/include_internal/ten_runtime/binding/cpp/internal/msg/cmd/timer.h rename to core/include_internal/ten_runtime/binding/cpp/detail/msg/cmd/timer.h diff --git a/core/include_internal/ten_runtime/binding/cpp/internal/ten_env_impl.h b/core/include_internal/ten_runtime/binding/cpp/detail/ten_env_impl.h similarity index 100% rename from core/include_internal/ten_runtime/binding/cpp/internal/ten_env_impl.h rename to core/include_internal/ten_runtime/binding/cpp/detail/ten_env_impl.h diff --git a/core/include_internal/ten_runtime/binding/cpp/internal/ten_env_internal_accessor.h b/core/include_internal/ten_runtime/binding/cpp/detail/ten_env_internal_accessor.h similarity index 100% rename from core/include_internal/ten_runtime/binding/cpp/internal/ten_env_internal_accessor.h rename to core/include_internal/ten_runtime/binding/cpp/detail/ten_env_internal_accessor.h diff --git a/core/include_internal/ten_runtime/binding/cpp/ten.h b/core/include_internal/ten_runtime/binding/cpp/ten.h index cee619908..87e277df2 100644 --- a/core/include_internal/ten_runtime/binding/cpp/ten.h +++ b/core/include_internal/ten_runtime/binding/cpp/ten.h @@ -9,30 +9,29 @@ // This header file should be the only header file where outside world should // include in the C++ programming language. -// clang-format off -#include "ten_runtime/binding/cpp/detail/common.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/detail/ten_env.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/detail/ten_env_proxy.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/detail/msg/msg.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/detail/msg/cmd/cmd.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/detail/msg/cmd/start_graph.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/detail/msg/cmd/stop_graph.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/detail/msg/cmd/close_app.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/detail/msg/cmd_result.h" // IWYU pragma: export -#include "include_internal/ten_runtime/binding/cpp/detail/msg/cmd/timeout.h" // IWYU pragma: export -#include "include_internal/ten_runtime/binding/cpp/detail/msg/cmd/timer.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/detail/msg/data.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/detail/msg/video_frame.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/detail/msg/audio_frame.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/detail/test/extension_tester.h" // IWYU pragma: export -// 'extension.h' must be in front of 'addon.h' -#include "ten_runtime/binding/cpp/detail/extension.h" // IWYU pragma: export -// clang-format on #include "include_internal/ten_runtime/binding/cpp/detail/extension_impl.h" // IWYU pragma: export +#include "include_internal/ten_runtime/binding/cpp/detail/msg/cmd/timeout.h" // IWYU pragma: export +#include "include_internal/ten_runtime/binding/cpp/detail/msg/cmd/timer.h" // IWYU pragma: export #include "include_internal/ten_runtime/binding/cpp/detail/ten_env_impl.h" // IWYU pragma: export #include "include_internal/ten_runtime/binding/cpp/detail/ten_env_internal_accessor.h" // IWYU pragma: export #include "ten_runtime/addon/extension/extension.h" // IWYU pragma: export #include "ten_runtime/addon/extension_group/extension_group.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/detail/addon.h" // IWYU pragma: export -#include "ten_runtime/binding/cpp/detail/app.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/addon.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/app.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/common.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/extension.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/msg/audio_frame.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/msg/cmd/close_app.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/msg/cmd/cmd.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/msg/cmd/start_graph.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/msg/cmd/stop_graph.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/msg/cmd_result.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/msg/data.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/msg/msg.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/msg/video_frame.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/ten_env.h" // IWYU pragma: export #include "ten_runtime/binding/cpp/detail/ten_env_impl.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/ten_env_proxy.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/test/env_tester.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/test/env_tester_proxy.h" // IWYU pragma: export +#include "ten_runtime/binding/cpp/detail/test/extension_tester.h" // IWYU pragma: export From 13ac156811c240c86a1f69b818e7afcb70cafbde Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 26 Nov 2024 10:49:46 +0800 Subject: [PATCH 04/26] feat: add c++ ten_env_tester_proxy.h to unified c++ intf file --- .../ten_runtime/binding/cpp/detail/extension_impl.h | 10 +++++++--- .../ten_runtime/binding/cpp/detail/ten_env_impl.h | 4 +--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/core/include_internal/ten_runtime/binding/cpp/detail/extension_impl.h b/core/include_internal/ten_runtime/binding/cpp/detail/extension_impl.h index 5b7e7456c..d4164166a 100644 --- a/core/include_internal/ten_runtime/binding/cpp/detail/extension_impl.h +++ b/core/include_internal/ten_runtime/binding/cpp/detail/extension_impl.h @@ -9,9 +9,13 @@ #include #include #include -#include -#include -#include + +#include "include_internal/ten_runtime/binding/cpp/detail/msg/cmd/timeout.h" +#include "include_internal/ten_runtime/binding/cpp/detail/msg/cmd/timer.h" +#include "ten_runtime/binding/cpp/detail/extension.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd/close_app.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd/start_graph.h" +#include "ten_runtime/binding/cpp/detail/msg/cmd/stop_graph.h" namespace ten { diff --git a/core/include_internal/ten_runtime/binding/cpp/detail/ten_env_impl.h b/core/include_internal/ten_runtime/binding/cpp/detail/ten_env_impl.h index b106e065d..0b778639e 100644 --- a/core/include_internal/ten_runtime/binding/cpp/detail/ten_env_impl.h +++ b/core/include_internal/ten_runtime/binding/cpp/detail/ten_env_impl.h @@ -6,10 +6,8 @@ // #pragma once -#include - -#include "include_internal/ten_runtime/binding/cpp/ten.h" #include "include_internal/ten_runtime/ten_env/metadata.h" +#include "ten_runtime/binding/cpp/detail/ten_env.h" namespace ten { From 0615416f661e8fff33c606b2addf1776ee6dff1a Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 26 Nov 2024 14:25:29 +0800 Subject: [PATCH 05/26] feat: add c++ ten_env_tester_proxy.h to unified c++ intf file --- .github/workflows/build_linux_ubuntu1804.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/build_linux_ubuntu1804.yml b/.github/workflows/build_linux_ubuntu1804.yml index ec3c678e4..34e9624ac 100644 --- a/.github/workflows/build_linux_ubuntu1804.yml +++ b/.github/workflows/build_linux_ubuntu1804.yml @@ -28,6 +28,15 @@ jobs: container: image: ghcr.io/ten-framework/ten_building_ubuntu1804 steps: + - name: Run on old node + run: | + apt update && apt -y install wget + touch "$HOME/.bashrc" + wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash + export NVM_DIR="$HOME/.nvm" + [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" + nvm install 16 + - uses: actions/checkout@v3 with: fetch-depth: "0" From 103866ad4842b3676c9793306073360620319858 Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 26 Nov 2024 14:27:53 +0800 Subject: [PATCH 06/26] feat: add c++ ten_env_tester_proxy.h to unified c++ intf file --- .github/workflows/build_linux_ubuntu1804.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build_linux_ubuntu1804.yml b/.github/workflows/build_linux_ubuntu1804.yml index 34e9624ac..b379c5a2c 100644 --- a/.github/workflows/build_linux_ubuntu1804.yml +++ b/.github/workflows/build_linux_ubuntu1804.yml @@ -20,8 +20,6 @@ jobs: group: build-linux-ubuntu1804-${{ github.head_ref }}-${{ matrix.build_type }} cancel-in-progress: true runs-on: ubuntu-22.04 - env: - ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true strategy: matrix: build_type: [release] From 05161f17039a905005f3fcc0273b002f962cdeb4 Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 26 Nov 2024 15:08:27 +0800 Subject: [PATCH 07/26] feat: add c++ ten_env_tester_proxy.h to unified c++ intf file --- .github/workflows/build_linux_ubuntu1804.yml | 45 ++++++++++++++------ 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build_linux_ubuntu1804.yml b/.github/workflows/build_linux_ubuntu1804.yml index b379c5a2c..a9100fabc 100644 --- a/.github/workflows/build_linux_ubuntu1804.yml +++ b/.github/workflows/build_linux_ubuntu1804.yml @@ -15,30 +15,47 @@ on: - "**.md" jobs: - build-linux-ubuntu1804: + checkout-code: + name: Checkout Code on Ubuntu 22.04 + runs-on: ubuntu-latest + container: + image: ubuntu:22.04 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: "0" + submodules: "true" + + - name: Upload code as artifact + uses: actions/upload-artifact@v3 + with: + name: repo-code + path: . + + build-and-test: + name: Build and Test on Ubuntu 18.04 + needs: checkout-code concurrency: group: build-linux-ubuntu1804-${{ github.head_ref }}-${{ matrix.build_type }} cancel-in-progress: true - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest strategy: matrix: build_type: [release] container: image: ghcr.io/ten-framework/ten_building_ubuntu1804 steps: - - name: Run on old node - run: | - apt update && apt -y install wget - touch "$HOME/.bashrc" - wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash - export NVM_DIR="$HOME/.nvm" - [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" - nvm install 16 - - - uses: actions/checkout@v3 + - name: Download code artifact + uses: actions/download-artifact@v3 with: - fetch-depth: "0" - submodules: "true" + name: repo-code + path: ./repo + + - name: Move to repository directory + run: | + mv ./repo/* ./ + rm -rf ./repo - name: Update version run: | From 19d3b11619e74fc29e7058150834bdc1aecd10dc Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 26 Nov 2024 15:10:20 +0800 Subject: [PATCH 08/26] feat: add c++ ten_env_tester_proxy.h to unified c++ intf file --- .github/workflows/build_linux_ubuntu1804.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_linux_ubuntu1804.yml b/.github/workflows/build_linux_ubuntu1804.yml index a9100fabc..2becfe808 100644 --- a/.github/workflows/build_linux_ubuntu1804.yml +++ b/.github/workflows/build_linux_ubuntu1804.yml @@ -19,7 +19,7 @@ jobs: name: Checkout Code on Ubuntu 22.04 runs-on: ubuntu-latest container: - image: ubuntu:22.04 + image: ghcr.io/ten-framework/ten_building_ubuntu2204 steps: - name: Checkout repository uses: actions/checkout@v4 From 11e39e984298ea0d7307d09f28a40deef3a297cc Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 26 Nov 2024 15:27:38 +0800 Subject: [PATCH 09/26] feat: add c++ ten_env_tester_proxy.h to unified c++ intf file --- .github/workflows/build_linux_ubuntu1804.yml | 45 +++++++------------- 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/.github/workflows/build_linux_ubuntu1804.yml b/.github/workflows/build_linux_ubuntu1804.yml index 2becfe808..7aaf246cc 100644 --- a/.github/workflows/build_linux_ubuntu1804.yml +++ b/.github/workflows/build_linux_ubuntu1804.yml @@ -15,47 +15,32 @@ on: - "**.md" jobs: - checkout-code: - name: Checkout Code on Ubuntu 22.04 - runs-on: ubuntu-latest - container: - image: ghcr.io/ten-framework/ten_building_ubuntu2204 - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: "0" - submodules: "true" - - - name: Upload code as artifact - uses: actions/upload-artifact@v3 - with: - name: repo-code - path: . - - build-and-test: - name: Build and Test on Ubuntu 18.04 - needs: checkout-code + build-linux-ubuntu1804: concurrency: group: build-linux-ubuntu1804-${{ github.head_ref }}-${{ matrix.build_type }} cancel-in-progress: true - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: matrix: build_type: [release] container: image: ghcr.io/ten-framework/ten_building_ubuntu1804 steps: - - name: Download code artifact - uses: actions/download-artifact@v3 - with: - name: repo-code - path: ./repo + - name: Configure Git + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + + - name: Manual Checkout Repository + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + git clone --depth=1 https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git . + git checkout ${{ github.sha }} - - name: Move to repository directory + - name: Initialize and Update Submodules run: | - mv ./repo/* ./ - rm -rf ./repo + git submodule update --init --recursive - name: Update version run: | From 29a3529d9b2b80f4b8e685eb2464714cdaed6341 Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 26 Nov 2024 15:30:05 +0800 Subject: [PATCH 10/26] feat: add c++ ten_env_tester_proxy.h to unified c++ intf file --- .github/workflows/build_linux_ubuntu1804.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_linux_ubuntu1804.yml b/.github/workflows/build_linux_ubuntu1804.yml index 7aaf246cc..9b7399da6 100644 --- a/.github/workflows/build_linux_ubuntu1804.yml +++ b/.github/workflows/build_linux_ubuntu1804.yml @@ -35,6 +35,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | + git config --global --add safe.directory /__w/ten_framework/ten_framework git clone --depth=1 https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git . git checkout ${{ github.sha }} From 76e52e2e8fc581bbdf7a4df073aec0eb004040b7 Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 26 Nov 2024 15:30:29 +0800 Subject: [PATCH 11/26] feat: add c++ ten_env_tester_proxy.h to unified c++ intf file --- .github/workflows/build_linux_ubuntu1804.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_linux_ubuntu1804.yml b/.github/workflows/build_linux_ubuntu1804.yml index 9b7399da6..afa54579f 100644 --- a/.github/workflows/build_linux_ubuntu1804.yml +++ b/.github/workflows/build_linux_ubuntu1804.yml @@ -36,7 +36,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | git config --global --add safe.directory /__w/ten_framework/ten_framework - git clone --depth=1 https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git . + git clone --depth=0 https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git . git checkout ${{ github.sha }} - name: Initialize and Update Submodules From 52a7fdc06593440a7d309e168ba0d854ea22363e Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 26 Nov 2024 15:32:53 +0800 Subject: [PATCH 12/26] feat: add c++ ten_env_tester_proxy.h to unified c++ intf file --- .github/workflows/build_linux_ubuntu1804.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_linux_ubuntu1804.yml b/.github/workflows/build_linux_ubuntu1804.yml index afa54579f..9b7399da6 100644 --- a/.github/workflows/build_linux_ubuntu1804.yml +++ b/.github/workflows/build_linux_ubuntu1804.yml @@ -36,7 +36,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | git config --global --add safe.directory /__w/ten_framework/ten_framework - git clone --depth=0 https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git . + git clone --depth=1 https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git . git checkout ${{ github.sha }} - name: Initialize and Update Submodules From 41b32590360d60310eb86697069371c6424b320d Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 26 Nov 2024 15:37:09 +0800 Subject: [PATCH 13/26] feat: add c++ ten_env_tester_proxy.h to unified c++ intf file --- .github/workflows/build_linux_ubuntu1804.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build_linux_ubuntu1804.yml b/.github/workflows/build_linux_ubuntu1804.yml index 9b7399da6..e61fb2d6e 100644 --- a/.github/workflows/build_linux_ubuntu1804.yml +++ b/.github/workflows/build_linux_ubuntu1804.yml @@ -36,11 +36,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | git config --global --add safe.directory /__w/ten_framework/ten_framework - git clone --depth=1 https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git . + git clone https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git . git checkout ${{ github.sha }} - - - name: Initialize and Update Submodules - run: | git submodule update --init --recursive - name: Update version From 0ddef9795a7dd5152ce461e1f9ab45e3ea814083 Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 26 Nov 2024 15:39:39 +0800 Subject: [PATCH 14/26] feat: add c++ ten_env_tester_proxy.h to unified c++ intf file --- .github/workflows/build_linux_ubuntu1804.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build_linux_ubuntu1804.yml b/.github/workflows/build_linux_ubuntu1804.yml index e61fb2d6e..6700728ef 100644 --- a/.github/workflows/build_linux_ubuntu1804.yml +++ b/.github/workflows/build_linux_ubuntu1804.yml @@ -35,7 +35,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - git config --global --add safe.directory /__w/ten_framework/ten_framework git clone https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git . git checkout ${{ github.sha }} git submodule update --init --recursive From d1ed84b44ac1592add3ff9c19f51e267a18519f7 Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 26 Nov 2024 15:44:01 +0800 Subject: [PATCH 15/26] feat: add c++ ten_env_tester_proxy.h to unified c++ intf file --- .github/workflows/build_linux_ubuntu1804.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_linux_ubuntu1804.yml b/.github/workflows/build_linux_ubuntu1804.yml index 6700728ef..a03522581 100644 --- a/.github/workflows/build_linux_ubuntu1804.yml +++ b/.github/workflows/build_linux_ubuntu1804.yml @@ -35,6 +35,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | + git config --global --add safe.directory $(pwd) git clone https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git . git checkout ${{ github.sha }} git submodule update --init --recursive From 89a7374458db8810cd6be5b4cf920308c0780c33 Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 26 Nov 2024 15:49:55 +0800 Subject: [PATCH 16/26] feat: add c++ ten_env_tester_proxy.h to unified c++ intf file --- .github/workflows/build_linux_ubuntu1804.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_linux_ubuntu1804.yml b/.github/workflows/build_linux_ubuntu1804.yml index a03522581..8b0ed8961 100644 --- a/.github/workflows/build_linux_ubuntu1804.yml +++ b/.github/workflows/build_linux_ubuntu1804.yml @@ -36,7 +36,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | git config --global --add safe.directory $(pwd) - git clone https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git . + git clone --no-single-branch https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git . + git fetch --unshallow git checkout ${{ github.sha }} git submodule update --init --recursive From 19eaf41313f6cd2882406501962afb3977172b08 Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 26 Nov 2024 15:52:21 +0800 Subject: [PATCH 17/26] feat: add c++ ten_env_tester_proxy.h to unified c++ intf file --- .github/workflows/build_linux_ubuntu1804.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_linux_ubuntu1804.yml b/.github/workflows/build_linux_ubuntu1804.yml index 8b0ed8961..112b1699f 100644 --- a/.github/workflows/build_linux_ubuntu1804.yml +++ b/.github/workflows/build_linux_ubuntu1804.yml @@ -37,7 +37,18 @@ jobs: run: | git config --global --add safe.directory $(pwd) git clone --no-single-branch https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git . - git fetch --unshallow + + - name: Debugging Information + run: | + echo "Current Directory: $(pwd)" + ls -la + git status + git log -5 + + - name: Manual Checkout Repository + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | git checkout ${{ github.sha }} git submodule update --init --recursive From 50eb710e82a3a2fa14b86261c5a2751757194192 Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 26 Nov 2024 16:01:53 +0800 Subject: [PATCH 18/26] feat: add c++ ten_env_tester_proxy.h to unified c++ intf file --- .github/workflows/build_linux_ubuntu1804.yml | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build_linux_ubuntu1804.yml b/.github/workflows/build_linux_ubuntu1804.yml index 112b1699f..1548a30ea 100644 --- a/.github/workflows/build_linux_ubuntu1804.yml +++ b/.github/workflows/build_linux_ubuntu1804.yml @@ -36,20 +36,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | git config --global --add safe.directory $(pwd) - git clone --no-single-branch https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git . - - - name: Debugging Information - run: | - echo "Current Directory: $(pwd)" - ls -la - git status - git log -5 - - - name: Manual Checkout Repository - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - git checkout ${{ github.sha }} + git clone https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git . + git checkout ${{ github.event.pull_request.head.sha }} git submodule update --init --recursive - name: Update version From 3a9d4b89e1f2b47e89efe9eac182e3a516d6e0cf Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 26 Nov 2024 16:04:08 +0800 Subject: [PATCH 19/26] feat: add c++ ten_env_tester_proxy.h to unified c++ intf file --- .github/workflows/build_linux_ubuntu1804.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/build_linux_ubuntu1804.yml b/.github/workflows/build_linux_ubuntu1804.yml index 1548a30ea..80188bd4e 100644 --- a/.github/workflows/build_linux_ubuntu1804.yml +++ b/.github/workflows/build_linux_ubuntu1804.yml @@ -46,11 +46,6 @@ jobs: python3 tools/version/update_version_in_ten_framework.py python3 tools/version/check_version_in_ten_framework.py - - name: Install cpulimit and taskset - run: | - apt-get update - apt-get install -y cpulimit util-linux - - name: Build run: | export PATH=$(pwd)/core/ten_gn/:$PATH From 13d8aa1e258eac6ddfa8db8f019ae98b66b0b6b0 Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 26 Nov 2024 17:02:48 +0800 Subject: [PATCH 20/26] feat: add c++ ten_env_tester_proxy.h to unified c++ intf file --- .github/workflows/build_linux_ubuntu1804.yml | 47 ++++++++++++++----- core/include/ten_utils/macro/check.h | 48 ++++++++++---------- core/src/ten_utils/lib/sys/posix/shm.c | 4 +- core/src/ten_utils/log/output.c | 18 +++++++- 4 files changed, 78 insertions(+), 39 deletions(-) diff --git a/.github/workflows/build_linux_ubuntu1804.yml b/.github/workflows/build_linux_ubuntu1804.yml index 80188bd4e..15d9ece21 100644 --- a/.github/workflows/build_linux_ubuntu1804.yml +++ b/.github/workflows/build_linux_ubuntu1804.yml @@ -101,20 +101,43 @@ jobs: ./unit_test || { echo "ten_rust unit test failed"; exit 1; } ./integration_test || { echo "ten_rust integration test failed"; exit 1; } - - name: Upload ten_packages - uses: actions/upload-artifact@v3 - with: - name: ten_packages-linux-ubuntu1804-x64-gcc-${{ matrix.build_type }} - path: | - out/linux/x64/ten_packages/system/ten_runtime - out/linux/x64/ten_packages/system/ten_runtime_go - out/linux/x64/ten_packages/system/ten_runtime_python - out/linux/x64/ten_packages/extension/default_extension_cpp - out/linux/x64/ten_packages/extension/default_extension_go - out/linux/x64/ten_packages/extension/default_extension_python - out/linux/x64/ten_packages/extension/default_async_extension_python + - name: Compress ten_packages + run: | + zip -r artifact.zip \ + out/linux/x64/ten_packages/system/ten_runtime \ + out/linux/x64/ten_packages/system/ten_runtime_go \ + out/linux/x64/ten_packages/system/ten_runtime_python \ + out/linux/x64/ten_packages/extension/default_extension_cpp \ + out/linux/x64/ten_packages/extension/default_extension_go \ + out/linux/x64/ten_packages/extension/default_extension_python \ + out/linux/x64/ten_packages/extension/default_async_extension_python \ out/linux/x64/ten_packages/extension/py_init_extension_cpp + - name: Upload Artifact via API + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ARTIFACT_NAME: ten_packages-linux-ubuntu1804-x64-gcc-${{ matrix.build_type }} + run: | + response=$(curl -s -X POST \ + -H "Authorization: Bearer $GITHUB_TOKEN" \ + -H "Accept: application/vnd.github+json" \ + https://api.github.com/repos/${{ github.repository }}/actions/artifacts \ + -d "{\"name\":\"$ARTIFACT_NAME\",\"expire_in\":\"1 week\"}") + + artifact_id=$(echo "$response" | jq .id) + upload_url=$(echo "$response" | jq -r .archive_download_url) + + echo "Artifact ID: $artifact_id" + echo "Upload URL: $upload_url" + + curl -s -X POST \ + -H "Authorization: Bearer $GITHUB_TOKEN" \ + -H "Content-Type: application/zip" \ + --data-binary @artifact.zip \ + "$upload_url" + + echo "Artifact uploaded successfully." + - name: Package assets if: startsWith(github.ref, 'refs/tags/') run: | diff --git a/core/include/ten_utils/macro/check.h b/core/include/ten_utils/macro/check.h index db069a2de..39e2fc75e 100644 --- a/core/include/ten_utils/macro/check.h +++ b/core/include/ten_utils/macro/check.h @@ -40,36 +40,36 @@ #ifndef NDEBUG -#define TEN_ASSERT(expr, fmt, ...) \ - do { \ - /* NOLINTNEXTLINE */ \ - if (!(expr)) { \ - /* NOLINTNEXTLINE */ \ - char err_msg[ASSERT_ERR_MSG_MAX_LENGTH]; \ - (void)snprintf(err_msg, ASSERT_ERR_MSG_MAX_LENGTH, fmt, ##__VA_ARGS__); \ - (void)fprintf(stderr, "%s\n", err_msg); \ - ten_backtrace_dump_global(0); \ - /* NOLINTNEXTLINE */ \ - assert(0); \ - } \ +#define TEN_ASSERT(expr, fmt, ...) \ + do { \ + /* NOLINTNEXTLINE */ \ + if (!(expr)) { \ + /* NOLINTNEXTLINE */ \ + char ____err_msg[ASSERT_ERR_MSG_MAX_LENGTH]; \ + (void)snprintf(____err_msg, sizeof(____err_msg), fmt, ##__VA_ARGS__); \ + (void)fprintf(stderr, "%s\n", ____err_msg); \ + ten_backtrace_dump_global(0); \ + /* NOLINTNEXTLINE */ \ + assert(0); \ + } \ } while (0) #else // NDEBUG // Enable minimal protection if the optimization is enabled. -#define TEN_ASSERT(expr, fmt, ...) \ - do { \ - /* NOLINTNEXTLINE */ \ - if (!(expr)) { \ - /* NOLINTNEXTLINE */ \ - char err_msg[ASSERT_ERR_MSG_MAX_LENGTH]; \ - (void)snprintf(err_msg, ASSERT_ERR_MSG_MAX_LENGTH, fmt, ##__VA_ARGS__); \ - (void)fprintf(stderr, "%s\n", err_msg); \ - ten_backtrace_dump_global(0); \ - /* NOLINTNEXTLINE */ \ - abort(); \ - } \ +#define TEN_ASSERT(expr, fmt, ...) \ + do { \ + /* NOLINTNEXTLINE */ \ + if (!(expr)) { \ + /* NOLINTNEXTLINE */ \ + char ____err_msg[ASSERT_ERR_MSG_MAX_LENGTH]; \ + (void)snprintf(____err_msg, sizeof(____err_msg), fmt, ##__VA_ARGS__); \ + (void)fprintf(stderr, "%s\n", ____err_msg); \ + ten_backtrace_dump_global(0); \ + /* NOLINTNEXTLINE */ \ + abort(); \ + } \ } while (0) #endif // NDEBUG diff --git a/core/src/ten_utils/lib/sys/posix/shm.c b/core/src/ten_utils/lib/sys/posix/shm.c index dfd9c93df..a4a81e4b9 100644 --- a/core/src/ten_utils/lib/sys/posix/shm.c +++ b/core/src/ten_utils/lib/sys/posix/shm.c @@ -15,6 +15,7 @@ #include #include "ten_utils/lib/atomic.h" +#include "ten_utils/macro/check.h" static char *__make_abs_path(const char *name) { char *abs_path = NULL; @@ -67,7 +68,8 @@ void *ten_shm_map(const char *name, size_t size) { // this is to avoid truncate an existing shm file fd = shm_open(abs_path, O_RDWR, S_IRUSR | S_IWUSR); } else { - ftruncate(fd, size + sizeof(ten_atomic_t)); + int rc = ftruncate(fd, size + sizeof(ten_atomic_t)); + TEN_ASSERT(!rc, "Should not happen."); } if (fd < 0) { diff --git a/core/src/ten_utils/log/output.c b/core/src/ten_utils/log/output.c index 242ca099d..c10189e7f 100644 --- a/core/src/ten_utils/log/output.c +++ b/core/src/ten_utils/log/output.c @@ -192,7 +192,14 @@ void ten_log_output_to_file_cb(ten_string_t *msg, void *user_data) { // TODO(Wei): write() is atomic for buffers less than or equal to PIPE_BUF, // therefore we need to have some locking mechanism here to prevent log // interleaved. - write(fd, ten_string_get_raw_str(msg), ten_string_len(msg)); + ssize_t bytes_written = + write(fd, ten_string_get_raw_str(msg), ten_string_len(msg)); + if (bytes_written == -1) { + perror("write failed"); + } else if ((size_t)bytes_written < ten_string_len(msg)) { + (void)fprintf(stderr, "Partial write: only %zd of %zu bytes written\n", + bytes_written, ten_string_len(msg)); + } #endif } @@ -229,7 +236,14 @@ void ten_log_output_to_stderr_cb(ten_string_t *msg, void *user_data) { // TODO(Wei): write() is atomic for buffers less than or equal to PIPE_BUF, // therefore we need to have some locking mechanism here to prevent log // interleaved. - write(STDERR_FILENO, ten_string_get_raw_str(msg), ten_string_len(msg)); + ssize_t bytes_written = + write(STDERR_FILENO, ten_string_get_raw_str(msg), ten_string_len(msg)); + if (bytes_written == -1) { + perror("write failed"); + } else if ((size_t)bytes_written < ten_string_len(msg)) { + (void)fprintf(stderr, "Partial write: only %zd of %zu bytes written\n", + bytes_written, ten_string_len(msg)); + } #endif } From fd25f6e28b783180da41da35af8a733886cc89a7 Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 26 Nov 2024 17:05:08 +0800 Subject: [PATCH 21/26] feat: add c++ ten_env_tester_proxy.h to unified c++ intf file --- .github/workflows/build_linux_ubuntu1804.yml | 37 +++++++++++++++++--- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_linux_ubuntu1804.yml b/.github/workflows/build_linux_ubuntu1804.yml index 15d9ece21..68453a56d 100644 --- a/.github/workflows/build_linux_ubuntu1804.yml +++ b/.github/workflows/build_linux_ubuntu1804.yml @@ -152,9 +152,36 @@ jobs: ten_packages/extension/default_async_extension_python \ ten_packages/extension/py_init_extension_cpp - - name: Publish to release assets - uses: softprops/action-gh-release@v1 + - name: Upload Release Asset if: startsWith(github.ref, 'refs/tags/') - with: - files: | - out/linux/x64/ten_packages-linux-ubuntu1804-x64-gcc-${{ matrix.build_type }}.zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ASSET_PATH: out/linux/x64/ten_packages-linux-ubuntu1804-x64-gcc-${{ matrix.build_type }}.zip + ASSET_NAME: ten_packages-linux-ubuntu1804-x64-gcc-${{ matrix.build_type }}.zip + run: | + TAG_NAME=${GITHUB_REF#refs/tags/} + echo "Tag: $TAG_NAME" + + # Get the release information + response=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \ + https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/tags/$TAG_NAME) + + # Check if the release was found + if echo "$response" | grep -q '"id":'; then + echo "Release found." + else + echo "Release not found. Exiting." + exit 1 + fi + + # Extract upload_url + upload_url=$(echo "$response" | jq -r .upload_url | sed -e "s/{?name,label}//") + echo "Upload URL: $upload_url" + + # Upload the asset + curl -s -H "Authorization: token $GITHUB_TOKEN" \ + -H "Content-Type: application/zip" \ + --data-binary @"$ASSET_PATH" \ + "$upload_url?name=$ASSET_NAME" + + echo "Asset uploaded successfully." From eaeed69ad18560355954afd8bd8e5b6a23efa384 Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 26 Nov 2024 17:06:58 +0800 Subject: [PATCH 22/26] feat: add c++ ten_env_tester_proxy.h to unified c++ intf file --- .github/workflows/build_linux_ubuntu1804.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build_linux_ubuntu1804.yml b/.github/workflows/build_linux_ubuntu1804.yml index 68453a56d..7b58e2b6b 100644 --- a/.github/workflows/build_linux_ubuntu1804.yml +++ b/.github/workflows/build_linux_ubuntu1804.yml @@ -101,6 +101,9 @@ jobs: ./unit_test || { echo "ten_rust unit test failed"; exit 1; } ./integration_test || { echo "ten_rust integration test failed"; exit 1; } + - name: Install jq + run: sudo apt-get update && sudo apt-get install -y jq + - name: Compress ten_packages run: | zip -r artifact.zip \ From 72c48e6549deac3e3ef5a21494a8eb8fb9c4bf2d Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 26 Nov 2024 17:26:42 +0800 Subject: [PATCH 23/26] feat: add c++ ten_env_tester_proxy.h to unified c++ intf file --- .github/workflows/build_linux_ubuntu1804.yml | 90 +++++++++---------- .../basic/basic_extensions_init_dependency.cc | 33 +++---- .../property_access_app_store_async.cc | 19 ++-- 3 files changed, 66 insertions(+), 76 deletions(-) diff --git a/.github/workflows/build_linux_ubuntu1804.yml b/.github/workflows/build_linux_ubuntu1804.yml index 7b58e2b6b..236b9d107 100644 --- a/.github/workflows/build_linux_ubuntu1804.yml +++ b/.github/workflows/build_linux_ubuntu1804.yml @@ -56,53 +56,53 @@ jobs: tgn build linux x64 ${{ matrix.build_type }} tree -I 'gen|obj' out - - name: Run Tests (ten_utils_unit_test) - env: - ASAN_OPTIONS: detect_leaks=1:detect_stack_use_after_return=1:color=always:unmap_shadow_on_exit=1:abort_on_error=1 - MALLOC_CHECK_: 3 - TEN_ENABLE_MEMORY_TRACKING: "true" - TEN_ENABLE_BACKTRACE_DUMP: "true" - run: | - chmod +x out/linux/x64/tests/standalone/ten_utils_unit_test - out/linux/x64/tests/standalone/ten_utils_unit_test || { echo "test failed"; exit 1; } - - - name: Run Tests (ten_runtime_unit_test) - env: - ASAN_OPTIONS: detect_leaks=1:detect_stack_use_after_return=1:color=always:unmap_shadow_on_exit=1:abort_on_error=1 - MALLOC_CHECK_: 3 - TEN_ENABLE_MEMORY_TRACKING: "true" - TEN_ENABLE_BACKTRACE_DUMP: "true" - run: | - chmod +x out/linux/x64/tests/standalone/ten_runtime_unit_test - out/linux/x64/tests/standalone/ten_runtime_unit_test || { echo "test failed"; exit 1; } - - - name: Run Tests (ten_runtime_smoke_test) - env: - ASAN_OPTIONS: detect_leaks=1:detect_stack_use_after_return=1:color=always:unmap_shadow_on_exit=1:abort_on_error=1 - MALLOC_CHECK_: 3 - TEN_ENABLE_MEMORY_TRACKING: "true" - TEN_ENABLE_BACKTRACE_DUMP: "true" - run: | - chmod +x out/linux/x64/tests/standalone/ten_runtime_smoke_test - out/linux/x64/tests/standalone/ten_runtime_smoke_test || { echo "test failed"; exit 1; } - - - name: Run Tests (ten_rust standalone tests) - env: - ASAN_OPTIONS: detect_leaks=1:detect_stack_use_after_return=1:color=always:unmap_shadow_on_exit=1:abort_on_error=1 - MALLOC_CHECK_: 3 - TEN_ENABLE_MEMORY_TRACKING: "true" - TEN_ENABLE_BACKTRACE_DUMP: "true" - run: | - cd out/linux/x64/tests/standalone/ten_rust - - chmod +x unit_test - chmod +x integration_test - - ./unit_test || { echo "ten_rust unit test failed"; exit 1; } - ./integration_test || { echo "ten_rust integration test failed"; exit 1; } + # - name: Run Tests (ten_utils_unit_test) + # env: + # ASAN_OPTIONS: detect_leaks=1:detect_stack_use_after_return=1:color=always:unmap_shadow_on_exit=1:abort_on_error=1 + # MALLOC_CHECK_: 3 + # TEN_ENABLE_MEMORY_TRACKING: "true" + # TEN_ENABLE_BACKTRACE_DUMP: "true" + # run: | + # chmod +x out/linux/x64/tests/standalone/ten_utils_unit_test + # out/linux/x64/tests/standalone/ten_utils_unit_test || { echo "test failed"; exit 1; } + + # - name: Run Tests (ten_runtime_unit_test) + # env: + # ASAN_OPTIONS: detect_leaks=1:detect_stack_use_after_return=1:color=always:unmap_shadow_on_exit=1:abort_on_error=1 + # MALLOC_CHECK_: 3 + # TEN_ENABLE_MEMORY_TRACKING: "true" + # TEN_ENABLE_BACKTRACE_DUMP: "true" + # run: | + # chmod +x out/linux/x64/tests/standalone/ten_runtime_unit_test + # out/linux/x64/tests/standalone/ten_runtime_unit_test || { echo "test failed"; exit 1; } + + # - name: Run Tests (ten_runtime_smoke_test) + # env: + # ASAN_OPTIONS: detect_leaks=1:detect_stack_use_after_return=1:color=always:unmap_shadow_on_exit=1:abort_on_error=1 + # MALLOC_CHECK_: 3 + # TEN_ENABLE_MEMORY_TRACKING: "true" + # TEN_ENABLE_BACKTRACE_DUMP: "true" + # run: | + # chmod +x out/linux/x64/tests/standalone/ten_runtime_smoke_test + # out/linux/x64/tests/standalone/ten_runtime_smoke_test || { echo "test failed"; exit 1; } + + # - name: Run Tests (ten_rust standalone tests) + # env: + # ASAN_OPTIONS: detect_leaks=1:detect_stack_use_after_return=1:color=always:unmap_shadow_on_exit=1:abort_on_error=1 + # MALLOC_CHECK_: 3 + # TEN_ENABLE_MEMORY_TRACKING: "true" + # TEN_ENABLE_BACKTRACE_DUMP: "true" + # run: | + # cd out/linux/x64/tests/standalone/ten_rust + + # chmod +x unit_test + # chmod +x integration_test + + # ./unit_test || { echo "ten_rust unit test failed"; exit 1; } + # ./integration_test || { echo "ten_rust integration test failed"; exit 1; } - name: Install jq - run: sudo apt-get update && sudo apt-get install -y jq + run: apt-get install -y jq - name: Compress ten_packages run: | diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_extensions_init_dependency.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_extensions_init_dependency.cc index 0f695726d..2a155dc83 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_extensions_init_dependency.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_extensions_init_dependency.cc @@ -95,25 +95,20 @@ class test_extension_2 : public ten::extension_t { std::thread fetch_property_thread_; void get_property(ten::ten_env_t &ten_env) { - ten_env.get_property_string_async( - EXTENSION_PROP_NAME_GREETING, - [this](ten::ten_env_t &ten_env, const std::string &result, - TEN_UNUSED ten::error_t *err) { - greeting_ = result; - - auto cmd = ten::cmd_t::create("get_name"); - ten_env.send_cmd( - std::move(cmd), - [this](ten::ten_env_t &ten_env, - std::unique_ptr cmd_result) { - auto name = cmd_result->get_property_string("detail"); - greeting_ += name; - - ten_env.on_init_done(); - return true; - }, - nullptr); - }); + greeting_ = ten_env.get_property_string(EXTENSION_PROP_NAME_GREETING); + + auto cmd = ten::cmd_t::create("get_name"); + ten_env.send_cmd( + std::move(cmd), + [this](ten::ten_env_t &ten_env, + std::unique_ptr cmd_result) { + auto name = cmd_result->get_property_string("detail"); + greeting_ += name; + + ten_env.on_init_done(); + return true; + }, + nullptr); } }; diff --git a/tests/ten_runtime/smoke/extension_test/property/property_access_app_store_async.cc b/tests/ten_runtime/smoke/extension_test/property/property_access_app_store_async.cc index d1da35500..fadb39ed8 100644 --- a/tests/ten_runtime/smoke/extension_test/property/property_access_app_store_async.cc +++ b/tests/ten_runtime/smoke/extension_test/property/property_access_app_store_async.cc @@ -24,18 +24,13 @@ class test_property_access_app_store_async_2 : public ten::extension_t { void on_cmd(ten::ten_env_t &ten_env, std::unique_ptr cmd) override { - auto cmd_shared = - std::make_shared>(std::move(cmd)); - ten_env.get_property_int32_async( - "app:aaa", [cmd_shared](ten::ten_env_t &ten_env, int32_t result, - TEN_UNUSED ten::error_t *err) { - if (result == 3) { - auto cmd_result = ten::cmd_result_t::create(TEN_STATUS_CODE_OK); - cmd_result->set_property("detail", "success"); - ten_env.return_result(std::move(cmd_result), - std::move(*cmd_shared)); - } - }); + auto result = ten_env.get_property_int32("app:aaa"); + + if (result == 3) { + auto cmd_result = ten::cmd_result_t::create(TEN_STATUS_CODE_OK); + cmd_result->set_property("detail", "success"); + ten_env.return_result(std::move(cmd_result), std::move(cmd)); + } } }; From d837126c04e991e06f3d13a2ac4b1cdcc86e5c22 Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 26 Nov 2024 17:39:54 +0800 Subject: [PATCH 24/26] feat: add c++ ten_env_tester_proxy.h to unified c++ intf file --- .github/workflows/build_linux_ubuntu1804.yml | 2 +- .../ten_runtime/binding/cpp/detail/ten_env.h | 188 ------------------ 2 files changed, 1 insertion(+), 189 deletions(-) diff --git a/.github/workflows/build_linux_ubuntu1804.yml b/.github/workflows/build_linux_ubuntu1804.yml index 236b9d107..04f52842d 100644 --- a/.github/workflows/build_linux_ubuntu1804.yml +++ b/.github/workflows/build_linux_ubuntu1804.yml @@ -102,7 +102,7 @@ jobs: # ./integration_test || { echo "ten_rust integration test failed"; exit 1; } - name: Install jq - run: apt-get install -y jq + run: apt-get update && apt-get install -y jq - name: Compress ten_packages run: | diff --git a/core/include/ten_runtime/binding/cpp/detail/ten_env.h b/core/include/ten_runtime/binding/cpp/detail/ten_env.h index 446d7533f..f6760c70f 100644 --- a/core/include/ten_runtime/binding/cpp/detail/ten_env.h +++ b/core/include/ten_runtime/binding/cpp/detail/ten_env.h @@ -49,12 +49,6 @@ class ten_env_internal_accessor_t; using result_handler_func_t = std::function)>; -using set_property_async_cb_t = - std::function; - -using get_property_async_cb_t = - std::function; - class ten_env_t { public: // @{ @@ -407,42 +401,6 @@ class ten_env_t { c_value, err != nullptr ? err->get_internal_representation() : nullptr); } - bool get_property_int32_async( - const char *path, - std::function &&cb, - error_t *err = nullptr) { - // Initialized lambda captures are a C++14 extension, and we use the - // following trick to achieve the same effect. - auto cb_copy = std::move(cb); - return get_property_async_impl( - path, - [cb_copy](ten_env_t &ten_env, ten_value_t *value, error_t *err) { - cb_copy(ten_env, - ten_value_get_int32( - value, err != nullptr ? err->get_internal_representation() - : nullptr), - err); - return; - }, - err); - } - - bool get_property_string_async( - const char *path, - std::function &&cb, - error_t *err = nullptr) { - // Initialized lambda captures are a C++14 extension, and we use the - // following trick to achieve the same effect. - auto cb_copy = std::move(cb); - return get_property_async_impl( - path, - [cb_copy](ten_env_t &ten_env, ten_value_t *value, error_t *err) { - cb_copy(ten_env, ten_value_peek_raw_str(value), err); - return; - }, - err); - } - bool set_property(const char *path, int8_t value, error_t *err = nullptr) { return set_property_impl(path, ten_value_create_int8(value), err); } @@ -510,77 +468,6 @@ class ten_env_t { return set_property_impl(path, ten_value_create_buf_with_move(buf), err); } - bool set_property_async(const char *path, int8_t value, - set_property_async_cb_t &&cb, - error_t *err = nullptr) { - return set_property_async_impl(path, ten_value_create_int8(value), - std::move(cb), err); - } - - bool set_property_async(const char *path, int16_t value, - set_property_async_cb_t &&cb, - error_t *err = nullptr) { - return set_property_async_impl(path, ten_value_create_int16(value), - std::move(cb), err); - } - - bool set_property_async(const char *path, int32_t value, - set_property_async_cb_t &&cb, - error_t *err = nullptr) { - return set_property_async_impl(path, ten_value_create_int32(value), - std::move(cb), err); - } - - bool set_property_async(const char *path, int64_t value, - set_property_async_cb_t &&cb, - error_t *err = nullptr) { - return set_property_async_impl(path, ten_value_create_int64(value), - std::move(cb), err); - } - - bool set_property_async(const char *path, uint8_t value, - set_property_async_cb_t &&cb, - error_t *err = nullptr) { - return set_property_async_impl(path, ten_value_create_uint8(value), - std::move(cb), err); - } - - bool set_property_async(const char *path, uint16_t value, - set_property_async_cb_t &&cb, - error_t *err = nullptr) { - return set_property_async_impl(path, ten_value_create_uint16(value), - std::move(cb), err); - } - - bool set_property_async(const char *path, uint32_t value, - set_property_async_cb_t &&cb, - error_t *err = nullptr) { - return set_property_async_impl(path, ten_value_create_uint32(value), - std::move(cb), err); - } - - bool set_property_async(const char *path, uint64_t value, - set_property_async_cb_t &&cb, - error_t *err = nullptr) { - return set_property_async_impl(path, ten_value_create_uint64(value), - std::move(cb), err); - } - - bool set_property_async(const char *path, const char *value, - set_property_async_cb_t &&cb, - error_t *err = nullptr) { - return set_property_async_impl(path, ten_value_create_string(value), - std::move(cb), err); - } - - // Convenient overloaded function for string type. - bool set_property_async(const char *path, const std::string &value, - set_property_async_cb_t &&cb, - error_t *err = nullptr) { - return set_property_async_impl(path, ten_value_create_string(value.c_str()), - std::move(cb), err); - } - bool is_cmd_connected(const char *cmd_name, error_t *err = nullptr) { TEN_ASSERT(c_ten_env, "Should not happen."); return ten_env_is_cmd_connected( @@ -788,43 +675,6 @@ class ten_env_t { return rc; } - /** - * @note Note the move semantics of @a value. The @a value should not be - * used after calling this function. - */ - bool set_property_async_impl(const char *path, ten_value_t *value, - set_property_async_cb_t &&cb, error_t *err) { - TEN_ASSERT(c_ten_env, "Should not happen."); - - auto *cb_ptr = new set_property_async_cb_t(cb); - - bool rc = ten_env_set_property_async( - c_ten_env, path, value, proxy_set_property_callback, cb_ptr, - err != nullptr ? err->get_internal_representation() : nullptr); - - if (!rc) { - delete cb_ptr; - } - return rc; - } - - bool get_property_async_impl(const char *path, get_property_async_cb_t &&cb, - error_t *err = nullptr) { - TEN_ASSERT(c_ten_env, "Should not happen."); - - auto *cb_ptr = new get_property_async_cb_t(cb); - - bool rc = ten_env_peek_property_async( - c_ten_env, path, proxy_get_property_async_from_peek_cb, cb_ptr, - err != nullptr ? err->get_internal_representation() : nullptr); - - if (!rc) { - delete cb_ptr; - } - - return rc; - } - static void proxy_handle_result(TEN_UNUSED ten_extension_t *extension, ::ten_env_t *ten_env, ten_shared_ptr_t *c_cmd_result, @@ -859,44 +709,6 @@ class ten_env_t { delete result_handler; } } - - static void proxy_set_property_callback(::ten_env_t *ten_env, bool res, - void *cb_data, ten_error_t *err) { - auto *callback = static_cast(cb_data); - auto *cpp_ten_env = - static_cast(ten_binding_handle_get_me_in_target_lang( - reinterpret_cast(ten_env))); - - error_t *cpp_err = nullptr; - if (err != nullptr) { - cpp_err = new error_t(err, false); - } - - (*callback)(*cpp_ten_env, res, cpp_err); - - delete cpp_err; - delete callback; - } - - static void proxy_get_property_async_from_peek_cb(::ten_env_t *ten_env, - ten_value_t *res, - void *cb_data, - ten_error_t *err) { - auto *callback = static_cast(cb_data); - auto *cpp_ten_env = - static_cast(ten_binding_handle_get_me_in_target_lang( - reinterpret_cast(ten_env))); - - error_t *cpp_err = nullptr; - if (err != nullptr) { - cpp_err = new error_t(err, false); - } - - (*callback)(*cpp_ten_env, res, cpp_err); - - delete cpp_err; - delete callback; - } }; } // namespace ten From 4ae9c7c38acadab5f008476e63d092352eb94503 Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 26 Nov 2024 18:02:01 +0800 Subject: [PATCH 25/26] feat: add c++ ten_env_tester_proxy.h to unified c++ intf file --- .github/workflows/build_linux_ubuntu1804.yml | 38 +------------------- 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/.github/workflows/build_linux_ubuntu1804.yml b/.github/workflows/build_linux_ubuntu1804.yml index 04f52842d..c7e3b6c28 100644 --- a/.github/workflows/build_linux_ubuntu1804.yml +++ b/.github/workflows/build_linux_ubuntu1804.yml @@ -102,45 +102,9 @@ jobs: # ./integration_test || { echo "ten_rust integration test failed"; exit 1; } - name: Install jq + if: startsWith(github.ref, 'refs/tags/') run: apt-get update && apt-get install -y jq - - name: Compress ten_packages - run: | - zip -r artifact.zip \ - out/linux/x64/ten_packages/system/ten_runtime \ - out/linux/x64/ten_packages/system/ten_runtime_go \ - out/linux/x64/ten_packages/system/ten_runtime_python \ - out/linux/x64/ten_packages/extension/default_extension_cpp \ - out/linux/x64/ten_packages/extension/default_extension_go \ - out/linux/x64/ten_packages/extension/default_extension_python \ - out/linux/x64/ten_packages/extension/default_async_extension_python \ - out/linux/x64/ten_packages/extension/py_init_extension_cpp - - - name: Upload Artifact via API - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ARTIFACT_NAME: ten_packages-linux-ubuntu1804-x64-gcc-${{ matrix.build_type }} - run: | - response=$(curl -s -X POST \ - -H "Authorization: Bearer $GITHUB_TOKEN" \ - -H "Accept: application/vnd.github+json" \ - https://api.github.com/repos/${{ github.repository }}/actions/artifacts \ - -d "{\"name\":\"$ARTIFACT_NAME\",\"expire_in\":\"1 week\"}") - - artifact_id=$(echo "$response" | jq .id) - upload_url=$(echo "$response" | jq -r .archive_download_url) - - echo "Artifact ID: $artifact_id" - echo "Upload URL: $upload_url" - - curl -s -X POST \ - -H "Authorization: Bearer $GITHUB_TOKEN" \ - -H "Content-Type: application/zip" \ - --data-binary @artifact.zip \ - "$upload_url" - - echo "Artifact uploaded successfully." - - name: Package assets if: startsWith(github.ref, 'refs/tags/') run: | From a8f8b5696680aae81fb4d74f4e52f7443332d230 Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Tue, 26 Nov 2024 19:06:13 +0800 Subject: [PATCH 26/26] feat: add c++ ten_env_tester_proxy.h to unified c++ intf file --- packages/core_extensions/py_init_extension_cpp/src/main.cc | 2 +- tests/common/client/cpp/msgpack_tcp.h | 1 - .../install_all_fail_with_local_unsupported_pkg/test_case.py | 3 +++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/core_extensions/py_init_extension_cpp/src/main.cc b/packages/core_extensions/py_init_extension_cpp/src/main.cc index 297bfa1fe..711fd7ba9 100644 --- a/packages/core_extensions/py_init_extension_cpp/src/main.cc +++ b/packages/core_extensions/py_init_extension_cpp/src/main.cc @@ -13,7 +13,7 @@ #include "include_internal/ten_runtime/common/base_dir.h" #include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/metadata/manifest.h" -#include "include_internal/ten_runtime/ten_env/metadata.h" +#include "include_internal/ten_runtime/ten_env/ten_env.h" #include "ten_runtime/binding/cpp/detail/ten_env.h" #include "ten_runtime/binding/cpp/ten.h" #include "ten_utils/container/list_str.h" diff --git a/tests/common/client/cpp/msgpack_tcp.h b/tests/common/client/cpp/msgpack_tcp.h index 910012f55..1f54245ee 100644 --- a/tests/common/client/cpp/msgpack_tcp.h +++ b/tests/common/client/cpp/msgpack_tcp.h @@ -15,7 +15,6 @@ #include "include_internal/ten_runtime/binding/cpp/ten.h" #include "include_internal/ten_utils/log/log.h" #include "ten_runtime/binding/cpp/detail/msg/cmd_result.h" -#include "ten_utils/lib/json.h" #include "ten_utils/lib/smart_ptr.h" #include "ten_utils/lib/string.h" #include "tests/common/client/msgpack_tcp.h" diff --git a/tests/ten_manager/install_all/install_all_fail_with_local_unsupported_pkg/test_case.py b/tests/ten_manager/install_all/install_all_fail_with_local_unsupported_pkg/test_case.py index 08ff2beb9..f3d4ac3fe 100644 --- a/tests/ten_manager/install_all/install_all_fail_with_local_unsupported_pkg/test_case.py +++ b/tests/ten_manager/install_all/install_all_fail_with_local_unsupported_pkg/test_case.py @@ -33,6 +33,9 @@ def test_tman_dependency_resolve(): cwd=app_dir, ) + print(returncode) + print(output_text) + assert returncode != 0 # As the local package 'heiheihei_1' is not compatible with linux os, and # the package cannot be found in the registry, so no candidates can be found