Skip to content

Commit

Permalink
tests: Move tests into a new directory.
Browse files Browse the repository at this point in the history
In preparation for splitting of the test files into a test logic and
dialect-specific setup parts, the tests are moved into a new directory, `tests'.

The shebangs are removed from all the files.  Only one was actually executable,
so I get the impression they were not invoked like that anyway.  Even
test-all.scm had a note to run it using `csi -s test-all.scm'.  It also
hard-coded the csi location to /usr/local/bin/sci, which is sub-optimal, however
probably the best one can do in chicken.

* manifest.scm: Add coreutils, for dirname.
* test-all.scm: Delete file.
* tests/all: Replacement for test-all.scm, written in shell.
* tests/test-cset.scm: Move from test-cset.scm.
* tests/test-irregex-from-gauche.scm: Move from test-irregex-gauche.scm.
* tests/test-irregex-pcre.scm: Move from test-irregex-pcre.scm.  Remove shebang.
* tests/test-irregex-scsh.scm: Move from test-irregex-scsh.scm.
* tests/test-irregex-utf8.scm: Move from test-irregex-utf8.scm.
* tests/test-irregex.scm: Move from test-irregex.scm.  Change mode to 0644.
Remove shebang.
* tests/README: New file.
  • Loading branch information
graywolf committed Dec 7, 2023
1 parent 7206b7e commit 3de682d
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 31 deletions.
4 changes: 3 additions & 1 deletion manifest.scm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ data structure to be expressed in a concise manner. Pattern matching is found
in several modern languages, notably Standard ML, Haskell and Miranda.")
(license license:public-domain)))

(packages->manifest (list chicken
(packages->manifest (list coreutils

chicken
chicken-matchable
chicken-srfi-1
chicken-test))
21 changes: 0 additions & 21 deletions test-all.scm

This file was deleted.

13 changes: 13 additions & 0 deletions tests/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
This directory contains the tests for irregex.

To execute all tests, run the following script:

./tests/all

This script can be executed from any location, so both ./tests/all and ./all
(assuming you are in tests directory) are valid invocations.

To execute just a specific test suite, run the desired file from the root of the
repository using the appropriate scheme interpret, so for example:

csi -s ./tests/test-irregex-utf8.scm
12 changes: 12 additions & 0 deletions tests/all
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
set -eu

tdir=$(dirname "$0")
root=$tdir/..

cd -- "$root"

for t in tests/test-*.scm; do
printf '* %s:\n' "$t"
csi -s "$t"
done
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

;; derived from Gauche's regex tests
;;; This test suite is derived from Gauche's regex tests.

(cond-expand
(chicken-5 (import srfi-1 test))
Expand Down
2 changes: 0 additions & 2 deletions test-irregex-pcre.scm → tests/test-irregex-pcre.scm
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/local/bin/csi -script

(cond-expand
(chicken-5 (import test))
(else (use test extras utils)))
Expand Down
1 change: 0 additions & 1 deletion test-irregex-scsh.scm → tests/test-irregex-scsh.scm
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

;;; Adapted from SCSH SRE tests by Christoph Hetz

(cond-expand
Expand Down
2 changes: 0 additions & 2 deletions test-irregex-utf8.scm → tests/test-irregex-utf8.scm
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/local/bin/csi -script

(cond-expand
(chicken-5 (import test))
(else (use test extras utils)))
Expand Down
2 changes: 0 additions & 2 deletions test-irregex.scm → tests/test-irregex.scm
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/local/bin/csi -script

(cond-expand
(chicken-5 (import test matchable (chicken format) (chicken port) (chicken io) (rename (chicken string) (string-intersperse string-join))))
(chicken (use test extras utils matchable))
Expand Down

0 comments on commit 3de682d

Please sign in to comment.