Changeset 40153 in project


Ignore:
Timestamp:
05/28/21 18:40:14 (4 months ago)
Author:
Mario Domenech Goulart
Message:

eggs tutorial: clarifications on the protocol assumed for tests/run.scm

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggs tutorial

    r39475 r40153  
    114114When {{chicken-install}} is invoked with the {{-test}} option, then this file will be executed
    115115(with {{test}} being the current working directory). It is recommended to add a test suite
    116 to your extension, as it allows some sort of automated testing of installed extensions. '''If "run.scm" never calls "error" during the execution then the test is considered successful.'''
     116to your extension, as it allows some sort of automated testing of installed extensions.
    117117
    118 If your tests depend on extra eggs, '''do not''' use {{needs}}/{{depends}} to require them.  Use {{test-depends}} instead, so they'll only be required when {{chicken-install}} is used with the {{-test}} option.
    119118
    120 For proper integration to the [[http://tests.call-cc.org|test infrastructure]],
    121 {{run.scm}} should exit {{0}} (zero) when all tests
    122 pass or any other number in case some test fails.  If you are using
    123 the [[/egg/test|test]] egg, a call to {{test-exit}} makes {{run.scm}}
    124 exit properly.
     119{{chicken-install}} determines whether the test suite succeeded or not
     120based on the exit code from {{tests/run.scm}}.  Success is indicated
     121with exit code {{0}} and any other exit code indicates failures.  The
     122{{tests/run.scm}} is supposed to follow that protocol, otherwise
     123failures might be go unnoticed if {{tests/run.scm}} always exit {{0}}.
     124If you are using the [[/egg/test|test egg]], you can use
     125{{(test-exit)}} at the end of tests to make {{tests/run.scm}} properly
     126report the exit code to {{chicken-install}}.
    125127
    126 With regard to the test infrastructure, notice that only the latest released egg versions are tested.
     128If your tests depend on extra eggs, '''do not''' use
     129{{dependencies}}/{{build-dependencies}} to require them.  Use
     130{{test-dependencies}} instead, so they'll only be required when
     131{{chicken-install}} is used with the {{-test}} option.
     132
     133With regard to the test infrastructure, notice that only the latest
     134released egg versions are tested.
    127135
    128136==== Testing your extension
Note: See TracChangeset for help on using the changeset viewer.