diff options
author | Peter Melnichenko <mpeterval@gmail.com> | 2016-07-08 16:00:57 +0300 |
---|---|---|
committer | Peter Melnichenko <mpeterval@gmail.com> | 2016-07-08 16:00:57 +0300 |
commit | b57ce08dce1efa471bc1ae5fad2f154bae426f75 (patch) | |
tree | 2864f4e978ef84099bbe837a2dbe458ada7f03d9 /test | |
parent | 858c649db5107946184e30e67bf861826aa5c64d (diff) | |
download | luarocks-b57ce08dce1efa471bc1ae5fad2f154bae426f75.tar.gz luarocks-b57ce08dce1efa471bc1ae5fad2f154bae426f75.tar.bz2 luarocks-b57ce08dce1efa471bc1ae5fad2f154bae426f75.zip |
Tests: move clean() into separate function, fix a pattern
Diffstat (limited to 'test')
-rw-r--r-- | test/test_environment.lua | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/test/test_environment.lua b/test/test_environment.lua index 8cc8e295..94acf1c8 100644 --- a/test/test_environment.lua +++ b/test/test_environment.lua | |||
@@ -531,19 +531,23 @@ local function create_configs() | |||
531 | write_file(test_env.testing_paths.testing_dir .. "/luacov.config", config_content) | 531 | write_file(test_env.testing_paths.testing_dir .. "/luacov.config", config_content) |
532 | end | 532 | end |
533 | 533 | ||
534 | --- Remove testing directories. | ||
535 | local function clean() | ||
536 | print("Cleaning testing directory...") | ||
537 | test_env.remove_dir(test_env.testing_paths.luarocks_tmp) | ||
538 | test_env.remove_dir_pattern(test_env.testing_paths.testing_dir, "testing[_%-]") | ||
539 | test_env.remove_files(test_env.testing_paths.testing_dir, "testing_") | ||
540 | test_env.remove_files(test_env.testing_paths.testing_dir, "luacov") | ||
541 | print("Cleaning done!") | ||
542 | end | ||
543 | |||
534 | --- | 544 | --- |
535 | -- Main function to create config files and testing environment | 545 | -- Main function to create config files and testing environment |
536 | function test_env.main() | 546 | function test_env.main() |
537 | local testing_paths = test_env.testing_paths | 547 | local testing_paths = test_env.testing_paths |
538 | 548 | ||
539 | if test_env.TEST_ENV_CLEAN then | 549 | if test_env.TEST_ENV_CLEAN then |
540 | print("Cleaning testing directory...") | 550 | clean() |
541 | test_env.remove_dir(testing_paths.luarocks_tmp) | ||
542 | test_env.remove_dir_pattern(testing_paths.testing_dir, "testing_") | ||
543 | test_env.remove_dir_pattern(testing_paths.testing_dir, "testing-") | ||
544 | test_env.remove_files(testing_paths.testing_dir, "testing_") | ||
545 | test_env.remove_files(testing_paths.testing_dir, "luacov") | ||
546 | print("Cleaning done!") | ||
547 | end | 551 | end |
548 | 552 | ||
549 | lfs.mkdir(testing_paths.testing_cache) | 553 | lfs.mkdir(testing_paths.testing_cache) |