From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rob Browning Newsgroups: gmane.lisp.guile.devel Subject: [PATCH 7/7] Switch to the preferred parallel automake test harness Date: Fri, 25 Aug 2023 18:17:36 -0500 Message-ID: <20230825231736.955507-8-rlb@defaultvalue.org> References: <20230825231736.955507-1-rlb@defaultvalue.org> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32313"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Sat Aug 26 01:18:54 2023 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qZg4s-0008As-82 for guile-devel@m.gmane-mx.org; Sat, 26 Aug 2023 01:18:54 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZg3m-00050d-8g; Fri, 25 Aug 2023 19:17:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZg3k-0004zg-C7 for guile-devel@gnu.org; Fri, 25 Aug 2023 19:17:44 -0400 Original-Received: from defaultvalue.org ([45.33.119.55]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZg3h-0008LQ-TO for guile-devel@gnu.org; Fri, 25 Aug 2023 19:17:44 -0400 Original-Received: from trouble.defaultvalue.org (localhost [127.0.0.1]) (Authenticated sender: rlb@defaultvalue.org) by defaultvalue.org (Postfix) with ESMTPSA id 93086206A3 for ; Fri, 25 Aug 2023 18:17:37 -0500 (CDT) Original-Received: by trouble.defaultvalue.org (Postfix, from userid 1000) id D7CA414E2A7; Fri, 25 Aug 2023 18:17:36 -0500 (CDT) X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230825231736.955507-1-rlb@defaultvalue.org> Received-SPF: pass client-ip=45.33.119.55; envelope-from=rlb@defaultvalue.org; helo=defaultvalue.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:21932 Archived-At: Here, this allows make -j4 check to run in about half the time that it does with the deprecated serial harness. --- Makefile.am | 3 --- check-guile.in | 5 +--- configure.ac | 5 +--- test-suite/Makefile.am | 18 ++++++++----- test-suite/driver | 60 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 73 insertions(+), 18 deletions(-) create mode 100755 test-suite/driver diff --git a/Makefile.am b/Makefile.am index eb3541c34..b2ac5539e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -85,9 +85,6 @@ EXTRA_DIST = LICENSE HACKING GUILE-VERSION \ .guix/modules/guile-package.scm \ .guix/manifest.scm -TESTS = check-guile -TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ - ACLOCAL_AMFLAGS = -I m4 CLEANFILES = libguile/guile-procedures.txt diff --git a/check-guile.in b/check-guile.in index 31bdce340..137fe6d40 100644 --- a/check-guile.in +++ b/check-guile.in @@ -25,10 +25,7 @@ fi export GUILE_LOAD_PATH="$TEST_SUITE_DIR" -if [ -f "$guile" -a -x "$guile" ] ; then - echo "Testing $guile ..." "$@" - echo "with GUILE_LOAD_PATH=$GUILE_LOAD_PATH" -else +if ! [ -f "$guile" -a -x "$guile" ] ; then echo "ERROR: Cannot execute $guile" 1>&2 exit 2 fi diff --git a/configure.ac b/configure.ac index d0a2dc79b..28f5d4166 100644 --- a/configure.ac +++ b/configure.ac @@ -33,11 +33,8 @@ AC_CONFIG_SRCDIR(GUILE-VERSION) AC_CANONICAL_TARGET -dnl Use `serial-tests' so the output `check-guile' is not hidden -dnl (`parallel-tests' is the default in Automake 1.13.) -dnl `serial-tests' was introduced in Automake 1.12. AM_INIT_AUTOMAKE([1.12 gnu no-define -Wall -Wno-override \ - serial-tests color-tests dist-lzip dist-xz]) + color-tests dist-lzip dist-xz]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], [AC_SUBST([AM_DEFAULT_VERBOSITY],1)]) AC_COPYRIGHT(GUILE_CONFIGURE_COPYRIGHT) diff --git a/test-suite/Makefile.am b/test-suite/Makefile.am index 81e63bce2..b00d598a5 100644 --- a/test-suite/Makefile.am +++ b/test-suite/Makefile.am @@ -77,9 +77,7 @@ SCM_TESTS = tests/00-initial-env.test \ tests/list.test \ tests/load.test \ tests/match.test \ - tests/match.test.upstream \ tests/modules.test \ - tests/multilingual.nottest \ tests/net-db.test \ tests/numbers.test \ tests/optargs.test \ @@ -93,7 +91,6 @@ SCM_TESTS = tests/00-initial-env.test \ tests/procs.test \ tests/poe.test \ tests/popen.test \ - tests/popen-child.scm \ tests/ports.test \ tests/posix.test \ tests/q.test \ @@ -206,6 +203,9 @@ EXTRA_DIST = \ guile-test \ test-suite/lib.scm \ $(SCM_TESTS) \ + tests/match.test.upstream \ + tests/multilingual.nottest \ + tests/popen-child.scm \ tests/rnrs-test-a.scm \ tests/srfi-64-test.scm \ ChangeLog-2008 @@ -248,9 +248,13 @@ LALR_EXTRA += \ lalr/glr-test.scm \ lalr/run-guile-test.sh -TESTS = $(LALR_TESTS) -TESTS_ENVIRONMENT = \ - @LOCALCHARSET_TESTS_ENVIRONMENT@ \ - $(top_builddir)/meta/guile --no-auto-compile +TESTS = $(LALR_TESTS) $(SCM_TESTS) + +AM_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ +LOG_COMPILER = $(top_builddir)/meta/guile +AM_LOG_FLAGS = --no-auto-compile + +TEST_EXTENSIONS = .test +TEST_LOG_DRIVER = ./driver EXTRA_DIST += $(LALR_EXTRA) $(LALR_TESTS) tests/sxml-match-tests.ss diff --git a/test-suite/driver b/test-suite/driver new file mode 100755 index 000000000..be71a2e63 --- /dev/null +++ b/test-suite/driver @@ -0,0 +1,60 @@ +#!/bin/sh + +set -ue + +script_home="$(cd "$(dirname "$0")" && pwd)" + +usage() +{ + cat <<-EOF + Usage: driver [OPTION ...] -- TEST [ARG ...] + This is a test + Options: + --log-file PATH + --trs-file PATH + --color-tests (yes|no) currently ignored + --expect-failure (yes|no) currently ignored + --enable-hard-errors (yes|no) currently ignored + --test-name NAME currently ignored + + This command provides an Automake parallel test harness + compatible driver for running TEST with Guile. This is + essentially an adapter for check-guile and it currently + assumes that check-guile is in the parent directory. + + EOF +} + +misuse() { usage 1>&2; exit 2; } + +test_name='' +log_file='' +trs_file='' + +while test $# -gt 0; do + case "$1" in + --test-name) test $# -gt 1 || misuse; test_name="$2"; shift 2 ;; + --log-file) test $# -gt 1 || misuse; log_file="$2"; shift 2 ;; + --trs-file) test $# -gt 1 || misuse; trs_file="$2"; shift 2 ;; + --color-tests|--expect-failure|--enable-hard-errors) shift 2 ;; + --) shift; break ;; + *) break ;; + esac +done + +test "$test_name" || misuse +test "$log_file" || misuse +test "$trs_file" || misuse + +test $# -gt 0 || misuse +program="$1" +shift + +# REVIEW: check test-name vs program... + +cd .. + +exec ./check-guile \ + --log-file "test-suite/$log_file" \ + --trs-file "test-suite/$trs_file" \ + "$(basename "$program")" -- 2.39.2