Files
tia-lsp/test/run_tests.lua
T
lazar 8496cc865e chore: adjust README, AGENTS, and test runner for server-only scope
After splitting from the original scl_lsp repo, update documentation
and test infrastructure to reflect the server-only scope of this repo.

- README.md: focused on LSP server features, tree-sitter grammar,
  running the server, and Mason installation reference
- AGENTS.md: server-only project structure and conventions
- test/run_tests.lua: run only server tests (formatter, plc_json)
2026-07-18 11:46:12 +02:00

45 lines
1005 B
Lua

#!/usr/bin/env lua
package.path = package.path .. ";src/?.lua"
local test = dofile("test/test_harness.lua")
print("========================================")
print(" tia-lsp - Server Test Suite")
print("========================================")
print(string.format("Reference Project: %s", test.REF_PROJECT))
local function run_all_tests()
print("\n" .. string.rep("=", 40))
print("Running All Tests")
print(string.rep("=", 40))
test.reset()
local function run_test_file(name)
print(string.format("\n>>> Running %s", name))
local ok, err = pcall(dofile, "test/" .. name)
if not ok then
print("ERROR: " .. tostring(err))
test.fail_count = test.fail_count + 1
end
end
run_test_file("test_formatter.lua")
run_test_file("test_plc_json.lua")
test.report()
return test.fail_count == 0
end
local success = run_all_tests()
if success then
print("\n=== ALL TESTS PASSED ===")
os.exit(0)
else
print("\n=== SOME TESTS FAILED ===")
os.exit(1)
end