diff options
author | matoro <matoro@users.noreply.github.com> | 2022-09-22 15:35:13 -0400 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-09-25 02:27:17 +0100 |
commit | c3b7a85534d328b640cad626286d0e1e6a883467 (patch) | |
tree | 6ed49621422a44a163e948254d82ee5f8ff45365 /dev-db/mariadb-connector-c | |
parent | dev-libs/libbpf: fix libdir (diff) | |
download | gentoo-c3b7a85534d328b640cad626286d0e1e6a883467.tar.gz gentoo-c3b7a85534d328b640cad626286d0e1e6a883467.tar.bz2 gentoo-c3b7a85534d328b640cad626286d0e1e6a883467.zip |
dev-db/mariadb-connector-c: enable tests
Bug: https://bugs.gentoo.org/729944
Closes: https://github.com/gentoo/gentoo/pull/27398
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-db/mariadb-connector-c')
-rw-r--r-- | dev-db/mariadb-connector-c/mariadb-connector-c-3.2.5.ebuild | 24 | ||||
-rw-r--r-- | dev-db/mariadb-connector-c/mariadb-connector-c-9999.ebuild | 24 |
2 files changed, 48 insertions, 0 deletions
diff --git a/dev-db/mariadb-connector-c/mariadb-connector-c-3.2.5.ebuild b/dev-db/mariadb-connector-c/mariadb-connector-c-3.2.5.ebuild index f5de26435990..17e775c57359 100644 --- a/dev-db/mariadb-connector-c/mariadb-connector-c-3.2.5.ebuild +++ b/dev-db/mariadb-connector-c/mariadb-connector-c-3.2.5.ebuild @@ -43,12 +43,28 @@ DEPEND="sys-libs/zlib:=[${MULTILIB_USEDEP}] ) ) " +BDEPEND="test? ( dev-db/mariadb[server] )" RDEPEND="${DEPEND}" PATCHES=( "${FILESDIR}"/gentoo-layout-3.0.patch "${FILESDIR}"/${PN}-3.1.3-fix-pkconfig-file.patch ) +src_prepare() { + # These tests the remote_io plugin which requires network access + sed -i 's/{"test_remote1", test_remote1, TEST_CONNECTION_NEW, 0, NULL, NULL},//g' "unittest/libmariadb/misc.c" || die + + # These tests don't work with --skip-grant-tables + sed -i 's/{"test_conc366", test_conc366, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},//g' "unittest/libmariadb/connection.c" || die + sed -i 's/{"test_conc66", test_conc66, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},//g' "unittest/libmariadb/connection.c" || die + + # [Warning] Aborted connection 2078 to db: 'test' user: 'root' host: '' (Got an error reading communication packets) + # Not sure about this one - might also require network access + sed -i 's/{"test_default_auth", test_default_auth, TEST_CONNECTION_NONE, 0, NULL, NULL},//g' "unittest/libmariadb/connection.c" || die + + cmake_src_prepare +} + multilib_src_configure() { # bug 508724 mariadb cannot use ld.gold tc-ld-disable-gold @@ -70,6 +86,14 @@ multilib_src_configure() { cmake_src_configure } +multilib_src_test() { + mkdir -vp "${T}/mysql/data" || die + mysql_install_db --no-defaults --datadir="${T}/mysql/data" || die + mysqld --no-defaults --datadir="${T}/mysql/data" --socket="${T}/mysql/mysql.sock" --skip-grant-tables --skip-networking & + while ! mysqladmin ping --socket="${T}/mysql/mysql.sock" --silent ; do sleep 1 ; done + cd unittest/libmariadb && MYSQL_TEST_SOCKET="${T}/mysql/mysql.sock" MARIADB_CC_TEST=1 ctest --verbose || die +} + multilib_src_install_all() { if ! use static-libs ; then find "${ED}" -name "*.a" -delete || die diff --git a/dev-db/mariadb-connector-c/mariadb-connector-c-9999.ebuild b/dev-db/mariadb-connector-c/mariadb-connector-c-9999.ebuild index f31b6bb77e17..9799342c7442 100644 --- a/dev-db/mariadb-connector-c/mariadb-connector-c-9999.ebuild +++ b/dev-db/mariadb-connector-c/mariadb-connector-c-9999.ebuild @@ -43,12 +43,28 @@ DEPEND="sys-libs/zlib:=[${MULTILIB_USEDEP}] ) ) " +BDEPEND="test? ( dev-db/mariadb[server] )" RDEPEND="${DEPEND}" PATCHES=( "${FILESDIR}"/gentoo-layout-3.0.patch "${FILESDIR}"/${PN}-3.1.3-fix-pkconfig-file.patch ) +src_prepare() { + # These tests the remote_io plugin which requires network access + sed -i 's/{"test_remote1", test_remote1, TEST_CONNECTION_NEW, 0, NULL, NULL},//g' "unittest/libmariadb/misc.c" || die + + # These tests don't work with --skip-grant-tables + sed -i 's/{"test_conc366", test_conc366, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},//g' "unittest/libmariadb/connection.c" || die + sed -i 's/{"test_conc66", test_conc66, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},//g' "unittest/libmariadb/connection.c" || die + + # [Warning] Aborted connection 2078 to db: 'test' user: 'root' host: '' (Got an error reading communication packets) + # Not sure about this one - might also require network access + sed -i 's/{"test_default_auth", test_default_auth, TEST_CONNECTION_NONE, 0, NULL, NULL},//g' "unittest/libmariadb/connection.c" || die + + cmake_src_prepare +} + multilib_src_configure() { # bug 508724 mariadb cannot use ld.gold tc-ld-disable-gold @@ -70,6 +86,14 @@ multilib_src_configure() { cmake_src_configure } +multilib_src_test() { + mkdir -vp "${T}/mysql/data" || die + mysql_install_db --no-defaults --datadir="${T}/mysql/data" || die + mysqld --no-defaults --datadir="${T}/mysql/data" --socket="${T}/mysql/mysql.sock" --skip-grant-tables --skip-networking & + while ! mysqladmin ping --socket="${T}/mysql/mysql.sock" --silent ; do sleep 1 ; done + cd unittest/libmariadb && MYSQL_TEST_SOCKET="${T}/mysql/mysql.sock" MARIADB_CC_TEST=1 ctest --verbose || die +} + multilib_src_install_all() { if ! use static-libs ; then find "${ED}" -name "*.a" -delete || die |