Skip to content

Commit f9b60f2

Browse files
committed
move DO-TEST from medley repo and start development
1 parent 3cf7fef commit f9b60f2

40 files changed

+11669
-0
lines changed

new/filepos/BIG.XCCS

+1
Large diffs are not rendered by default.

new/filepos/BIGGREEK.UTF8

+1
Large diffs are not rendered by default.

new/filepos/BIGGREEK.XCCS

+1
Large diffs are not rendered by default.

new/filepos/FIVE

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
12345

new/filepos/FPTESTS

4.55 KB
Binary file not shown.

new/filepos/GREEK.UTF8

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
aδσγδφβc

new/filepos/GREEK.XCCS

12 Bytes
Binary file not shown.

new/filepos/README

2.66 KB
Binary file not shown.

new/filepos/SHORT.XCCS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
012345X1245

new/filepos/TFP

+495
Large diffs are not rendered by default.

new/filepos/TFP.LCOM

6.91 KB
Binary file not shown.

new/filepos/ZEROONETWO.XCCS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
012

new/maiko/OPCODES

+1,852
Large diffs are not rendered by default.

new/maiko/OPCODES.DFASL

54.8 KB
Binary file not shown.

new/maiko/OPCODES.DFASL.~1~

43.5 KB
Binary file not shown.

new/maiko/OPCODES.DFASL.~2~

54.6 KB
Binary file not shown.

new/maiko/OPCODES.DFASL.~3~

54.8 KB
Binary file not shown.

new/maiko/OPCODES.DFASL.~4~

54.8 KB
Binary file not shown.

new/maiko/OPCODES.TEST

+1,885
Large diffs are not rendered by default.

new/maiko/OPCODES.TEST.BAD

+381
Large diffs are not rendered by default.

new/maiko/OPCODES.TEST.~1~

+1,834
Large diffs are not rendered by default.

new/maiko/OPCODES.TEST.~2~

+1,885
Large diffs are not rendered by default.

new/maiko/TEST-RESULTS.DRIBBLE

+327
Large diffs are not rendered by default.

new/printing/BADFILES.TEST

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(HCFILES "{DSK}<home>larry>ilisp>envos>" "{DSK}<home>larry>medley>tmp>psfiles>")

new/printing/BADFILES.TXT

9.85 KB
Binary file not shown.

new/tools/DO-TEST

36.8 KB
Binary file not shown.

new/tools/DO-TEST.DFASL

26 KB
Binary file not shown.

new/tools/DO-TEST.DFASL.~1~

26 KB
Binary file not shown.

new/tools/DO-TEST.DFASL.~2~

26 KB
Binary file not shown.

new/tools/DO-TEST.IL

+762
Large diffs are not rendered by default.

new/tools/DO-TEST.TEDIT

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Medley
2+
## What File to LoadLoad the file {MEDLEY}internal>DO-TEST.DFASLAll the symbols mentioned in this document are in both the IL: and XCL-TEST: packages, unless otherwise noted.Main Testing Entry Points(DEFTEST name&options forms) [Definer]This is the definer for tests, allowing them to be saved on file-managed files. The test succeeds if the final form returns a non-NIL result. If name&options isn't a list, then it's just the name which can be a symbol or string; symbols are preferred for DEFTEST tests. If you specify options, the CAR of name&options is the name. If you specify :COMPILED in name&options, the test will run only when it has been compiled. Since this test is stored as structure rather than as plain text, any symbols will be package-qualified appropriately. If a test fails or an error occurs during evaluation, a message is printed to `*ERROR-OUTPUT*`.Unless you have DFNFLG set to PROP, the act of defining a test also causes it to be run (so you'll see if your test fails right away).Examples:
3+
``` (DEFTEST ISSUE-1000 ; use issue number in test name (= 3 (+ 1 2))) (DEFTEST (+-OPT :COMPILED) ; A test of the compiler, only makes sense to run compiled. (= 3 (+ 1 1 1))) ; Checking that +'s optimizer does the right thing. (DEFTEST (MS-TEST :INTERPRETED) ; A test of Masterscope, only makes sense interpreted. (TEST-DEFUN FN (X) (FOO X)) (\. IS FOO CALLED BY FN))
4+
```(DEFTESTGROUP name&options forms) [Definer]This is the definer for groups of tests, allowing them to be saved on file-managed files. For associating a group of tests. For instance, a group of tests may all require the same setup and cleanup. If there are any options (see below) then the CAR of name&options is the name and the CDR is a keyword/value list. All forms must be DEFTEST or DO-TEST forms.Unless you have DFNFLG set to PROP, the act of defining a test group also causes it to be run (so you'll see if your tests fail right away).:before allows for a setup form for a group of tests.:after allows a form to be run after the tests without affecting results.For example, a DEFTESTGROUP using all its features is: (DEFTESTGROUP (UNWIND-OPCODE-TESTS :BEFORE (progn (before-form-1) (before-form-2)...) :AFTER (progn (after-form-1) (after-form-2)) ) (DEFTEST "first test" ....) (DEFTEST "second test" ....) )## Functions You'll Find Useful When Building Tests(EXPECT-ERRORS (error-types) forms) [Macro]Error-types is a list of errors that may occur while executing the forms. If one of the listed errors occurs, EXPECT-ERRORS returns (values t error-that-occurred), otherwise NIL. If all you want to do is make sure that an error is signalled somewhere in the test, you can specify an error-types of T. Normal use of this form is: (DEFTEST ERROR-CHECK (EXPECT-ERRORS (T) (THIS-FORM 'SHOULD 'ERROR))) (DEFTEST (+-DETECTS-NILS :INTERPRETED) (EXPECT-ERRORS (XCL:TYPE-MISMATCH) (+ 3 NIL)))(TEST-SETQ Variable Value)(TEST-DEFUN name (arglist) forms)(TEST-DEFMACRO name (arglist) forms) [Macros]These work like SETQ, DEFUN, and DEFMACRO, except that if they are executed within a DEFTEST or DEFTESTGROUP, their effects are manually undone (old values are saved and then restored) upon leaving the test. Use these in :BEFORE forms that a whole group of DEFTESTs want to see. DON'T use TEST-SETQ on locally-bound variables or in loops.Commands and Functions for Running Testsrun Test-name [EXEC Command]Once Test-name has been defined using DEFTEST or DEFTESTGROUP, you can run the test with the run command.(DO-TEST-FILE filename)Reads and executes a file of tests. All forms in the file are read before any are executed. The file should be clear text (clearput in TEdit) and terminate with a STOP. The format for test names is
5+
```Chap#[-sec#[-subsec#]]-comment.TEST(DO-ALL-TESTS &key (results *test-batch-results*) (patterns *test-file-pattern*) (sysout-type nil) (resume nil))
6+
```Calls DO-TEST-FILE on each file that matches patterns, which is a list of directory patterns, and prints the results to a new version of a file named results. If results is T, results are printed to the window where DO-ALL-TESTS is running. The header of the results file is a message of the date and time the tests are being run and the MAKESYSDATE of the sysout; if sysout-type is supplied, a line for it goes out too. If resume is non-NIL, DO-ALL-TESTS attempts to resume an interrupted test sequence, appending the results onto the latest version of results.`*TEST-MODE*` [Variable]Default is :batch, which means to report test failures and errors on *ERROR-OUTPUT* (which is usually a file), and continue. Other values possible are: :interactive which means to print a message before running each test, print another message for test failures, and produce a break window on errors. :batch-verbose which means to generate all the messages of :interactive and do not break on errors.`*TEST-BATCH-RESULTS*` [Variable]Defaults to "{MEDLEY}tmp>test>test-results"`*TEST-FILE-PATTERN*` [Variable]Defaults to "{MEDLEY}internal>test>*.TEST "`*TEST-COMPILE*` [Variable]If this switch is non-nil, DO-TEST compiles its forms before testing them. DO-ALL-TESTS will print a message in its header if this switch is on.`*ALL-FILES-REMAINING*` [Variable]While DO-ALL-TESTS is running, this variable contains a list of all the files remaining to be processed; files are removed from it AFTER they are read and executed. To restart a test run that somehow crashes the test driver, first clean up whatever blew up the run (if necessary, dump *ALL-FILES-REMAINING* to a file and get a new sysout), then do(DO-ALL-TESTS :RESUME T [:RESULTS "wherever"]).## internal Functions(DO-TEST name&options forms) [Macro]This is the obsolete, plain-test-file testing macro; it is still around so that old tests work (and because DEFTEST uses it). A test succeeds if the final form returns a non-nil result. If name&options isn't a list, then it's just the name which can be an atom or string; strings are preferred. If you specify options, the CAR of name&options is the name. If you specify :COMPILED in name&options, the test will run only when it has been compiled. Forms are presumed to be read with the Common Lisp reader in package XCL-TEST, which uses LISP and XCL. If a test fails or an error occurs during evaluation, a message is printed to *ERROR-OUTPUT*.(DO-TEST-GROUP name&options forms) [Macro]This is the obsolete, plain-test-file testing macro; it is still around so that old tests work (and because DEFTESTGROUP uses it). For associating a group of tests. For instance, a group of tests may all require the same setup and cleanup. If there are any options (see below) then the CAR of name&options is the name and the CDR is a keyword/value list. All forms must be DO-TEST forms.:before allows for a setup form for a group of tests.:after allows a form to be run after the tests without affecting results.An example of a DO-TEST-GROUP using all its features is:
7+
```(DO-TEST-GROUP ("a test group" :BEFORE (progn (before-form-1) (before-form-2)...) :AFTER (progn (after-form-1) (after-form-2)) ) (DO-TEST "first test" ....) (DO-TEST "second test" ....))
8+
```(CL-READFILE filename)Reads all forms in filename and returns a list of them. This function is used by DO-TEST-FILE to read test files; test writers who want to see if their files are syntactically valid should first see if CL-READFILE will read them, then see if DO-TEST-FILE will execute them.(MUNG-TEST-FILES filepattern &key (compiler 'compile-file) (startinglist NIL))Compiles test files so they can be run by just loading them. Compiles all files matching filepattern (which is fed to directory) using compiler and writes them out to the directory they came from with an extension appropriate to compiler. If you want to explicitly specify the list of files to compile, hand a list of pathnames to startinglist. Prints an error message for files that fail to compile. You have to use this function (instead of just compiling the test files) because it prefaces the test files with
9+
```
10+
(in-package "XCL-TEST")
11+
(setq *test-file-name* "NAME-OF-FILE")
12+
```
13+
so the compiler will read them properly and the files will know their names for error reporting purposes. NOTE: tests that fail should not be compiled; the resulting compiled code may not be a valid test..=�$Z�=�$Z�:�$�:�$�:� $�7$. MODERNMODERN MODERN
14+
TERMINAL
15+
?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))
16+
GACHA
17+

18+
TIMESROMAN
19+

20+
TIMESROMAN
21+

22+
TIMESROMAN
23+
- o    p  � + A�  � 
24+
 1;5!7>  �       � 0 E   �4   8 & 3 k #  J 9
25+
            , ^     ) )   O 
26+
 � !  $                  
27+
_  / n  -   c     4 F � -   ,  ,   ) :    *     �  � + AE   P          0 E     4.  6 m          Z 
28+
 V _ �     &k _ ! �z�

0 commit comments

Comments
 (0)