1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-12 22:07:16 +00:00
cc65/test
2024-01-05 22:26:06 +01:00
..
asm fix dangling space, mention .union in test comment 2023-12-16 19:25:21 -05:00
dasm dasm test extend 65816.info to include added code 2023-02-21 05:22:28 -05:00
err Merge pull request #2314 from acqn/PPFix 2023-12-31 19:16:44 +01:00
misc Removed outdated testcases no longer in the directory from test/misc/Makefile. 2023-12-09 18:04:29 +08:00
ref Separated C preprocessor errors from other errors. 2023-12-18 15:30:53 +08:00
standard makefiles no longer need comment about sim65 64-bit support 2023-05-07 16:33:07 -04:00
todo If __A__,__AX__ or __EAX__ is used, post-inc/dec within the same statement will not modify it. 2021-06-08 14:16:14 +08:00
val Add strdup tests 2024-01-05 22:26:06 +01:00
CPYRIGHT.LCC Add test license description. 2020-06-27 02:23:40 +02:00
isequal.c isequal with --wildcard: Allow DOS/Win paths 2022-06-22 21:23:44 +02:00
Makefile test/standard was never added to test makefile 2023-05-05 11:04:31 -04:00
readme.txt libtest target alternative to libs 2023-05-05 21:56:52 -04:00

This directory contains test code for automatic regression testing of the CC65
compiler and tools.

/asm  - contains the assembler regression tests

/dasm - contains the disassembler regression tests


/val, /ref and /err generally contain the tests that are used to verify that the
compiler is working as expected (when the tests behave as described):

/val  - The bulk of tests are contained here, individual tests should exit with
        an exit code of EXIT_SUCCESS when they pass, or EXIT_FAILURE on error.

/standard - like the tests in /val, the tests must exit with EXIT_SUCCESS on
        success. Unlike the tests in /val these are not compiled for every
        combination of optimizer options, but instead always with -Osir and then
        for each supported C-standard (C89, C99, CC65). The goal is to use these
        to check for regressions in standard conformance of the compiler and the
        library.

/ref  - These tests produce output that must be compared with reference output.
        Normally the reference output is produced by compiling the program on the
        host (using gcc mostly) and then running them on the host. Tests should
        be tweaked to produce the same output as on the host in the cases where
        it would be different.

        The Makefile also handles some special cases (add the tests to the
        respective list in the makefile):

        - Sometimes we want to check the warnings produced by the compiler. In
        that case use the CUSTOMSOURCES list. Whatever output the compiler writes
        to stderr will be compared against the matching .cref file. There is an
        example in custom-reference.c/.cref

        - Sometimes we want to check what kind of output the compiler produces
        for a file that does not compile. In that case use the ERRORSOURCES list.
        There is an example in custom-reference-error.c/.cref

        Warning: please understand that comparing the compiler output against
        a reference produces a moving target, ie the tests may break randomly
        at any time when the compiler output changes for whatever reason. So
        only ever use this as a last resort when something can not be tested by
        other means.

/err  - contains tests that MUST NOT compile


/todo and /misc generally contain the tests that fail because of known bugs:

/todo - These tests fail due to open compiler issues.

        The makefile in this directory _expects_ the tests to fail, because of
        that when an issue was fixed it will break the CI. The test should get 
        moved to /val in the PR fixing the issue, which will make CI pass again.
        No changes to makefiles are required!


/misc - a few tests that need special care of some sort

        Tests that (incorrectly) fail to compile and other tests that fail and
        do NOT return an exit code are collected here. The makefile _expects_
        those tests to fail, so when an issue is fixed it will break the CI.
        When this happens, the PR fixing the issue should also "invert" the
        failing condition in the makefile by adding a $(NOT) before the
        offending line (or removing it when it is already there), which will
        make the CI pass again. The test should then be moved elsewhere later,
        which will require additional changes to the makefile(s).


These tests only require a subset of the platform libraries. In the (top)
directory above this one, "make libtest" can be used to build only those
libraries needed for testing, instead of "make lib".

To run the tests use "make" in this (test) directory, the makefile should exit
with no error.

When a test failed you can use "make continue" to run further tests.

--------------------------------------------------------------------------------

TODO:

- reduce usage of "common.h" to a minimum
- convert more tests from using reference output to returning an exit code