3.56. kink/test/COLLECT

Provides funs to collect tests. Used with TEST.collect_in.

Example:

:TEST.require_from('kink/test/')
:COLLECT.require_from('kink/test/')

:Tests <- TEST.collect_in{
  # Loads tests in test/kink/**/*_test.kn
  COLLECT.under('test/kink/')

  # Loads tests in ad-hoc.kn
  COLLECT.under('ad-hoc.kn')
}
Tests.each{(:T) T.run }

3.56.1. COLLECT.under(Path)

Collects tests under the Path.

If the Path is a file, it calls COLLECT.file.

If the Path is a dir, it calls COLLECT.file for all the files matching the name pattern *_test.kn under the dir, recursively.

Otherwise, it raises an exception.

3.56.2. COLLECT.file(File_path)

Collects tests in the Kink script in the specified program file.

The dirname and the basename of the File_path are added to the addr_parts of the tests.