[GRASS-SVN] r74160 - in grass/branches/releasebranch_7_6: lib/python/gunittest/testsuite/data/samplecode/testsuite testsuite/examples

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Mar 6 00:21:43 PST 2019


Author: neteler
Date: 2019-03-06 00:21:43 -0800 (Wed, 06 Mar 2019)
New Revision: 74160

Modified:
   grass/branches/releasebranch_7_6/lib/python/gunittest/testsuite/data/samplecode/testsuite/test_python_unittest.py
   grass/branches/releasebranch_7_6/testsuite/examples/test_framework_GRASS_GIS_with_NC.conf
   grass/branches/releasebranch_7_6/testsuite/examples/test_framework_GRASS_GIS_with_NC.sh
Log:
testsuite: backport r74159; sync testsuite/examples/test_framework_GRASS_GIS_with_NC.* to trunk

Modified: grass/branches/releasebranch_7_6/lib/python/gunittest/testsuite/data/samplecode/testsuite/test_python_unittest.py
===================================================================
--- grass/branches/releasebranch_7_6/lib/python/gunittest/testsuite/data/samplecode/testsuite/test_python_unittest.py	2019-03-06 08:09:07 UTC (rev 74159)
+++ grass/branches/releasebranch_7_6/lib/python/gunittest/testsuite/data/samplecode/testsuite/test_python_unittest.py	2019-03-06 08:21:43 UTC (rev 74160)
@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-from __furute__ import print_function
+from __future__ import print_function
 from unittest import TestCase, main
 
 

Modified: grass/branches/releasebranch_7_6/testsuite/examples/test_framework_GRASS_GIS_with_NC.conf
===================================================================
--- grass/branches/releasebranch_7_6/testsuite/examples/test_framework_GRASS_GIS_with_NC.conf	2019-03-06 08:09:07 UTC (rev 74159)
+++ grass/branches/releasebranch_7_6/testsuite/examples/test_framework_GRASS_GIS_with_NC.conf	2019-03-06 08:21:43 UTC (rev 74160)
@@ -1,14 +1,15 @@
 ### CONFIGURATION
 #
-# computer architecture:
-ARCH=x86_64-pc-linux-gnu
 # name of binary:
 GRASSBIN=grass76
 # source code directory as full path:
-GRASSSRC="$HOME/software/grass76"
+GRASSSRC="$(realpath ../../)"
 # 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
 

Modified: grass/branches/releasebranch_7_6/testsuite/examples/test_framework_GRASS_GIS_with_NC.sh
===================================================================
--- grass/branches/releasebranch_7_6/testsuite/examples/test_framework_GRASS_GIS_with_NC.sh	2019-03-06 08:09:07 UTC (rev 74159)
+++ grass/branches/releasebranch_7_6/testsuite/examples/test_framework_GRASS_GIS_with_NC.sh	2019-03-06 08:21:43 UTC (rev 74160)
@@ -1,7 +1,7 @@
 #!/bin/bash
 ############################################################################
 #
-# MODULE:       r.drain
+# MODULE:       Example script to run testsuite
 # AUTHOR(S):    Markus Neteler, Sören Gebbert, Vaclav Petras
 # PURPOSE:      Test GRASS GIS using the test framework
 #               Documentation:
@@ -26,15 +26,48 @@
 #
 ############################################################################
 
-### CONFIGURATION
+### Fetch CONFIGURATION
 
+CONF="test_framework_GRASS_GIS_with_NC.conf"
 
-source test_framework_GRASS_GIS_with_NC.conf
+usage_msg(){
+echo "Usage:
+  $0 [conf_file]
 
+Example:
+  $0 ./${CONF}
+"
+}
+
+if [ ! -z "$1" ] ; then
+   case "$1" in
+      -h | --h | -help | --help)
+         usage_msg
+         exit 0
+         ;;
+      *)
+         if [ -f ${1} ] ; then
+            CONF="$1"
+         else
+            echo "ERROR: $1 is not a file"
+            exit 1
+         fi
+         ;;
+    esac
+else
+    usage_msg
+    exit 0
+fi
+
+source ${CONF}
+
 ######### nothing to change below
 
 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}"
@@ -49,8 +82,11 @@
 
 # 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
@@ -79,8 +115,11 @@
 g.copy raster=geology_30m,geology
 g.copy raster=landuse96_28m,landuse
 g.copy raster=soilsID,soils
+g.copy vector=census_wake2000,census
+g.copy vector=elev_lid792_bepts,elev_points
 g.copy vector=zipcodes_wake,zipcodes
 g.copy vector=schools_wake,schools
+g.copy vector=streets_wake,streets
 " > $GRASSDATA/tmp_rename.sh
 $GRASSBIN $GRASSDATA/nc_spm_08_grass7/PERMANENT --exec sh $GRASSDATA/tmp_rename.sh
 rm -f $GRASSDATA/tmp_rename.sh



More information about the grass-commit mailing list