[Groonga-mysql-commit] mroonga/mroonga [fix-for-visual-studio] [test] check also link path.

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Oct 4 10:40:20 JST 2012


Kouhei Sutou	2011-11-11 17:07:09 +0900 (Fri, 11 Nov 2011)

  New Revision: 958c8af1f0686f1798809d64ef3e99d2ba8c4b80
  https://github.com/mroonga/mroonga/commit/958c8af1f0686f1798809d64ef3e99d2ba8c4b80

  Log:
    [test] check also link path.

  Modified files:
    test/run-sql-test.sh

  Modified: test/run-sql-test.sh (+21 -4)
===================================================================
--- test/run-sql-test.sh    2011-11-11 16:13:52 +0900 (e637ed5)
+++ test/run-sql-test.sh    2011-11-11 17:07:09 +0900 (10caadb)
@@ -47,18 +47,35 @@ case "${MYSQL_VERSION}" in
 	;;
 esac
 
+same_link_p()
+{
+    src=$1
+    dest=$2
+    if test -L "$dest" -a "$(readlink "$dest")" = "$src"; then
+	return 0
+    else
+	return 1
+    fi
+}
+
 local_groonga_mysql_test_include_dir="${BASE_DIR}/sql/include"
 for test_include_name in $(ls $local_groonga_mysql_test_include_dir | grep '\.inc$'); do
-    if ! test -e "${build_test_include_dir}/${test_include_name}"; then
-        ln -s "${local_groonga_mysql_test_include_dir}/${test_include_name}" \
-	    "${build_test_include_dir}"
+    local_groonga_mysql_test_include="${local_groonga_mysql_test_include_dir}/${test_include_name}"
+    groonga_mysql_test_include="${build_test_include_dir}/${test_include_name}"
+    if ! same_link_p "${local_groonga_mysql_test_include}" \
+			"${groonga_mysql_test_include}"; then
+	rm -f "${groonga_mysql_test_include}"
+        ln -s "${local_groonga_mysql_test_include}" \
+	    "${groonga_mysql_test_include}"
     fi
 done
 
 for test_suite_name in $(echo $test_suite_names | sed -e 's/,/ /g'); do
     local_groonga_mysql_test_suite_dir="${BASE_DIR}/sql/suite/${test_suite_name}"
     groonga_mysql_test_suite_dir="${build_test_suites_dir}/${test_suite_name}"
-    if ! test -e "${groonga_mysql_test_suite_dir}"; then
+    if ! same_link_p "${local_groonga_mysql_test_suite_dir}" \
+			"${groonga_mysql_test_suite_dir}"; then
+	rm -f "${groonga_mysql_test_suite_dir}"
 	ln -s "${local_groonga_mysql_test_suite_dir}" \
 	    "${groonga_mysql_test_suite_dir}"
     fi
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-mysql-commit mailing list
Back to archive index