hoaproject / Test

The Hoa\Test library.
https://hoa-project.net/
11 stars 10 forks source link

Use multiple autoloaders and make `-l` and `-a` work #69

Closed Hywan closed 8 years ago

Hywan commented 8 years ago

Fix #68.

First, atoum/atoum 2.8 is required. Then, we can use our own autoloader to load entities outside of the vendor/ directory, which is useful when we would like to use -l and -a. The autoloader also handles pre-loaded files.

Run test suites of the current library

So to use hoa/test inside a library —let say L—, simply run composer install inside L followed by:

$ vendor/bin/hoa test:run

(the --directories Test is optional since #55) as usual to run the test suites of L.

Nothing changes.

Run test suites of another library

If you would like to use hoa/test to run the test suites of another library (with the Central architecture, so all libraries in the same directory), then go inside hoa/test, run composer install followed by for instance:

$ vendor/bin/hoa test:run --directories ../L/Test

or

$ vendor/bin/hoa test:run --libraries L

This behavior is not new but it was broken since we were using Composer's autoloader only.

Run test suites of all library

The behavior is the same as previously. The vendor/bin/hoa from hoa/test must be used like:

$ vendor/bin/hoa test:run --all

It will scan all the libraries with test suites.

This behavior is not new but it was broken since we were using Composer's autoloader only.

Hywan commented 8 years ago

There is still one issue with the prelude/pre-loaded files and --all. They can be some conflicts between test suites, I will try to solve this.

Hywan commented 8 years ago
> Total tests duration: 172.60 seconds.
> Total tests memory usage: 1328.01 Mb.
> Running duration: 194.28 seconds.

Success (139 test suites, 1304/1304 test cases, 0 void test case, 0 skipped test case, 411516 assertions)!

I am so happy with these numbers :-].

Hywan commented 8 years ago

@jubianchi Please, do you have time for a review?