mirror of
git://git.openembedded.org/meta-openembedded
synced 2026-10-01 13:06:01 +00:00
rocksdb: Add ptest support
# ./run-ptest PASS: agg_merge_test PASS: cache_test PASS: db_basic_test PASS: env_basic_test PASS: testutil_test Signed-off-by: Mingli Yu <mingli.yu@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
parent
d91297efee
commit
c0095bd118
@ -55,6 +55,7 @@ PTESTS_SLOW_META_OE = "\
|
|||||||
fftw \
|
fftw \
|
||||||
libusb-compat \
|
libusb-compat \
|
||||||
rsyslog \
|
rsyslog \
|
||||||
|
rocksdb \
|
||||||
mariadb \
|
mariadb \
|
||||||
poco \
|
poco \
|
||||||
re2 \
|
re2 \
|
||||||
|
|||||||
@ -0,0 +1,42 @@
|
|||||||
|
From 9abf6cd09c60f0be9a85c055dfdf43698f057f73 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Mingli Yu <mingli.yu@windriver.com>
|
||||||
|
Date: Wed, 25 Sep 2024 13:47:37 +0800
|
||||||
|
Subject: [PATCH] CMakeLists.txt: Make the test discovery occur on target
|
||||||
|
|
||||||
|
Set DISCOVERY_MODE to PRE_TEST to delay test discovery until just
|
||||||
|
prior to test execution on the target to fix the build failure as
|
||||||
|
the default POST_BUILD behavior is not desirable in cross-compiling
|
||||||
|
env.
|
||||||
|
|
||||||
|
/build/tmp/work/core2-64-wrs-linux/rocksdb/9.0.0/build/env_basic_test: error while loading shared libraries: libgflags.so.2.2: cannot open shared object file: No such file or directory
|
||||||
|
CMake Error at /build/tmp/work/core2-64-wrs-linux/rocksdb/9.0.0/recipe-sysroot-native/usr/share/cmake-3.30/Modules/GoogleTestAddTests.cmake:112 (message):
|
||||||
|
Error running test executable.
|
||||||
|
|
||||||
|
Path: '/build/tmp/work/core2-64-wrs-linux/rocksdb/9.0.0/build/env_basic_test'
|
||||||
|
Working directory: '/build/tmp/work/core2-64-wrs-linux/rocksdb/9.0.0/build'
|
||||||
|
Result: 127
|
||||||
|
Output:
|
||||||
|
|
||||||
|
Upstream-Status: Inappropriate [oe specific]
|
||||||
|
|
||||||
|
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
|
||||||
|
---
|
||||||
|
CMakeLists.txt | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||||
|
index 403ad1243..f34397798 100644
|
||||||
|
--- a/CMakeLists.txt
|
||||||
|
+++ b/CMakeLists.txt
|
||||||
|
@@ -1502,7 +1502,7 @@ if(WITH_TESTS)
|
||||||
|
)
|
||||||
|
target_link_libraries(${exename}${ARTIFACT_SUFFIX} testutillib${ARTIFACT_SUFFIX} testharness gtest ${THIRDPARTY_LIBS} ${ROCKSDB_LIB})
|
||||||
|
if(NOT "${exename}" MATCHES "db_sanity_test")
|
||||||
|
- gtest_discover_tests(${exename} DISCOVERY_TIMEOUT 120)
|
||||||
|
+ gtest_discover_tests(${exename} DISCOVERY_TIMEOUT 120 DISCOVERY_MODE PRE_TEST)
|
||||||
|
add_dependencies(rocksdb_check ${exename}${ARTIFACT_SUFFIX})
|
||||||
|
endif()
|
||||||
|
endforeach(sourcefile ${TESTS})
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
12
meta-oe/recipes-dbs/rocksdb/files/run-ptest
Normal file
12
meta-oe/recipes-dbs/rocksdb/files/run-ptest
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
ptestdir=$(dirname "$(readlink -f "$0")")
|
||||||
|
cd "$ptestdir"/tests || exit
|
||||||
|
|
||||||
|
for test in *_test; do
|
||||||
|
if ./${test} >/dev/null 2>&1; then
|
||||||
|
echo "PASS: ${test}"
|
||||||
|
else
|
||||||
|
echo "FAIL: ${test}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
@ -18,6 +18,8 @@ SRC_URI = "git://github.com/facebook/${BPN}.git;branch=${SRCBRANCH};protocol=htt
|
|||||||
file://0006-Implement-timer-for-arm-v6.patch \
|
file://0006-Implement-timer-for-arm-v6.patch \
|
||||||
file://0007-Fix-declaration-scope-of-LE_LOAD32-in-crc32c.patch \
|
file://0007-Fix-declaration-scope-of-LE_LOAD32-in-crc32c.patch \
|
||||||
file://static_library_as_option.patch \
|
file://static_library_as_option.patch \
|
||||||
|
file://0001-CMakeLists.txt-Make-the-test-discovery-occur-on-targ.patch \
|
||||||
|
file://run-ptest \
|
||||||
"
|
"
|
||||||
|
|
||||||
SRC_URI:append:riscv32 = " file://0001-replace-old-sync-with-new-atomic-builtin-equivalents.patch"
|
SRC_URI:append:riscv32 = " file://0001-replace-old-sync-with-new-atomic-builtin-equivalents.patch"
|
||||||
@ -27,7 +29,7 @@ SRC_URI:remove:toolchain-clang:riscv32 = "file://0001-replace-old-sync-with-new-
|
|||||||
|
|
||||||
S = "${WORKDIR}/git"
|
S = "${WORKDIR}/git"
|
||||||
|
|
||||||
inherit cmake
|
inherit cmake ptest
|
||||||
|
|
||||||
PACKAGECONFIG ??= "bzip2 zlib lz4 gflags"
|
PACKAGECONFIG ??= "bzip2 zlib lz4 gflags"
|
||||||
PACKAGECONFIG[bzip2] = "-DWITH_BZ2=ON,-DWITH_BZ2=OFF,bzip2"
|
PACKAGECONFIG[bzip2] = "-DWITH_BZ2=ON,-DWITH_BZ2=OFF,bzip2"
|
||||||
@ -40,7 +42,7 @@ PACKAGECONFIG[gflags] = "-DWITH_GFLAGS=ON,-DWITH_GFLAGS=OFF,gflags"
|
|||||||
# Tools and tests currently don't compile on armv5 so we disable them
|
# Tools and tests currently don't compile on armv5 so we disable them
|
||||||
EXTRA_OECMAKE = "\
|
EXTRA_OECMAKE = "\
|
||||||
-DPORTABLE=ON \
|
-DPORTABLE=ON \
|
||||||
-DWITH_TESTS=OFF \
|
-DWITH_TESTS=${@bb.utils.contains("DISTRO_FEATURES", "ptest", "ON", "OFF", d)} \
|
||||||
-DWITH_BENCHMARK_TOOLS=OFF \
|
-DWITH_BENCHMARK_TOOLS=OFF \
|
||||||
-DWITH_TOOLS=OFF \
|
-DWITH_TOOLS=OFF \
|
||||||
-DFAIL_ON_WARNINGS=OFF \
|
-DFAIL_ON_WARNINGS=OFF \
|
||||||
@ -54,6 +56,21 @@ do_install:append() {
|
|||||||
sed -i "s#${RECIPE_SYSROOT}##g" ${D}${libdir}/cmake/rocksdb/RocksDBTargets.cmake
|
sed -i "s#${RECIPE_SYSROOT}##g" ${D}${libdir}/cmake/rocksdb/RocksDBTargets.cmake
|
||||||
}
|
}
|
||||||
|
|
||||||
|
do_install_ptest() {
|
||||||
|
install -d ${D}${PTEST_PATH}/tests
|
||||||
|
# only cover the basic test as all the tests need to take about 6 hours
|
||||||
|
# time ./run-ptest
|
||||||
|
# real 356m32.956s
|
||||||
|
# user 252m32.004s
|
||||||
|
# sys 178m50.246s
|
||||||
|
install -m 0755 ${B}/env_basic_test ${D}${PTEST_PATH}/tests/
|
||||||
|
install -m 0755 ${B}/db_basic_test ${D}${PTEST_PATH}/tests/
|
||||||
|
install -m 0755 ${B}/agg_merge_test ${D}${PTEST_PATH}/tests/
|
||||||
|
install -m 0755 ${B}/testutil_test ${D}${PTEST_PATH}/tests/
|
||||||
|
install -m 0755 ${B}/cache_test ${D}${PTEST_PATH}/tests/
|
||||||
|
}
|
||||||
|
|
||||||
# Need toku_time_now() implemented for ppc/musl
|
# Need toku_time_now() implemented for ppc/musl
|
||||||
# see utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
|
# see utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
|
||||||
COMPATIBLE_HOST:libc-musl:powerpc = "null"
|
COMPATIBLE_HOST:libc-musl:powerpc = "null"
|
||||||
|
COMPATIBLE_HOST:armv5 = 'null'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user