[Pkg-octave-commit] [octave-pkg-dev] 05/07: check-pkg: Collect all the results into an temporary file

Rafael Laboissiere rafael at debian.org
Wed Aug 30 14:10:52 UTC 2017


This is an automated email from the git hooks/post-receive script.

rafael pushed a commit to branch master
in repository octave-pkg-dev.

commit 0bdf744df3f3673565a70932fb7d59fec6996049
Author: Rafael Laboissiere <rafael at debian.org>
Date:   Wed Aug 30 10:57:43 2017 -0300

    check-pkg: Collect all the results into an temporary file
---
 check-pkg | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/check-pkg b/check-pkg
index d2eaae4..0b6f610 100755
--- a/check-pkg
+++ b/check-pkg
@@ -7,8 +7,10 @@ echo Checking package...
 unit_test_regex='^%!\(assert\|test\|error\|fail\|xtest\|warning\)'
 
 # Extract tests from installed m files
-tmp=$(tempfile)
-cat >$tmp <<EOF
+tmp_script=$(tempfile)
+tmp_results=$(tempfile)
+cat >$tmp_script <<EOF
+fid = fopen ("$tmp_results", "w");
 disp ('echo Checking m files ...');
 addpath (genpath (sprintf ('%s/debian', pwd ())));
 [usr_pkg, sys_pkg] = pkg ('list');
@@ -19,7 +21,7 @@ EOF
 for f in $(find inst/ -name \*.m $excluded_files_expr	| grep -v /private/) ; do
     if grep -q "$unit_test_regex" $f ; then
         stem=$(echo $f | sed 's:[^@]*/::;s/\.m$//')
-	cat >>$tmp <<EOF
+	cat >>$tmp_script <<EOF
 disp ("[$stem]");
 [npass, ntest, nxfail, nskip] = test ("$stem",
                                       ifelse (strcmp ("$OCTPKG_TEST_OPT", ""),
@@ -27,6 +29,7 @@ disp ("[$stem]");
 printf ("%d test%s, %d passed, %d known failure%s, %d skipped\n",
         ntest, ifelse (ntest > 1, "s", ""), npass, nxfail,
 	ifelse (nxfail > 1, "s", ""), nskip);
+fprintf (fid, "%s %d %d %d %d\n", "$stem", ntest, npass, nxfail, nskip);
 EOF
     fi
 done
@@ -39,7 +42,7 @@ done
 # directives)
 
 # We deactivate the warning about relative paths used for the PKG_ADD file.
-cat >>$tmp <<EOF
+cat >>$tmp_script <<EOF
 disp ('echo Checking CC files ...');
 addpath (genpath (pwd (), '.pc'));
 [usr_pkg, sys_pkg] = pkg ('list');
@@ -49,17 +52,17 @@ endfor
 warning ('off', 'Octave:autoload-relative-file-name');
 EOF
 if [ -f PKG_ADD ] ; then
-    echo "source('PKG_ADD');" >> $tmp
+    echo "source('PKG_ADD');" >> $tmp_script
 fi
 if [ -f PKG_ADD.bak ] ; then
-    echo "source('PKG_ADD.bak');" > $tmp
+    echo "source('PKG_ADD.bak');" > $tmp_script
 fi
 if [ -d src ] ; then
     for f in $(find src/ -name \*.cc $excluded_files_expr) ; do
         if grep -q "$unit_test_regex" $f ; then
             stem=${f%%.cc}
             stem=${stem##*/}
-	cat >>$tmp <<EOF
+	cat >>$tmp_script <<EOF
 disp ("[$stem]");
 [npass, ntest, nxfail, nskip] = test ("$stem",
                                       ifelse (strcmp ("$OCTPKG_TEST_OPT", ""),
@@ -67,12 +70,14 @@ disp ("[$stem]");
 printf ("%d test%s, %d passed, %d known failure%s, %d skipped\n",
         ntest, ifelse (ntest > 1, "s", ""), npass, nxfail,
 	ifelse (nxfail > 1, "s", ""), nskip);
+fprintf (fid, "%s %d %d %d %d\n", "$stem", ntest, npass, nxfail, nskip);
 EOF
         fi
     done
+    echo "fclose (fid);" >>$tmp_script
 fi
-$OCTPKG_TEST_ENV $octave $octave_options $tmp
-rm -f $tmp
+$OCTPKG_TEST_ENV $octave $octave_options $tmp_script
+rm -f $tmp_script
 
 if [ -f debian/check.m ] ; then
     $OCTPKG_TEST_ENV $octave $octave_options --eval	\

-- 
Alioth's /home/groups/pkg-octave/bin/git-commit-notice on /srv/git.debian.org/git/pkg-octave/octave-pkg-dev.git



More information about the Pkg-octave-commit mailing list