mirror of
https://github.com/SChernykh/p2pool.git
synced 2024-11-16 15:57:39 +00:00
Updated tests
This commit is contained in:
parent
b498084388
commit
f455ce398c
7 changed files with 22 additions and 8 deletions
15
.github/workflows/c-cpp.yml
vendored
15
.github/workflows/c-cpp.yml
vendored
|
@ -42,7 +42,10 @@ jobs:
|
|||
make -j$(nproc)
|
||||
|
||||
- name: Run tests
|
||||
run: cd tests/build && ./p2pool_tests
|
||||
run: |
|
||||
cd tests/build
|
||||
gunzip *.gz
|
||||
./p2pool_tests
|
||||
|
||||
- name: Archive binary
|
||||
uses: actions/upload-artifact@v3
|
||||
|
@ -107,7 +110,10 @@ jobs:
|
|||
make -j$(nproc)
|
||||
|
||||
- name: Run tests
|
||||
run: cd tests/build && ./p2pool_tests
|
||||
run: |
|
||||
cd tests/build
|
||||
gunzip *.gz
|
||||
./p2pool_tests
|
||||
|
||||
- name: Archive binary
|
||||
uses: actions/upload-artifact@v3
|
||||
|
@ -235,6 +241,7 @@ jobs:
|
|||
- name: Run tests
|
||||
run: |
|
||||
cd tests/build
|
||||
gunzip *.gz
|
||||
./p2pool_tests.exe
|
||||
|
||||
- name: Archive binary
|
||||
|
@ -282,6 +289,7 @@ jobs:
|
|||
- name: Run tests
|
||||
run: |
|
||||
cd tests/build/Debug
|
||||
7z x *.gz
|
||||
./p2pool_tests.exe
|
||||
|
||||
- name: Archive binary
|
||||
|
@ -349,6 +357,7 @@ jobs:
|
|||
- name: Run tests
|
||||
run: |
|
||||
cd tests/build
|
||||
gunzip *.gz
|
||||
./p2pool_tests
|
||||
|
||||
- name: Archive binary
|
||||
|
@ -409,6 +418,7 @@ jobs:
|
|||
cd build
|
||||
cmake .. -DSTATIC_LIBS=ON
|
||||
make -j2
|
||||
gunzip *.gz
|
||||
./p2pool_tests
|
||||
|
||||
- name: Archive binary
|
||||
|
@ -452,6 +462,7 @@ jobs:
|
|||
mkdir build && cd build
|
||||
cmake ..
|
||||
make -j2
|
||||
gunzip *.gz
|
||||
./p2pool_tests
|
||||
|
||||
- name: Archive binary
|
||||
|
|
|
@ -9,6 +9,9 @@ if (${CMAKE_VERSION} VERSION_GREATER "3.5.2")
|
|||
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT p2pool_tests)
|
||||
endif()
|
||||
|
||||
set(BUILD_GMOCK OFF CACHE BOOL "Builds the googlemock subproject" FORCE)
|
||||
set(INSTALL_GTEST OFF CACHE BOOL "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" FORCE)
|
||||
|
||||
add_subdirectory(googletest)
|
||||
set(LIBS gtest)
|
||||
|
||||
|
@ -175,5 +178,5 @@ add_executable(${CMAKE_PROJECT_NAME} ${HEADERS} ${SOURCES})
|
|||
target_link_libraries(${CMAKE_PROJECT_NAME} debug ${ZMQ_LIBRARY_DEBUG} debug ${UV_LIBRARY_DEBUG} debug ${CURL_LIBRARY_DEBUG} optimized ${ZMQ_LIBRARY} optimized ${UV_LIBRARY} optimized ${CURL_LIBRARY} ${LIBS})
|
||||
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/src/crypto_tests.txt" $<TARGET_FILE_DIR:${CMAKE_PROJECT_NAME}>)
|
||||
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/src/block.dat" $<TARGET_FILE_DIR:${CMAKE_PROJECT_NAME}>)
|
||||
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/src/sidechain_dump.dat" $<TARGET_FILE_DIR:${CMAKE_PROJECT_NAME}>)
|
||||
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/src/sidechain_dump_mini.dat" $<TARGET_FILE_DIR:${CMAKE_PROJECT_NAME}>)
|
||||
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/src/sidechain_dump.dat.gz" $<TARGET_FILE_DIR:${CMAKE_PROJECT_NAME}>)
|
||||
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/src/sidechain_dump_mini.dat.gz" $<TARGET_FILE_DIR:${CMAKE_PROJECT_NAME}>)
|
||||
|
|
|
@ -131,8 +131,8 @@ TEST(pool_block, verify)
|
|||
uint64_t m_txinGenHeight;
|
||||
uint64_t m_sidechainHeight;
|
||||
} tests[2] = {
|
||||
{ "default", "sidechain_dump.dat", 2845288, 4674368 },
|
||||
{ "mini", "sidechain_dump_mini.dat", 2845293, 4129185 },
|
||||
{ "default", "sidechain_dump.dat", 2870010, 4957203 },
|
||||
{ "mini", "sidechain_dump_mini.dat", 2870010, 4414446 },
|
||||
};
|
||||
|
||||
for (const STest& t : tests)
|
||||
|
@ -140,8 +140,8 @@ TEST(pool_block, verify)
|
|||
PoolBlock b;
|
||||
SideChain sidechain(nullptr, NetworkType::Mainnet, t.m_poolName);
|
||||
|
||||
// Difficulty of block 2844672
|
||||
sidechain.m_testMainChainDiff = difficulty_type(321967641416ULL, 0ULL);
|
||||
// Difficulty of block 2869248
|
||||
sidechain.m_testMainChainDiff = difficulty_type(345786476185ULL, 0ULL);
|
||||
|
||||
std::ifstream f(t.m_fileName, std::ios::binary | std::ios::ate);
|
||||
ASSERT_EQ(f.good() && f.is_open(), true);
|
||||
|
|
Binary file not shown.
BIN
tests/src/sidechain_dump.dat.gz
Normal file
BIN
tests/src/sidechain_dump.dat.gz
Normal file
Binary file not shown.
Binary file not shown.
BIN
tests/src/sidechain_dump_mini.dat.gz
Normal file
BIN
tests/src/sidechain_dump_mini.dat.gz
Normal file
Binary file not shown.
Loading…
Reference in a new issue