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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/ubuntu-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
sudo apt-get install -y libssl-dev libcurl4-openssl-dev

- name: Configure
run: cmake -S . -B build-linux -DOPTIONX_BUILD_DEPS=ON -DOPTIONX_BUILD_TESTS=ON
run: cmake -S . -B build-linux -DOPTIONX_BUILD_DEPS=ON -DOPTIONX_BUILD_TESTS=ON -DOPTIONX_BUILD_EXAMPLES=ON

- name: Build trade_record_db_test
run: cmake --build build-linux --target trade_record_db_test -j
Expand Down Expand Up @@ -54,6 +54,12 @@ jobs:
- name: Run metatrader_file_bridge_test
run: ./build-linux/metatrader_file_bridge_test --gtest_brief=1

- name: Build metatrader_file_bridge_smoke
run: cmake --build build-linux --target metatrader_file_bridge_smoke -j

- name: Run metatrader_file_bridge_smoke
run: ./build-linux/metatrader_file_bridge_smoke --self-test

- name: Build market_data_subscription_contract_test
run: cmake --build build-linux --target market_data_subscription_contract_test -j

Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/windows-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
cmake -S . -B build-windows
-DOPTIONX_BUILD_DEPS=ON
-DOPTIONX_BUILD_TESTS=ON
-DOPTIONX_BUILD_EXAMPLES=ON
-DOPTIONX_LIGHTWEIGHT_BRIDGE_SMOKE_TESTS=ON

- name: Build MetaTrader path discovery test
Expand All @@ -33,6 +34,9 @@ jobs:
metatrader_file_bridge_test
bridge_umbrella_include_test

- name: Build MetaTrader file smoke example
run: cmake --build build-windows --config Debug --target metatrader_file_bridge_smoke

- name: Run MetaTrader file tests
shell: pwsh
run: |
Expand All @@ -41,3 +45,4 @@ jobs:
.\build-windows\Debug\metatrader_file_config_include_test.exe --gtest_brief=1
.\build-windows\Debug\metatrader_file_bridge_test.exe --gtest_brief=1
.\build-windows\Debug\bridge_umbrella_include_test.exe --gtest_brief=1
.\build-windows\Debug\metatrader_file_bridge_smoke.exe --self-test
46 changes: 46 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,52 @@ if(OPTIONX_BUILD_EXAMPLES)
-P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/copy_runtime_dlls.cmake"
)
endif()

add_executable(metatrader_file_bridge_smoke examples/metatrader_file_bridge_smoke.cpp)
target_compile_features(metatrader_file_bridge_smoke PRIVATE cxx_std_17)

target_include_directories(metatrader_file_bridge_smoke PRIVATE
${EXAMPLE_INCLUDE_DIRS}
${EXAMPLE_DEPS_INCLUDE_DIRS}
)

target_link_directories(metatrader_file_bridge_smoke PRIVATE ${EXAMPLE_LIBRARY_DIRS})
target_compile_definitions(
metatrader_file_bridge_smoke PRIVATE
${EXAMPLE_DEFINES}
LOGIT_BASE_PATH="${LOGIT_BASE_PATH_FWD}"
)
if(MINGW)
target_compile_options(metatrader_file_bridge_smoke PRIVATE -Wa,-mbig-obj)
endif()
if(OPTIONX_LIGHTWEIGHT_BRIDGE_SMOKE_TESTS)
target_link_libraries(metatrader_file_bridge_smoke PRIVATE ${EXAMPLE_LIBS})
if(WIN32)
target_link_libraries(metatrader_file_bridge_smoke PRIVATE ${OPTIONX_WINDOWS_SYSTEM_LIBS})
endif()
else()
target_link_libraries(metatrader_file_bridge_smoke PRIVATE ${EXAMPLE_LIBS} optionx_cpp)
endif()

if(OPTIONX_BUILD_DEPS AND NOT OPTIONX_LIGHTWEIGHT_BRIDGE_SMOKE_TESTS)
add_dependencies(metatrader_file_bridge_smoke mdbx-static AES)
endif()

foreach(dll ${EXAMPLE_DLL_FILES})
add_custom_command(TARGET metatrader_file_bridge_smoke POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${dll}" "$<TARGET_FILE_DIR:metatrader_file_bridge_smoke>"
)
endforeach()

if(WIN32)
add_custom_command(TARGET metatrader_file_bridge_smoke POST_BUILD
COMMAND ${CMAKE_COMMAND}
-DOPTIONX_RUNTIME_DLL_DIR="${EXAMPLE_BUILD_LIBS_DIR}/bin"
-DOPTIONX_RUNTIME_TARGET_DIR="$<TARGET_FILE_DIR:metatrader_file_bridge_smoke>"
-P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/copy_runtime_dlls.cmake"
)
endif()
endif()

if(OPTIONX_BUILD_TESTS)
Expand Down
19 changes: 19 additions & 0 deletions examples/metatrader_file_bridge_smoke.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
// Omit common_files_root to use the default MetaQuotes Common\Files folder.
// For portable terminals, set it explicitly, for example:
// "common_files_root": "C:/MetaTrader/Terminal/Common/Files",

"namespace_subdir": "OptionX/Bridge/v1",
"bridge_id": 1,
"client_id": "smoke",
"client_secret": "",

"poll_interval_ms": 250,
"max_line_bytes": 65536,
"max_scanned_records_per_poll": 256,
"max_returned_records_per_poll": 64,
"idempotency_retention_ms": 86400000,

"enable_events": true,
"enable_state_snapshot": true
}
Loading
Loading