hoaproject / Test

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

Force `atoum` to run in a specific CWD #41

Closed Hywan closed 9 years ago

Hywan commented 9 years ago

The current working directory (CWD) of atoum was not very well defined. Now we force it to hoa://Library/Test/. In this case, it is able to find a default .bootstrap.atoum.php file, and then it can load it to find command-line arguments to add (useful for the atoum/ruler-extension extension). We set a HOA_PREVIOUS_CWD environment variable to reset the CWD before executing the tests. Why? Because, for instance, if we execute:

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

With CWD set to hoa://Library/Test/, the Test/ directory will not exist, because it will look for hoa://Library/Test/Test. By resetting the CWD, we fix this problem (back to normal).

Hywan commented 9 years ago

Nice side effect, it reduces execution time by 4! I guess this is due to the CWD not well-defined before. We are much more close to the atoum execution time.