Skip to content

Commit

Permalink
<fix>(framework): mv framework test and benchmark.
Browse files Browse the repository at this point in the history
  • Loading branch information
kyonRay committed Nov 17, 2023
1 parent 00ec6ff commit 5769327
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 26 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/workflow-self-hosted-centos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ jobs:
. /opt/rh/rh-perl530/enable
export LIBCLANG_PATH=/opt/rh/llvm-toolset-7.0/root/lib64/
. /opt/rh/llvm-toolset-7.0/enable
alias cmake='cmake3'
cd build && cmake3 -DALLOCATOR=jemalloc -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake -DTESTS=ON -DCOVERAGE=ON -DWITH_LIGHTNODE=ON -DWITH_CPPSDK=ON -DWITH_TIKV=OFF -DWITH_TARS_SERVICES=ON .. || cat *.log
cd build && cmake -DALLOCATOR=jemalloc -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake -DTESTS=ON -DCOVERAGE=ON -DWITH_LIGHTNODE=ON -DWITH_CPPSDK=ON -DWITH_TIKV=OFF -DWITH_TARS_SERVICES=ON .. || cat *.log
make -j8
- name: Test
run:
Expand Down
5 changes: 2 additions & 3 deletions bcos-framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,16 @@ target_include_directories(bcos-framework INTERFACE
$<INSTALL_INTERFACE:include/bcos-framework>)

if (PRECOMPILED_HEADER)
target_link_libraries(bcos-framework INTERFACE bcos-crypto bcos-task Microsoft.GSL::GSL precompiled-headers)
target_link_libraries(bcos-framework INTERFACE bcos-task Microsoft.GSL::GSL precompiled-headers)
target_precompile_headers(bcos-framework REUSE_FROM precompiled-headers)
else()
target_link_libraries(bcos-framework INTERFACE bcos-crypto bcos-task Microsoft.GSL::GSL fmt::fmt)
target_link_libraries(bcos-framework INTERFACE bcos-task Microsoft.GSL::GSL fmt::fmt)
endif()

if (TESTS)
enable_testing()
set(CTEST_OUTPUT_ON_FAILURE TRUE)
add_subdirectory(test)
add_subdirectory(benchmark)
endif()

# for code coverage
Expand Down
7 changes: 0 additions & 7 deletions bcos-framework/benchmark/CMakeLists.txt

This file was deleted.

3 changes: 1 addition & 2 deletions bcos-framework/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ set(TEST_BINARY_NAME test-bcos-framework)
add_executable(${TEST_BINARY_NAME} ${SOURCES})

find_package(Boost REQUIRED serialization unit_test_framework)
find_package(fmt REQUIRED)

target_link_libraries(${TEST_BINARY_NAME} PRIVATE ${UTILITIES_TARGET} bcos-framework Boost::serialization fmt::fmt-header-only Boost::unit_test_framework)
target_link_libraries(${TEST_BINARY_NAME} PRIVATE ${UTILITIES_TARGET} bcos-framework Boost::serialization Boost::unit_test_framework)
add_test(NAME test-framework WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${TEST_BINARY_NAME})
7 changes: 6 additions & 1 deletion benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ add_executable(merkleBench merkleBench.cpp)
target_link_libraries(merkleBench ${TOOL_TARGET} ${PROTOCOL_TARGET} bcos-crypto Boost::program_options)

add_executable(storageBenchmark storageBenchmark.cpp)
target_link_libraries(storageBenchmark bcos-framework)
target_link_libraries(storageBenchmark bcos-framework)

find_package(fmt REQUIRED)
find_package(benchmark REQUIRED)
add_executable(benchmark-memory-storage benchmarkMemoryStorage.cpp)
target_link_libraries(benchmark-memory-storage bcos-framework benchmark::benchmark benchmark::benchmark_main fmt::fmt-header-only)
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include <bcos-framework/storage/Entry.h>
#include <bcos-framework/storage2/MemoryStorage.h>
#include <bcos-task/Wait.h>
#include "bcos-framework/bcos-framework/storage/Entry.h"
#include "bcos-framework/bcos-framework/storage2/MemoryStorage.h"
#include "bcos-framework/bcos-framework/transaction-executor/TransactionExecutor.h"
#include "libtask/bcos-task/Wait.h"
#include <benchmark/benchmark.h>
#include <fmt/format.h>
#include <tbb/concurrent_hash_map.h>
#include <tbb/concurrent_map.h>
#include <tbb/concurrent_unordered_map.h>
#include <transaction-executor/TransactionExecutor.h>
#include <boost/container_hash/hash_fwd.hpp>
#include <any>
#include <variant>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
* @file ConsensusNodeTest.cpp
*/
#include "bcos-framework/consensus/ConsensusNode.h"
#include "bcos-crypto/bcos-crypto/signature/key/KeyImpl.h"
#include "bcos-crypto/bcos-crypto/signature/secp256k1/Secp256k1Crypto.h"
#include "bcos-framework/consensus/ConsensusNodeInterface.h"
#include "bcos-framework/protocol/Protocol.h"
#include <bcos-crypto/signature/key/KeyImpl.h>
#include <bcos-crypto/signature/secp256k1/Secp256k1Crypto.h>
#include <bcos-utilities/testutils/TestPromptFixture.h>
#include "bcos-utilities/testutils/TestPromptFixture.h"
#include <boost/test/unit_test.hpp>
using namespace bcos;
using namespace bcos::consensus;
Expand Down
4 changes: 2 additions & 2 deletions vcpkg-configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"kind": "git",
"repository": "https://github.com/FISCO-BCOS/registry",
"baseline": "4eaa0a8b35639723188128a229020ecb397dafd8",
"baseline": "4e355080e2742a679e1ce5fddb8a3b9a7fd559fd",
"packages": [
"openssl",
"evmone",
Expand All @@ -17,7 +17,7 @@
"jemalloc",
"secp256k1",
"tbb",
"wedpr-sdf"
"hsm-crypto"
]
}
]
Expand Down
5 changes: 3 additions & 2 deletions vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
},
"wedprcrypto",
"range-v3",
"wedpr-sdf"
"hsm-crypto"
],
"features": {
"fullnode": {
Expand Down Expand Up @@ -119,7 +119,8 @@
{
"name": "tarscpp",
"version>=": "3.0.3-1#1"
}
},
"hsm-crypto"
]
},
"etcd": {
Expand Down

0 comments on commit 5769327

Please sign in to comment.