summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMingli Yu <mingli.yu@windriver.com>2024-10-09 10:05:30 +0800
committerArmin Kuster <akuster808@gmail.com>2024-10-13 11:19:42 -0400
commit7f741f817e4b291ec0683743195a4a7de77c1221 (patch)
tree6931381e2023d43ef26a5b754a906b4880334028
parent09d95e03adcad46fce369a5234384cab8231aaa2 (diff)
downloadmeta-openembedded-7f741f817e4b291ec0683743195a4a7de77c1221.tar.gz
rocksdb: Add ptest support
# ./run-ptest PASS: arena_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: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-oe/recipes-dbs/rocksdb/files/run-ptest12
-rw-r--r--meta-oe/recipes-dbs/rocksdb/rocksdb_6.20.3.bb19
2 files changed, 29 insertions, 2 deletions
diff --git a/meta-oe/recipes-dbs/rocksdb/files/run-ptest b/meta-oe/recipes-dbs/rocksdb/files/run-ptest
new file mode 100644
index 0000000000..45406fdfa1
--- /dev/null
+++ b/meta-oe/recipes-dbs/rocksdb/files/run-ptest
@@ -0,0 +1,12 @@
1#!/bin/sh
2ptestdir=$(dirname "$(readlink -f "$0")")
3cd "$ptestdir"/tests || exit
4
5for test in *_test; do
6 if ./${test} >/dev/null 2>&1; then
7 echo "PASS: ${test}"
8 else
9 echo "FAIL: ${test}"
10 fi
11done
12
diff --git a/meta-oe/recipes-dbs/rocksdb/rocksdb_6.20.3.bb b/meta-oe/recipes-dbs/rocksdb/rocksdb_6.20.3.bb
index 2ad2d38a53..8164f856e2 100644
--- a/meta-oe/recipes-dbs/rocksdb/rocksdb_6.20.3.bb
+++ b/meta-oe/recipes-dbs/rocksdb/rocksdb_6.20.3.bb
@@ -18,6 +18,7 @@ SRC_URI = "git://github.com/facebook/${BPN}.git;branch=${SRCBRANCH};protocol=htt
18 file://ppc64.patch \ 18 file://ppc64.patch \
19 file://mips.patch \ 19 file://mips.patch \
20 file://arm.patch \ 20 file://arm.patch \
21 file://run-ptest \
21 " 22 "
22 23
23SRC_URI:append:riscv32 = " file://0001-replace-old-sync-with-new-atomic-builtin-equivalents.patch" 24SRC_URI:append:riscv32 = " file://0001-replace-old-sync-with-new-atomic-builtin-equivalents.patch"
@@ -27,7 +28,7 @@ SRC_URI:remove:toolchain-clang:riscv32 = "file://0001-replace-old-sync-with-new-
27 28
28S = "${WORKDIR}/git" 29S = "${WORKDIR}/git"
29 30
30inherit cmake 31inherit cmake ptest
31 32
32PACKAGECONFIG ??= "bzip2 zlib lz4 gflags" 33PACKAGECONFIG ??= "bzip2 zlib lz4 gflags"
33PACKAGECONFIG[bzip2] = "-DWITH_BZ2=ON,-DWITH_BZ2=OFF,bzip2" 34PACKAGECONFIG[bzip2] = "-DWITH_BZ2=ON,-DWITH_BZ2=OFF,bzip2"
@@ -40,7 +41,7 @@ PACKAGECONFIG[gflags] = "-DWITH_GFLAGS=ON,-DWITH_GFLAGS=OFF,gflags"
40# Tools and tests currently don't compile on armv5 so we disable them 41# Tools and tests currently don't compile on armv5 so we disable them
41EXTRA_OECMAKE = "\ 42EXTRA_OECMAKE = "\
42 -DPORTABLE=ON \ 43 -DPORTABLE=ON \
43 -DWITH_TESTS=OFF \ 44 -DWITH_TESTS=${@bb.utils.contains("DISTRO_FEATURES", "ptest", "ON", "OFF", d)} \
44 -DWITH_BENCHMARK_TOOLS=OFF \ 45 -DWITH_BENCHMARK_TOOLS=OFF \
45 -DWITH_TOOLS=OFF \ 46 -DWITH_TOOLS=OFF \
46 -DFAIL_ON_WARNINGS=OFF \ 47 -DFAIL_ON_WARNINGS=OFF \
@@ -52,7 +53,21 @@ do_install:append() {
52} 53}
53 54
54LDFLAGS:append:riscv64 = " -pthread" 55LDFLAGS:append:riscv64 = " -pthread"
56do_install_ptest() {
57 install -d ${D}${PTEST_PATH}/tests
58 # only cover the basic test as all the tests need to take about 6 hours
59 # time ./run-ptest
60 # real 356m32.956s
61 # user 252m32.004s
62 # sys 178m50.246s
63 install -m 0755 ${B}/env_basic_test ${D}${PTEST_PATH}/tests/
64 install -m 0755 ${B}/db_basic_test ${D}${PTEST_PATH}/tests/
65 install -m 0755 ${B}/arena_test ${D}${PTEST_PATH}/tests/
66 install -m 0755 ${B}/testutil_test ${D}${PTEST_PATH}/tests/
67 install -m 0755 ${B}/cache_test ${D}${PTEST_PATH}/tests/
68}
55 69
56# Need toku_time_now() implemented for ppc/musl 70# Need toku_time_now() implemented for ppc/musl
57# see utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h 71# see utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h
58COMPATIBLE_HOST:libc-musl:powerpc = "null" 72COMPATIBLE_HOST:libc-musl:powerpc = "null"
73COMPATIBLE_HOST:armv5 = 'null'