From: Fabien Fleutot Date: Wed, 4 Feb 2009 10:35:23 +0000 (+0100) Subject: added auto-test script X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=f5ddd9c97c40bd1f2363a614b8c83ea1fb318d8e;p=metalua.git added auto-test script --- diff --git a/src/tests/run.mlua b/src/tests/run.mlua new file mode 100644 index 0000000..e6003a6 --- /dev/null +++ b/src/tests/run.mlua @@ -0,0 +1,15 @@ +-- Run all *.lua and *.mlua files in this directory. +-- This makes it easy to run all tests in the directory, + +-{ extension 'xloop' } + +ls = io.popen (os.getenv "OS" :match "^Windows" and "dir /b" or "ls") +this_script = arg[1] + +for filename in ls :lines() if filename ~= this_script and filename :strmatch "%.m?lua$" do + printf ("*** running %s ***", filename) + local ret = os.execute ("metalua "..filename) + if ret ~= 0 then error("Test "..filename.." failed, returned "..ret) end +end + +ls :close()