;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 Ricardo Wurmus ;;; Copyright © 2017 Mathieu Othacehe ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (test-cran) #:use-module (gnu packages statistics) #:use-module (guix import cran) #:use-module (guix tests) #:use-module (srfi srfi-1) #:use-module (srfi srfi-64) #:use-module (srfi srfi-26) #:use-module (ice-9 match)) (define description " Package: My-Example Type: Package Title: Example package Version: 1.2.3 Date: 2015-12-10 Author: Ricardo Wurmus Maintainer: Guix Schmeeks URL: http://gnu.org/s/my-example Description: This is a long description spanning multiple lines: and it could confuse the parser that there is a colon : on the lines. And: this line continues the description. biocViews: 0 SystemRequirements: Cairo (>= 0) Depends: A C++11 compiler. Version 4.6.* of g++ (as currently in Rtools) is insufficient; versions 4.8.*, 4.9.* or later will be fine. License: GPL (>= 3) Imports: Rcpp (>= 0.11.5), proto, Scales LinkingTo: Rcpp, BH NeedsCompilation: yes Repository: CRAN Date/Publication: 2015-07-14 14:15:16 ") (define description-alist (description->alist description)) (define simple-alist '(("Key" . "Value") ("SimpleList"
#!/bin/sh
exec guile --no-auto-compile -e main -s "$0" "$@"
!#
;;;; test-driver.scm - Guile test driver for Automake testsuite harness

(define script-version "2023-12-08.14") ;UTC

;;; Copyright © 2015, 2016 Mathieu Lirzin <mthl@gnu.org>
;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;;
;;; This program is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program.  If not, see <http://www.gnu.org/licenses/>.

;;;; Commentary:
;;;
;;; This script provides a Guile test driver using the SRFI-64 Scheme API for
;;; test suites.  SRFI-64 is distributed with Guile since version 2.0.9.
;;;
;;;; Code:

(use-modules (ice-9 format)
             (ice-9 getopt-long)
             (ice-9 pretty-print)
             (ice-9 regex)
             (srfi srfi-1)
             (srfi srfi-19)
             (srfi srfi-26)
             (srfi srfi-64))

(define (show-help)
  (display "Usage:
   test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
               [--expect-failure={yes|no}] [--color-tests={yes|no}]
               [--select=REGEXP] [--exclude=REGEXP] [--errors-only={yes|no}]
               [--enable-hard-errors={yes|no}] [--brief={yes|no}}]
               [--show-duration={yes|no}] [--]
               TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
The '--test-name' option is mandatory.  The '--select' and '--exclude' options
allow selecting or excluding individual test cases via a regexp, respectively.
The '--errors-only' option can be set to \"yes\" to limit the logged test case
metadata to only those test cases that failed.  When set to \"yes\", the
'--brief' option disables printing the individual test case result to the
console.  When '--show-duration' is set to \"yes\", the time elapsed per test
case is shown.\n"))

(define %options
  '((test-name                 (value #t))
    (log-file                  (value #t))
    (trs-file                  (value #t))
    (select                    (value #t))
    (exclude                   (value #t))
    (errors-only               (value #t))
    (color-tests               (value #t))
    (expect-failure            (value #t)) ;XXX: not implemented yet
    (enable-hard-errors        (value #t)) ;not implemented in SRFI-64
    (brief                     (value #t))
    (show-duration             (value #t))
    (help    (single-char