guile-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

guile/guile-core THANKS ChangeLog Makefile.am c...


From: Dirk Herrmann
Subject: guile/guile-core THANKS ChangeLog Makefile.am c...
Date: Fri, 26 Jan 2001 05:44:57 -0800

CVSROOT:        /cvs
Module name:    guile
Changes by:     Dirk Herrmann <address@hidden>  01/01/26 05:44:57

Modified files:
        guile-core     : THANKS ChangeLog Makefile.am configure.in 
        guile-core/test-suite: ChangeLog README guile-test 
Removed files:
        guile-core/test-suite: paths.scm 

Log message:
        * Added Thien-Thi Nguyen's patch to support "make check".

CVSWeb URLs:
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/THANKS.diff?r1=1.160&r2=1.161
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/ChangeLog.diff?r1=1.217&r2=1.218
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/Makefile.am.diff?r1=1.19&r2=1.20
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/configure.in.diff?r1=1.124&r2=1.125
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/test-suite/ChangeLog.diff?r1=1.51&r2=1.52
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/test-suite/README.diff?r1=1.4&r2=1.5
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/test-suite/guile-test.diff?r1=1.2&r2=1.3
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/test-suite/paths.scm.diff?r1=1.4&r2=NONE

Patches:
Index: guile/guile-core/ChangeLog
diff -u guile/guile-core/ChangeLog:1.217 guile/guile-core/ChangeLog:1.218
--- guile/guile-core/ChangeLog:1.217    Tue Nov 21 09:32:38 2000
+++ guile/guile-core/ChangeLog  Fri Jan 26 05:44:56 2001
@@ -1,3 +1,13 @@
+2001-01-26  Dirk Herrmann  <address@hidden>
+
+       The following patch was sent by Thien-Thi Nguyen.
+
+       * check-guile.in:  New file.
+
+       * Makefile.am:  Add TESTS rule.
+
+       * configure.in:  Add support for "make check".
+
 2000-11-21  Dirk Herrmann  <address@hidden>
 
        * acconfig.h:  Removed bogus #ifndef.  Thanks to Lars J. Aas.
Index: guile/guile-core/Makefile.am
diff -u guile/guile-core/Makefile.am:1.19 guile/guile-core/Makefile.am:1.20
--- guile/guile-core/Makefile.am:1.19   Wed Oct 25 07:45:36 2000
+++ guile/guile-core/Makefile.am        Fri Jan 26 05:44:57 2001
@@ -25,5 +25,7 @@
 
 EXTRA_DIST = qthreads.m4 HACKING GUILE-VERSION ANON-CVS SNAPSHOTS
 
+TESTS = check-guile
+
 # The rule will cd to $(top_srcdir).
 ACLOCAL = ./guile-aclocal.sh
Index: guile/guile-core/THANKS
diff -u guile/guile-core/THANKS:1.160 guile/guile-core/THANKS:1.161
--- guile/guile-core/THANKS:1.160       Wed Jan 24 08:06:19 2001
+++ guile/guile-core/THANKS     Fri Jan 26 05:44:56 2001
@@ -27,6 +27,7 @@
        Ralf Mattes
       Shuji Narazaki
     Nicolas Neuss
+  Thien-Thi Nguyen
     Han-Wen Nienhuys
       David Pirotte
      Julian Satchell
Index: guile/guile-core/configure.in
diff -u guile/guile-core/configure.in:1.124 guile/guile-core/configure.in:1.125
--- guile/guile-core/configure.in:1.124 Wed Oct 25 07:45:36 2000
+++ guile/guile-core/configure.in       Fri Jan 26 05:44:57 2001
@@ -507,7 +507,11 @@
 AC_SUBST(LIBLOBJS)
 AC_SUBST(EXTRA_DOT_DOC_FILES)
 
-AC_OUTPUT([Makefile libguile/Makefile libguile/guile-snarf 
libguile/guile-doc-snarf libguile/guile-func-name-check 
libguile/guile-snarf.awk libguile/versiondat.h ice-9/Makefile oop/Makefile 
oop/goops/Makefile qt/Makefile qt/qt.h qt/md/Makefile qt/time/Makefile 
guile-config/Makefile doc/Makefile], [chmod +x libguile/guile-snarf 
libguile/guile-doc-snarf libguile/guile-func-name-check])
+# Support for "make check"
+test_suite_dir="`(cd $srcdir ; pwd)`/test-suite"
+AC_SUBST(test_suite_dir)
+
+AC_OUTPUT([Makefile libguile/Makefile libguile/guile-snarf 
libguile/guile-doc-snarf libguile/guile-func-name-check 
libguile/guile-snarf.awk libguile/versiondat.h ice-9/Makefile oop/Makefile 
oop/goops/Makefile qt/Makefile qt/qt.h qt/md/Makefile qt/time/Makefile 
guile-config/Makefile doc/Makefile check-guile], [chmod +x libguile/guile-snarf 
libguile/guile-doc-snarf libguile/guile-func-name-check check-guile])
 
 dnl Local Variables:
 dnl comment-start: "dnl "
Index: guile/guile-core/test-suite/ChangeLog
diff -u guile/guile-core/test-suite/ChangeLog:1.51 
guile/guile-core/test-suite/ChangeLog:1.52
--- guile/guile-core/test-suite/ChangeLog:1.51  Wed Jan 24 13:46:03 2001
+++ guile/guile-core/test-suite/ChangeLog       Fri Jan 26 05:44:57 2001
@@ -1,3 +1,30 @@
+2001-01-26  Dirk Herrmann  <address@hidden>
+
+       The following patch was sent by Thien-Thi Nguyen and a little bit
+       modified by me.
+
+       * guile-test:  Usage and installation comments improved.  Added
+       support for --test-suite and --debug command line options.
+
+       (default-test-suite):  Added to allow for simplified
+       configurability.  No need to load the paths file any more.
+
+       (enable-debug-mode):  New function.  Will be called when the
+       --debug command line option is given.
+
+       (test-root):  Removed.  The test directory has to be fully given.
+       This allows for arbitrarily named test directories.
+
+       (test-file-name, enumerate-tets):  Take the test directory as a
+       paramter instead of using the global variable 'test-root'.
+
+       (main):  Handle the new command line options.  Return an exit code
+       depending on whether all tests came out as expected.
+
+       * README:  Updated.
+
+       * paths.scm:  Removed.
+
 2001-01-24  Gary Houston  <address@hidden>
 
        * tests/ports.test: include (ice-9 rdelim) module.
Index: guile/guile-core/test-suite/README
diff -u guile/guile-core/test-suite/README:1.4 
guile/guile-core/test-suite/README:1.5
--- guile/guile-core/test-suite/README:1.4      Wed Mar 22 13:24:31 2000
+++ guile/guile-core/test-suite/README  Fri Jan 26 05:44:57 2001
@@ -5,13 +5,8 @@
 15 Feb 1999 --- the tests use the (ice-9 and-let*) and (ice-9
 getopt-long) modules, which were added to Guile around then.
 
-To run the test suite, you'll need to:
-- edit the path to the guile interpreter in `guile-test', and 
-- edit the paths in `paths.scm', so `guile-test' can find the test
-  scripts.
-
-Once that's done, you can just run the `guile-test' script.  That
-script has usage instructions in the comments at the top.
+For information about how to run the test suite, read the usage
+instructions in the comments at the top of the guile-test script.
 
 You can reference the file `lib.scm' from your own code as the module
 (test-suite lib); it also has comments at the top and before each
Index: guile/guile-core/test-suite/guile-test
diff -u guile/guile-core/test-suite/guile-test:1.2 
guile/guile-core/test-suite/guile-test:1.3
--- guile/guile-core/test-suite/guile-test:1.2  Mon May  8 10:42:03 2000
+++ guile/guile-core/test-suite/guile-test      Fri Jan 26 05:44:57 2001
@@ -1,4 +1,4 @@
-#!/usr/local/bin/guile \
+#!/home/dirk/bin/guile \
 -e main -s
 !#
 
@@ -23,34 +23,48 @@
 ;;;; Boston, MA 02111-1307 USA
 
 
-
-;;;; Usage: guile-test [--log-file LOG] [TEST ...]
+;;;; Usage: [guile -e main -s] guile-test [OPTIONS] [TEST ...]
 ;;;;
 ;;;; Run tests from the Guile test suite.  Report failures and
 ;;;; unexpected passes to the standard output, along with a summary of
 ;;;; all the results.  Record each reported test outcome in the log
-;;;; file, `guile.log'.
+;;;; file, `guile.log'.  The exit status is #f if any of the tests
+;;;; fail or pass unexpectedly.
 ;;;;
 ;;;; Normally, guile-test scans the test directory, and executes all
 ;;;; files whose names end in `.test'.  (It assumes they contain
 ;;;; Scheme code.)  However, you can have it execute specific tests by
 ;;;; listing their filenames on the command line.
 ;;;;
+;;;; The option '--test-suite' can be given to specify the test
+;;;; directory.  If no such option is given, the test directory is
+;;;; taken from the environment variable TEST_SUITE_DIR (if defined),
+;;;; otherwise a default directory that is hardcoded in this file is 
+;;;; used (see "Installation" below).
+;;;;
 ;;;; If present, the `--log-file LOG' option tells `guile-test' to put
 ;;;; the log output in a file named LOG.
 ;;;;
+;;;; If present, the '--debug' option will enable a debugging mode.
+;;;;
+;;;;
 ;;;; Installation:
 ;;;;
-;;;; Change the #! line at the top of this script to point at the
-;;;; Guile interpreter you want to test.  Edit `test-suite/paths.scm'
-;;;; so that datadir points to the parent directory of the `tests' tree.
+;;;; If you change the #! line at the top of this script to point at
+;;;; the Guile interpreter you want to test, you can call this script
+;;;; as an executable instead of having to pass it as a parameter to
+;;;; guile via "guile -e main -s guile-test".  Further, you can edit
+;;;; the definition of default-test-suite to point to the parent
+;;;; directory of the `tests' tree, which makes it unnecessary to set
+;;;; the environment variable `TEST_SUITE_DIR'.
 ;;;;
+;;;;
 ;;;; Shortcomings:
 ;;;;
 ;;;; At the moment, due to a simple-minded implementation, test files
 ;;;; must live in the test directory, and you must specify their names
 ;;;; relative to the top of the test directory.  If you want to send
-;;;; me a patche that fixes this, but still leaves sane test names in
+;;;; me a patch that fixes this, but still leaves sane test names in
 ;;;; the log file, that would be great.  At the moment, all the tests
 ;;;; I care about are in the test directory, though.
 ;;;;
@@ -59,14 +73,25 @@
 ;;;; change which Guile interpreter you're testing, you need to edit
 ;;;; the #! line at the top of this file, which is stupid.
 
+
+;;; User configurable settings:
+(define default-test-suite
+  (string-append (getenv "HOME") "/guile-core/test-suite"))
+
+
 (use-modules (test-suite lib)
-            (test-suite paths)
             (ice-9 getopt-long)
             (ice-9 and-let*))
 
 
 ;;; General utilities, that probably should be in a library somewhere.
 
+;;; Enable debugging
+(define (enable-debug-mode)
+  (write-line %load-path)
+  (set! %load-verbosely #t)
+  (debug-enable 'backtrace 'debug))
+
 ;;; Traverse the directory tree at ROOT, applying F to the name of
 ;;; each file in the tree, including ROOT itself.  For a subdirectory
 ;;; SUB, if (F SUB) is true, we recurse into SUB.  Do not follow
@@ -93,18 +118,16 @@
                  (visit (string-append root "/" entry))
                  (loop))))))))))
 
-
 
 ;;; The test driver.
 
-(define test-root (in-vicinity datadir "tests"))
+(define (test-file-name test-dir test)
+  (in-vicinity test-dir test))
 
-(define (test-file-name test)
-  (in-vicinity test-root test))
-
 ;;; Return a list of all the test files in the test tree.
-(define (enumerate-tests)
-  (let ((root-len (+ 1 (string-length test-root)))
+(define (enumerate-tests test-dir)
+  
+  (let ((root-len (+ 1 (string-length test-dir)))
        (tests '()))
     (for-each-file (lambda (file)
                     (if (has-suffix? file ".test")
@@ -112,7 +135,7 @@
                                (substring file root-len)))
                           (set! tests (cons short-name tests))))
                     #t)
-                  test-root)
+                  test-dir)
 
     ;; for-each-file presents the files in whatever order it finds
     ;; them in the directory.  We sort them here, so they'll always
@@ -122,29 +145,51 @@
 
 (define (main args)
   (let ((options (getopt-long args
-                             `((log-file (single-char #\l)
-                                         (value #t))))))
+                             `((test-suite 
+                                (single-char #\t)
+                                (value #t))
+                               (log-file 
+                                (single-char #\l)
+                                (value #t))
+                               (debug 
+                                (single-char #\d))))))
     (define (opt tag default)
       (let ((pair (assq tag options)))
        (if pair (cdr pair) default)))
-    (let ((log-file (opt 'log-file "guile.log"))
-         (tests (let ((foo (opt '() '())))
-                  (if (null? foo) (enumerate-tests)
-                      foo))))
+
+    (if (opt 'debug #f)
+       (enable-debug-mode))
+
+    (let* ((test-suite
+           (or (opt 'test-suite #f)
+               (getenv "TEST_SUITE_DIR")
+               default-test-suite))
+          (tests 
+           (let ((foo (opt '() '())))
+             (if (null? foo) 
+                 (enumerate-tests test-suite)
+                 foo)))
+          (log-file 
+           (opt 'log-file "guile.log")))
 
       ;; Open the log file.
       (let ((log-port (open-output-file log-file)))
 
        ;; Register some reporters.
-       (let ((counter (make-count-reporter)))
+       (let ((global-pass #t)
+             (counter (make-count-reporter)))
          (register-reporter (car counter))
          (register-reporter (make-log-reporter log-port))
          (register-reporter user-reporter)
+         (register-reporter (lambda results
+                              (case (car results)
+                                ((fail upass unresolved error)
+                                 (set! global-pass #f)))))
 
          ;; Run the tests.
          (for-each (lambda (test)
                      (with-test-prefix test
-                       (load (test-file-name test))))
+                       (load (test-file-name test-suite test))))
                    tests)
 
          ;; Display the final counts, both to the user and in the log
@@ -153,7 +198,8 @@
            (print-counts counts)
            (print-counts counts log-port))
 
-         (close-port log-port))))))
+         (close-port log-port)
+         (quit global-pass))))))
 
 
 ;;; Local Variables:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]