diff options
Diffstat (limited to 'spec/build_spec.lua')
-rw-r--r-- | spec/build_spec.lua | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/spec/build_spec.lua b/spec/build_spec.lua index 5f1eefd0..f042cbb9 100644 --- a/spec/build_spec.lua +++ b/spec/build_spec.lua | |||
@@ -35,13 +35,28 @@ describe("LuaRocks build tests #integration", function() | |||
35 | end) | 35 | end) |
36 | 36 | ||
37 | describe("LuaRocks build - basic testing set", function() | 37 | describe("LuaRocks build - basic testing set", function() |
38 | it("LuaRocks build with no flags/arguments", function() | ||
39 | assert.is_false(run.luarocks_bool("build")) | ||
40 | end) | ||
41 | |||
42 | it("LuaRocks build invalid", function() | 38 | it("LuaRocks build invalid", function() |
43 | assert.is_false(run.luarocks_bool("build invalid")) | 39 | assert.is_false(run.luarocks_bool("build invalid")) |
44 | end) | 40 | end) |
41 | |||
42 | it("LuaRocks build with no arguments behaves as luarocks make", function() | ||
43 | local tmpdir = test_env.get_tmp_path() | ||
44 | lfs.mkdir(tmpdir) | ||
45 | local olddir = lfs.currentdir() | ||
46 | lfs.chdir(tmpdir) | ||
47 | test_env.copy(testing_paths.fixtures_dir .. "/c_module-1.0-1.rockspec", tmpdir .. "/c_module-1.0-1.rockspec") | ||
48 | test_env.copy(testing_paths.fixtures_dir .. "/c_module.c", tmpdir .. "/c_module.c") | ||
49 | |||
50 | assert.is_true(run.luarocks_bool("build")) | ||
51 | if test_env.TEST_TARGET_OS == "windows" then | ||
52 | assert.truthy(lfs.attributes(tmpdir .. "/c_module.dll")) | ||
53 | else | ||
54 | assert.truthy(lfs.attributes(tmpdir .. "/c_module.so")) | ||
55 | end | ||
56 | |||
57 | lfs.chdir(olddir) | ||
58 | lfs.rmdir(tmpdir) | ||
59 | end) | ||
45 | end) | 60 | end) |
46 | 61 | ||
47 | describe("LuaRocks build - building lpeg with flags", function() | 62 | describe("LuaRocks build - building lpeg with flags", function() |