aboutsummaryrefslogtreecommitdiff
path: root/spec/build_spec.lua
diff options
context:
space:
mode:
authorGeorge Roman <30772943+georgeroman@users.noreply.github.com>2018-06-05 17:10:02 +0300
committerHisham Muhammad <hisham@gobolinux.org>2018-06-05 11:10:02 -0300
commitdb066d68e0355b98106a6e1f5f2573047363f851 (patch)
treef6c1f80e5ab291bc8baf2ddf11ff0d57474bfbf4 /spec/build_spec.lua
parent5b2540eb0d759d538c1d3fcd802b7d6961b337a9 (diff)
downloadluarocks-db066d68e0355b98106a6e1f5f2573047363f851.tar.gz
luarocks-db066d68e0355b98106a6e1f5f2573047363f851.tar.bz2
luarocks-db066d68e0355b98106a6e1f5f2573047363f851.zip
Tests: luarocks init (#811)
Diffstat (limited to 'spec/build_spec.lua')
-rw-r--r--spec/build_spec.lua23
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()