[Groonga-mysql-commit] mroonga/mroonga [master] test: use the same number of processes as CPU cores

Back to archive index

null+****@clear***** null+****@clear*****
2012年 8月 9日 (木) 23:06:27 JST


Kouhei Sutou	2012-08-09 23:06:27 +0900 (Thu, 09 Aug 2012)

  New Revision: 1de28befd7e251f05cb2e17b7e5fa040d1c581e4
  https://github.com/mroonga/mroonga/commit/1de28befd7e251f05cb2e17b7e5fa040d1c581e4

  Log:
    test: use the same number of processes as CPU cores

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

  Modified: test/run-sql-test.sh (+17 -12)
===================================================================
--- test/run-sql-test.sh    2012-08-09 23:02:03 +0900 (951c92e)
+++ test/run-sql-test.sh    2012-08-09 23:06:27 +0900 (e4ff248)
@@ -3,19 +3,24 @@
 export BASE_DIR="$(cd $(dirname $0); pwd)"
 top_dir="$BASE_DIR/.."
 
+n_processors=1
+case `uname` in
+    Linux)
+	n_processors="$(grep '^processor' /proc/cpuinfo | wc -l)"
+	;;
+    Darwin)
+	n_processors="$(/usr/sbin/sysctl -n hw.ncpu)"
+	;;
+    *)
+	:
+	;;
+esac
+
 if test "$NO_MAKE" != "yes"; then
     MAKE_ARGS=
-    case `uname` in
-	Linux)
-	    MAKE_ARGS="-j$(grep '^processor' /proc/cpuinfo | wc -l)"
-	    ;;
-	Darwin)
-	    MAKE_ARGS="-j$(/usr/sbin/sysctl -n hw.ncpu)"
-	    ;;
-	*)
-	    :
-	    ;;
-    esac
+    if test -n "$n_processors"; then
+	MAKE_ARGS="-j${n_processors}"
+    fi
     make $MAKE_ARGS -C $top_dir > /dev/null || exit 1
 fi
 
@@ -128,7 +133,7 @@ fi
 (cd "$build_mysql_test_dir" && \
     ./mysql-test-run.pl \
     --no-check-testcases \
-    --parallel=4 \
+    --parallel="${n_processors}" \
     --retry=1 \
     --suite="${test_suite_names}" \
     --force \
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
下載 



Groonga-mysql-commit メーリングリストの案内
Back to archive index