diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2018-05-07 11:22:07 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-05-07 19:27:37 -0300 |
| commit | 1dcdaa77c0a52ad02f49bc7fdde2fd7dee956ddf (patch) | |
| tree | 30a6e8dbabc0e36b3a9ff25dfde2fa60327ae402 /spec/util/test_env.lua | |
| parent | 5bff41c6b4adac49c0456f125c9f208b0a429d86 (diff) | |
| download | luarocks-1dcdaa77c0a52ad02f49bc7fdde2fd7dee956ddf.tar.gz luarocks-1dcdaa77c0a52ad02f49bc7fdde2fd7dee956ddf.tar.bz2 luarocks-1dcdaa77c0a52ad02f49bc7fdde2fd7dee956ddf.zip | |
Tests: test the "busted" backend of `luarocks test` with a local fixture
Diffstat (limited to 'spec/util/test_env.lua')
| -rw-r--r-- | spec/util/test_env.lua | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/spec/util/test_env.lua b/spec/util/test_env.lua index 7b5b66b9..f55fb53a 100644 --- a/spec/util/test_env.lua +++ b/spec/util/test_env.lua | |||
| @@ -506,6 +506,7 @@ local function create_paths(luaversion_full) | |||
| 506 | end | 506 | end |
| 507 | 507 | ||
| 508 | testing_paths.fixtures_dir = base_dir .. "/spec/fixtures" | 508 | testing_paths.fixtures_dir = base_dir .. "/spec/fixtures" |
| 509 | testing_paths.fixtures_repo_dir = base_dir .. "/spec/fixtures/a_repo" | ||
| 509 | testing_paths.util_dir = base_dir .. "/spec/util" | 510 | testing_paths.util_dir = base_dir .. "/spec/util" |
| 510 | testing_paths.testrun_dir = base_dir .. "/testrun" | 511 | testing_paths.testrun_dir = base_dir .. "/testrun" |
| 511 | testing_paths.src_dir = base_dir .. "/src" | 512 | testing_paths.src_dir = base_dir .. "/src" |
| @@ -763,12 +764,9 @@ end | |||
| 763 | function test_env.mock_server_init() | 764 | function test_env.mock_server_init() |
| 764 | local testing_paths = test_env.testing_paths | 765 | local testing_paths = test_env.testing_paths |
| 765 | assert(test_env.need_rock("restserver-xavante")) | 766 | assert(test_env.need_rock("restserver-xavante")) |
| 766 | local pwd = lfs.currentdir() | 767 | local final_command = test_env.execute_helper(testing_paths.lua .. " " .. testing_paths.util_dir .. "/mock-server.lua " .. testing_paths.fixtures_dir .. " &", true, test_env.env_variables) |
| 767 | lfs.chdir(testing_paths.fixtures_dir) | ||
| 768 | local final_command = test_env.execute_helper(testing_paths.lua .. " " .. testing_paths.util_dir .. "/mock-server.lua &", true, test_env.env_variables) | ||
| 769 | os.execute(final_command) | 768 | os.execute(final_command) |
| 770 | os.execute("sleep 1") | 769 | os.execute("sleep 1") |
| 771 | lfs.chdir(pwd) | ||
| 772 | end | 770 | end |
| 773 | 771 | ||
| 774 | function test_env.mock_server_done() | 772 | function test_env.mock_server_done() |
