]> git.lizzy.rs Git - metalua.git/blob - src/tests/run.mlua
test/run: fixed OS X (where os.getenv("OS") returns nil)
[metalua.git] / src / tests / run.mlua
1 -- Run all *.lua and *.mlua files in this directory.
2 -- This makes it easy to run all tests in the directory, 
3
4 -{ extension 'xloop' }
5
6 ls = io.popen ( (os.getenv("OS") or "") :match "^Windows" and "dir /b" or "ls")
7 this_script = arg[1]
8
9 for filename in ls :lines() if filename ~= this_script and filename :strmatch  "%.m?lua$" do
10    printf ("*** running %s ***", filename)
11    local ret = os.execute ("metalua "..filename)
12    if ret ~= 0 then error("Test "..filename.." failed, returned "..ret) end
13 end
14
15 ls :close()