aboutsummaryrefslogtreecommitdiffstats
path: root/test/lua/tests.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/lua/tests.lua')
-rw-r--r--test/lua/tests.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/lua/tests.lua b/test/lua/tests.lua
new file mode 100644
index 000000000..0f6b06b4b
--- /dev/null
+++ b/test/lua/tests.lua
@@ -0,0 +1,22 @@
+-- Run all unit tests in 'unit' directory
+
+local telescope = require "telescope"
+
+local contexts = {}
+
+for _,t in ipairs(tests_list) do
+ telescope.load_contexts(t, contexts)
+end
+local buffer = {}
+local results = telescope.run(contexts, callbacks, test_pattern)
+local summary, data = telescope.summary_report(contexts, results)
+table.insert(buffer, telescope.test_report(contexts, results))
+
+if #buffer > 0 then print(table.concat(buffer, "\n")) end
+
+for _, v in pairs(results) do
+ if v.status_code == telescope.status_codes.err or
+ v.status_code == telescope.status_codes.fail then
+ os.exit(1)
+ end
+end \ No newline at end of file