Преглед на файлове

test_framework_GRASS_GIS_with_NC.sh: autodetect ARCH; customizable FREECPU

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@73997 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler преди 6 години
родител
ревизия
7cf397accf
променени са 2 файла, в които са добавени 11 реда и са изтрити 4 реда
  1. 3 2
      testsuite/examples/test_framework_GRASS_GIS_with_NC.conf
  2. 8 2
      testsuite/examples/test_framework_GRASS_GIS_with_NC.sh

+ 3 - 2
testsuite/examples/test_framework_GRASS_GIS_with_NC.conf

@@ -1,7 +1,5 @@
 ### CONFIGURATION
 #
-# computer architecture:
-ARCH=x86_64-pc-linux-gnu
 # name of binary:
 GRASSBIN=grass77
 # source code directory as full path:
@@ -9,6 +7,9 @@ GRASSSRC="$HOME/software/grass77"
 # temporary grassdata directory
 GRASSDATA="$HOME/grassdata/tests-grassdata"
 
+# leave 1 or more CPU free for other usage than testing
+FREECPU=1
+
 # Python binary to be used (python|python3)
 PYTHON=python
 

+ 8 - 2
testsuite/examples/test_framework_GRASS_GIS_with_NC.sh

@@ -65,6 +65,9 @@ source ${CONF}
 
 set -e  # fail fast
 
+# computer architecture:
+ARCH=`${GRASSBIN} --config arch`
+
 # here we suppose default compilation settings of GRASS GIS and no make install
 GRASSBIN="$GRASSSRC/bin.${ARCH}/${GRASSBIN}"
 GRASSDIST="$GRASSSRC/dist.${ARCH}"
@@ -79,8 +82,11 @@ NOW=$(date $DATE_FLAGS)
 
 # get number of processors of current machine
 MYNPROC=`getconf _NPROCESSORS_ONLN`
-# leave one PROC free for other tasks
-GCCTHREADS=`expr $MYNPROC - 1`
+# leave some free for other tasks
+GCCTHREADS=`expr $MYNPROC - $FREECPU`
+if [ $GCCTHREADS -lt 1 ] ; then
+   GCCTHREADS=1
+fi
 
 # contains last executed command stdout and stderr
 # here were rely on reports being absolute