]> git.lizzy.rs Git - metalua.git/commitdiff
added auto-test script
authorFabien Fleutot <metalua@gmail.com>
Wed, 4 Feb 2009 10:35:23 +0000 (11:35 +0100)
committerFabien Fleutot <metalua@gmail.com>
Wed, 4 Feb 2009 10:35:23 +0000 (11:35 +0100)
src/tests/run.mlua [new file with mode: 0644]

diff --git a/src/tests/run.mlua b/src/tests/run.mlua
new file mode 100644 (file)
index 0000000..e6003a6
--- /dev/null
@@ -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()