Skip to content

Commit

Permalink
tests: split tests into spec/lang, spec/api, spec/cli
Browse files Browse the repository at this point in the history
  • Loading branch information
hishamhm committed Oct 9, 2024
1 parent 6bef5e4 commit 29c0bd0
Show file tree
Hide file tree
Showing 150 changed files with 14 additions and 13 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ selfbuild:
diff tl.lua.1 tl.lua.2

suite:
${BUSTED} -v $(TESTFLAGS) --exclude-tags cli
${BUSTED} -v $(TESTFLAGS) --tags cli
${BUSTED} -v $(TESTFLAGS) spec/lang
${BUSTED} -v $(TESTFLAGS) spec/api
${BUSTED} -v $(TESTFLAGS) spec/cli

cov:
rm -f luacov.stats.out luacov.report.out
Expand Down
2 changes: 1 addition & 1 deletion spec/cli/check_spec.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
local assert = require("luassert")
local util = require("spec.util")

describe("#cli tl check", function()
describe("tl check", function()
describe("on .tl files", function()
it("reports if file does not exist", function()
local pd = io.popen(util.tl_cmd("check", "file_that_does_not_exist.tl") .. " 2>&1", "r")
Expand Down
2 changes: 1 addition & 1 deletion spec/cli/feat_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ local test_cases = {
}
}

describe("#cli feat flags", function()
describe("feat flags", function()
for flag, tests in pairs(test_cases) do
describe(flag, function()
for _, case in ipairs(tests) do
Expand Down
2 changes: 1 addition & 1 deletion spec/cli/gen_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ local function tl_to_lua(name)
return (name:gsub("%.tl$", ".lua"):gsub("^" .. util.os_tmp .. util.os_sep, ""))
end

describe("#cli tl gen", function()
describe("tl gen", function()
setup(util.chdir_setup)
teardown(util.chdir_teardown)
describe("on .tl files", function()
Expand Down
2 changes: 1 addition & 1 deletion spec/cli/global_env_def_spec.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
local assert = require("luassert")
local util = require("spec.util")

describe("#cli --global-env-def argument", function()
describe("--global-env-def argument", function()
it("exports globals from a module", function()
util.do_in(util.write_tmp_dir(finally, {
mod = {
Expand Down
2 changes: 1 addition & 1 deletion spec/cli/include_dir_spec.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
local assert = require("luassert")
local util = require("spec.util")

describe("#cli -I --include-dir argument", function()
describe("-I --include-dir argument", function()
it("adds a directory to package.path", function()
util.do_in(util.write_tmp_dir(finally, {
mod = {
Expand Down
2 changes: 1 addition & 1 deletion spec/cli/output_spec.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
local util = require("spec.util")

describe("#cli -o --output", function()
describe("-o --output", function()
it("should gen in the current directory when not provided", function()
util.run_mock_project(finally, {
dir_structure = {
Expand Down
2 changes: 1 addition & 1 deletion spec/cli/quiet_spec.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
local util = require("spec.util")

describe("#cli -q --quiet flag", function()
describe("-q --quiet flag", function()
setup(util.chdir_setup)
teardown(util.chdir_teardown)
it("silences warnings from tlconfig.lua", function()
Expand Down
2 changes: 1 addition & 1 deletion spec/cli/run_spec.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
local util = require("spec.util")

describe("#cli tl run", function()
describe("tl run", function()
setup(util.chdir_setup)
teardown(util.chdir_teardown)
describe("on .tl files", function()
Expand Down
2 changes: 1 addition & 1 deletion spec/cli/types_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local assert = require("luassert")
local json = require("dkjson")
local util = require("spec.util")

describe("#cli tl types works like check", function()
describe("tl types works like check", function()
describe("on .tl files", function()
it("reports missing files", function()
local pd = io.popen(util.tl_cmd("types", "nonexistent_file") .. "2>&1 1>" .. util.os_null, "r")
Expand Down
4 changes: 2 additions & 2 deletions spec/cli/warning_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local assert = require("luassert")
local util = require("spec.util")
local tl = require("tl")

describe("#cli tl warnings", function()
describe("tl warnings", function()
it("reports existing warning types when given no arguments", function()
local pd = io.popen(util.tl_cmd("warnings"), "r")
local output = pd:read("*a")
Expand All @@ -16,7 +16,7 @@ describe("#cli tl warnings", function()
end)
end)

describe("#cli warning flags", function()
describe("warning flags", function()
describe("in tlconfig.lua", function()
describe("disable_warnings", function()
it("disables the given warnings", function()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 29c0bd0

Please sign in to comment.