From c5b4e84652317a7bbf9b081c1849bb4bdd9546a4 Mon Sep 17 00:00:00 2001 From: SChernykh <15806605+SChernykh@users.noreply.github.com> Date: Mon, 7 Jul 2025 10:54:58 +0200 Subject: [PATCH] Compiler test scripts: added RandomX tests --- scripts/compiler_tests/clang/Dockerfile | 2 +- scripts/compiler_tests/clang/test.sh | 16 ++-------------- scripts/compiler_tests/clang/test2.sh | 21 +++++++++++++++++++++ scripts/compiler_tests/gcc/Dockerfile | 2 +- scripts/compiler_tests/gcc/test.sh | 16 ++-------------- scripts/compiler_tests/gcc/test2.sh | 21 +++++++++++++++++++++ 6 files changed, 48 insertions(+), 30 deletions(-) create mode 100755 scripts/compiler_tests/clang/test2.sh create mode 100755 scripts/compiler_tests/gcc/test2.sh diff --git a/scripts/compiler_tests/clang/Dockerfile b/scripts/compiler_tests/clang/Dockerfile index 8842115..97e87aa 100644 --- a/scripts/compiler_tests/clang/Dockerfile +++ b/scripts/compiler_tests/clang/Dockerfile @@ -1,4 +1,4 @@ FROM p2pool_compiler_tests_ubuntu ARG P2POOL_VERSION GCC_VERSION -ADD test.sh /p2pool/ +ADD test.sh test2.sh /p2pool/ RUN /p2pool/test.sh ${P2POOL_VERSION} ${GCC_VERSION} diff --git a/scripts/compiler_tests/clang/test.sh b/scripts/compiler_tests/clang/test.sh index e30bcae..d3de0a2 100755 --- a/scripts/compiler_tests/clang/test.sh +++ b/scripts/compiler_tests/clang/test.sh @@ -5,20 +5,8 @@ git fetch --jobs=$(nproc) git checkout $1 git submodule update --recursive --jobs $(nproc) -COMPILER="-DCMAKE_C_COMPILER=clang-$2 -DCMAKE_CXX_COMPILER=clang++-$2" +export COMPILER="-DCMAKE_C_COMPILER=clang-$2 -DCMAKE_CXX_COMPILER=clang++-$2" -cd /p2pool -mkdir build && cd build - -cmake .. -DCMAKE_BUILD_TYPE=Release $COMPILER 1>> /p2pool/output.log 2>&1 -make -j$(nproc) p2pool 1>> /p2pool/output.log 2>&1 -./p2pool --test 1>> /p2pool/output.log 2>&1 - -cd ../tests -mkdir build && cd build -cmake .. -DCMAKE_BUILD_TYPE=Release $COMPILER 1>> /p2pool/output.log 2>&1 -make -j$(nproc) p2pool_tests 1>> /p2pool/output.log 2>&1 -gunzip *.gz -./p2pool_tests 1>> /p2pool/output.log 2>&1 +./test2.sh tar -czvf /p2pool/logs.tar.gz /p2pool/output.log diff --git a/scripts/compiler_tests/clang/test2.sh b/scripts/compiler_tests/clang/test2.sh new file mode 100755 index 0000000..6889edd --- /dev/null +++ b/scripts/compiler_tests/clang/test2.sh @@ -0,0 +1,21 @@ +#!/bin/sh +set -e + +cd /p2pool +mkdir build && cd build + +cmake .. -DCMAKE_BUILD_TYPE=Release $COMPILER 1>> /p2pool/output.log 2>&1 +make -j$(nproc) p2pool 1>> /p2pool/output.log 2>&1 + +./p2pool --test 1>> /p2pool/output.log 2>&1 + +make -j$(nproc) randomx-tests 1>> /p2pool/output.log 2>&1 +external/src/RandomX/randomx-tests 1>> /p2pool/output.log 2>&1 + +cd ../tests +mkdir build && cd build +cmake .. -DCMAKE_BUILD_TYPE=Release $COMPILER 1>> /p2pool/output.log 2>&1 +make -j$(nproc) p2pool_tests 1>> /p2pool/output.log 2>&1 +gunzip *.gz + +./p2pool_tests 1>> /p2pool/output.log 2>&1 diff --git a/scripts/compiler_tests/gcc/Dockerfile b/scripts/compiler_tests/gcc/Dockerfile index 8842115..97e87aa 100644 --- a/scripts/compiler_tests/gcc/Dockerfile +++ b/scripts/compiler_tests/gcc/Dockerfile @@ -1,4 +1,4 @@ FROM p2pool_compiler_tests_ubuntu ARG P2POOL_VERSION GCC_VERSION -ADD test.sh /p2pool/ +ADD test.sh test2.sh /p2pool/ RUN /p2pool/test.sh ${P2POOL_VERSION} ${GCC_VERSION} diff --git a/scripts/compiler_tests/gcc/test.sh b/scripts/compiler_tests/gcc/test.sh index a52a5d9..59ada51 100755 --- a/scripts/compiler_tests/gcc/test.sh +++ b/scripts/compiler_tests/gcc/test.sh @@ -5,20 +5,8 @@ git fetch --jobs=$(nproc) git checkout $1 git submodule update --recursive --jobs $(nproc) -COMPILER="-DCMAKE_C_COMPILER=/usr/local/gcc-$2/bin/gcc -DCMAKE_CXX_COMPILER=/usr/local/gcc-$2/bin/g++ -DCMAKE_AR=/usr/local/gcc-$2/bin/gcc-ar -DCMAKE_RANLIB=/usr/local/gcc-$2/bin/gcc-ranlib" +export COMPILER="-DCMAKE_C_COMPILER=/usr/local/gcc-$2/bin/gcc -DCMAKE_CXX_COMPILER=/usr/local/gcc-$2/bin/g++ -DCMAKE_AR=/usr/local/gcc-$2/bin/gcc-ar -DCMAKE_RANLIB=/usr/local/gcc-$2/bin/gcc-ranlib" -cd /p2pool -mkdir build && cd build - -cmake .. -DCMAKE_BUILD_TYPE=Release $COMPILER 1>> /p2pool/output.log 2>&1 -make -j$(nproc) p2pool 1>> /p2pool/output.log 2>&1 -./p2pool --test 1>> /p2pool/output.log 2>&1 - -cd ../tests -mkdir build && cd build -cmake .. -DCMAKE_BUILD_TYPE=Release $COMPILER 1>> /p2pool/output.log 2>&1 -make -j$(nproc) p2pool_tests 1>> /p2pool/output.log 2>&1 -gunzip *.gz -./p2pool_tests 1>> /p2pool/output.log 2>&1 +./test2.sh tar -czvf /p2pool/logs.tar.gz /p2pool/output.log diff --git a/scripts/compiler_tests/gcc/test2.sh b/scripts/compiler_tests/gcc/test2.sh new file mode 100755 index 0000000..6889edd --- /dev/null +++ b/scripts/compiler_tests/gcc/test2.sh @@ -0,0 +1,21 @@ +#!/bin/sh +set -e + +cd /p2pool +mkdir build && cd build + +cmake .. -DCMAKE_BUILD_TYPE=Release $COMPILER 1>> /p2pool/output.log 2>&1 +make -j$(nproc) p2pool 1>> /p2pool/output.log 2>&1 + +./p2pool --test 1>> /p2pool/output.log 2>&1 + +make -j$(nproc) randomx-tests 1>> /p2pool/output.log 2>&1 +external/src/RandomX/randomx-tests 1>> /p2pool/output.log 2>&1 + +cd ../tests +mkdir build && cd build +cmake .. -DCMAKE_BUILD_TYPE=Release $COMPILER 1>> /p2pool/output.log 2>&1 +make -j$(nproc) p2pool_tests 1>> /p2pool/output.log 2>&1 +gunzip *.gz + +./p2pool_tests 1>> /p2pool/output.log 2>&1