Navigation Menu

Skip to content

Commit

Permalink
support SQL test on MySQL 5.5.
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Apr 8, 2011
1 parent 427088b commit c105a16
Showing 1 changed file with 33 additions and 7 deletions.
40 changes: 33 additions & 7 deletions test/run-sql-test.sh
Expand Up @@ -3,17 +3,42 @@
export BASE_DIR="$(cd $(dirname $0); pwd)"
top_dir="$BASE_DIR/.."

if test -z "$MYSQL_SOURCE"; then
MYSQL_SOURCE="$(make -s -C $top_dir echo-mysql-source)"
fi
export MYSQL_SOURCE

if test -z "$MYSQL_BUILD"; then
MYSQL_BUILD="$(make -s -C $BASE_DIR echo-mysql-build)"
MYSQL_BUILD="$(make -s -C $top_dir echo-mysql-build)"
fi
export MYSQL_BUILD

if test -z "$MYSQL_VERSION"; then
MYSQL_VERSEION="$(make -s -C $top_dir echo-mysql-version)"
fi
export MYSQL_VERSION

test_suite_name="groonga"
local_groonga_mysql_test_suite_dir="${BASE_DIR}/sql"
mysql_test_dir="${MYSQL_BUILD}/mysql-test"
test_suites_dir="${mysql_test_dir}/suite"
groonga_mysql_test_suite_dir="${test_suites_dir}/${test_suite_name}"
plugins_dir="${MYSQL_BUILD}/lib/mysql/plugin"
source_mysql_test_dir="${MYSQL_SOURCE}/mysql-test"
build_mysql_test_dir="${MYSQL_BUILD}/mysql-test"
source_test_suites_dir="${source_mysql_test_dir}/suite"
build_test_suites_dir="${build_mysql_test_dir}/suite"
groonga_mysql_test_suite_dir="${build_test_suites_dir}/${test_suite_name}"
case "${MYSQL_VERSION}" in
5.1)
plugins_dir="${MYSQL_BUILD}/lib/mysql/plugin"
if ! test -d "${build_test_suites_dir}"; then
mkdir -p "${build_test_suites_dir}"
fi
;;
*)
if ! test -d "${build_test_suites_dir}"; then
ln -s "${source_test_suites_dir}" "${build_test_suites_dir}"
fi
plugins_dir="${MYSQL_SOURCE}/lib/plugin"
;;
esac

if ! test -e "${groonga_mysql_test_suite_dir}"; then
ln -s "${local_groonga_mysql_test_suite_dir}" \
Expand All @@ -22,5 +47,6 @@ fi

make -C ${top_dir} install-pluginLTLIBRARIES plugindir=${plugins_dir}

(cd "$mysql_test_dir" && \
./mysql-test-run.pl --no-check-testcases --suite="${test_suite_name}" --force)
(cd "$build_mysql_test_dir" && \
./mysql-test-run.pl --no-check-testcases \
--suite="${test_suite_name}" --force)

0 comments on commit c105a16

Please sign in to comment.