This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

patch to have "make check" invoke test-suite/guile-test


hello guile folks,

please see below for an incomplete[1] patch that allows "make check" to
invoke test-suite/guile-test.  we introduce a new top-level script
called "test-guile" and call it from "make check".

here is a top-level ChangeLog entry:

2000-03-24  Thien-Thi Nguyen  <ttn@gnu.org>

	* Makefile.am (TESTS): New automake var.
	* configure.in (test_suite_dir): New substituted var.
	(AC_OUTPUT): Add test-guile.

here is a ChangeLog entry for subdir test-suite:

2000-03-24  Thien-Thi Nguyen  <ttn@gnu.org>

	* paths.scm (datadir): Allow override by env var
	`TEST_SUITE_DIR'.
	* guile-test (main): Add local var `global-pass',
	register a reporter to modify it on "fail" or "xpass",
	and use it as exit status.

[1] the test-guile script is not included in the patch because i don't
know how to get cvs diff to recognize it as (a to-be-) part of the
source tree.  i will submit that next, with more info.

thi



---------------------------------------------
cd ~/build/.gnu/guile-core/
cvs diff
cvs server: Diffing .
Index: Makefile.am
===================================================================
RCS file: /cvs/guile/guile/guile-core/Makefile.am,v
retrieving revision 1.16
diff -c -p -w -r1.16 Makefile.am
*** Makefile.am	2000/01/09 21:46:51	1.16
--- Makefile.am	2000/03/24 21:00:18
***************
*** 22,24 ****
--- 22,26 ----
  SUBDIRS = ice-9 qt libltdl libguile guile-config guile-readline doc
  
  EXTRA_DIST = qthreads.m4 HACKING GUILE-VERSION ANON-CVS SNAPSHOTS
+ 
+ TESTS = test-guile
Index: configure.in
===================================================================
RCS file: /cvs/guile/guile/guile-core/configure.in,v
retrieving revision 1.112
diff -c -p -w -r1.112 configure.in
*** configure.in	2000/03/13 11:09:46	1.112
--- configure.in	2000/03/24 21:00:18
*************** AC_SUBST(GUILE_LIBS)
*** 497,503 ****
  AC_SUBST(AWK)
  AC_SUBST(LIBLOBJS)
  
! 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 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])
  
  dnl Local Variables:
  dnl comment-start: "dnl "
--- 497,512 ----
  AC_SUBST(AWK)
  AC_SUBST(LIBLOBJS)
  
! #--------------------------------------------------------------------
! #
! # 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 qt/Makefile qt/qt.h qt/md/Makefile qt/time/Makefile guile-config/Makefile doc/Makefile test-guile], [chmod +x libguile/guile-snarf libguile/guile-doc-snarf libguile/guile-func-name-check test-guile])
  
  dnl Local Variables:
  dnl comment-start: "dnl "
cvs server: Diffing devel
cvs server: Diffing devel/policy
cvs server: Diffing doc
cvs server: Diffing doc/example-smob
cvs server: Diffing emacs
cvs server: Diffing guile-config
cvs server: Diffing guile-readline
Index: test-suite/guile-test
===================================================================
RCS file: /cvs/guile/guile/guile-core/test-suite/guile-test,v
retrieving revision 1.1
diff -c -p -w -r1.1 guile-test
*** guile-test	1999/05/29 14:22:19	1.1
--- guile-test	2000/03/24 21:00:18
***************
*** 29,35 ****
  ;;;; 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'.
  ;;;;
  ;;;; Normally, guile-test scans the test directory, and executes all
  ;;;; files whose names end in `.test'.  (It assumes they contain
--- 29,36 ----
  ;;;; 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'.  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
***************
*** 44,49 ****
--- 45,51 ----
  ;;;; 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.
+ ;;;; You can also set the environment var `TEST_SUITE_DIR' to set datadir.
  ;;;;
  ;;;; Shortcomings:
  ;;;;
***************
*** 136,145 ****
        (let ((log-port (open-output-file log-file)))
  
  	;; Register some reporters.
! 	(let ((counter (make-count-reporter)))
  	  (register-reporter (car counter))
  	  (register-reporter (make-log-reporter log-port))
  	  (register-reporter user-reporter)
  
  	  ;; Run the tests.
  	  (for-each (lambda (test)
--- 138,151 ----
        (let ((log-port (open-output-file log-file)))
  
  	;; Register some reporters.
! 	(let ((global-pass #t)          ; aka "low-granularity cynicsm"
!               (counter (make-count-reporter)))
  	  (register-reporter (car counter))
  	  (register-reporter (make-log-reporter log-port))
  	  (register-reporter user-reporter)
+           (register-reporter (lambda (result)
+                                (case (car result)
+                                  ((fail xpass) (set! global-pass #f)))))
  
  	  ;; Run the tests.
  	  (for-each (lambda (test)
***************
*** 154,160 ****
  	    (print-counts counts)
  	    (print-counts counts log-port))
  
! 	  (close-port log-port))))))
  
  
  ;;; Local Variables:
--- 160,167 ----
  	    (print-counts counts)
  	    (print-counts counts log-port))
  
! 	  (close-port log-port)
!           (quit global-pass))))))
  
  
  ;;; Local Variables:
Index: test-suite/paths.scm
===================================================================
RCS file: /cvs/guile/guile/guile-core/test-suite/paths.scm,v
retrieving revision 1.4
diff -c -p -w -r1.4 paths.scm
*** paths.scm	2000/01/16 22:03:41	1.4
--- paths.scm	2000/03/24 21:00:18
***************
*** 1,2 ****
  (define-module (test-suite paths))
! (define-public datadir (string-append (getenv "HOME") "/guile-core/test-suite"))
--- 1,4 ----
  (define-module (test-suite paths))
! (define-public datadir
!   (or (getenv "TEST_SUITE_DIR")
!       (string-append (getenv "HOME") "/guile-core/test-suite")))
cvs server: Diffing test-suite/tests
cvs server: Diffing test-suite/tests/c-api

Compilation exited abnormally with code 1 at Fri Mar 24 12:59:37

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]