diff options
| author | Mingli Yu <mingli.yu@windriver.com> | 2024-10-09 10:05:30 +0800 |
|---|---|---|
| committer | Armin Kuster <akuster808@gmail.com> | 2024-10-13 11:19:42 -0400 |
| commit | 7f741f817e4b291ec0683743195a4a7de77c1221 (patch) | |
| tree | 6931381e2023d43ef26a5b754a906b4880334028 | |
| parent | 09d95e03adcad46fce369a5234384cab8231aaa2 (diff) | |
| download | meta-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-ptest | 12 | ||||
| -rw-r--r-- | meta-oe/recipes-dbs/rocksdb/rocksdb_6.20.3.bb | 19 |
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 | ||
| 2 | ptestdir=$(dirname "$(readlink -f "$0")") | ||
| 3 | cd "$ptestdir"/tests || exit | ||
| 4 | |||
| 5 | for test in *_test; do | ||
| 6 | if ./${test} >/dev/null 2>&1; then | ||
| 7 | echo "PASS: ${test}" | ||
| 8 | else | ||
| 9 | echo "FAIL: ${test}" | ||
| 10 | fi | ||
| 11 | done | ||
| 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 | ||
| 23 | SRC_URI:append:riscv32 = " file://0001-replace-old-sync-with-new-atomic-builtin-equivalents.patch" | 24 | SRC_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 | ||
| 28 | S = "${WORKDIR}/git" | 29 | S = "${WORKDIR}/git" |
| 29 | 30 | ||
| 30 | inherit cmake | 31 | inherit cmake ptest |
| 31 | 32 | ||
| 32 | PACKAGECONFIG ??= "bzip2 zlib lz4 gflags" | 33 | PACKAGECONFIG ??= "bzip2 zlib lz4 gflags" |
| 33 | PACKAGECONFIG[bzip2] = "-DWITH_BZ2=ON,-DWITH_BZ2=OFF,bzip2" | 34 | PACKAGECONFIG[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 |
| 41 | EXTRA_OECMAKE = "\ | 42 | EXTRA_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 | ||
| 54 | LDFLAGS:append:riscv64 = " -pthread" | 55 | LDFLAGS:append:riscv64 = " -pthread" |
| 56 | do_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 |
| 58 | COMPATIBLE_HOST:libc-musl:powerpc = "null" | 72 | COMPATIBLE_HOST:libc-musl:powerpc = "null" |
| 73 | COMPATIBLE_HOST:armv5 = 'null' | ||
