[asterisk-commits] mnicholson: branch mnicholson/asttest r170390 - in /team/mnicholson/asttest/a...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 23 00:10:42 CST 2009


Author: mnicholson
Date: Fri Jan 23 00:10:42 2009
New Revision: 170390

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=170390
Log:
Added self-tests, asttest is now self testing

Added:
    team/mnicholson/asttest/asttest/self-tests/
    team/mnicholson/asttest/asttest/self-tests/asttest.lua   (with props)
    team/mnicholson/asttest/asttest/self-tests/test_error/
    team/mnicholson/asttest/asttest/self-tests/test_error/test.lua   (with props)
    team/mnicholson/asttest/asttest/self-tests/test_error/tests/
    team/mnicholson/asttest/asttest/self-tests/test_error/tests/generated_error/
    team/mnicholson/asttest/asttest/self-tests/test_error/tests/generated_error/test.lua   (with props)
    team/mnicholson/asttest/asttest/self-tests/test_error/tests/missing_test_file/
    team/mnicholson/asttest/asttest/self-tests/test_error/tests/missing_test_file/readme.txt   (with props)
    team/mnicholson/asttest/asttest/self-tests/test_error/tests/runtime_error/
    team/mnicholson/asttest/asttest/self-tests/test_error/tests/runtime_error/test.lua   (with props)
    team/mnicholson/asttest/asttest/self-tests/test_error/tests/syntax_error/
    team/mnicholson/asttest/asttest/self-tests/test_error/tests/syntax_error/test.lua   (with props)
    team/mnicholson/asttest/asttest/self-tests/test_fail/
    team/mnicholson/asttest/asttest/self-tests/test_fail/test.lua   (with props)
    team/mnicholson/asttest/asttest/self-tests/test_fail/tests/
    team/mnicholson/asttest/asttest/self-tests/test_fail/tests/standard_fail/
    team/mnicholson/asttest/asttest/self-tests/test_fail/tests/standard_fail/test.lua   (with props)
    team/mnicholson/asttest/asttest/self-tests/test_pass/
    team/mnicholson/asttest/asttest/self-tests/test_pass/test.lua   (with props)
    team/mnicholson/asttest/asttest/self-tests/test_pass/tests/
    team/mnicholson/asttest/asttest/self-tests/test_pass/tests/explicit_pass/
    team/mnicholson/asttest/asttest/self-tests/test_pass/tests/explicit_pass/test.lua   (with props)
    team/mnicholson/asttest/asttest/self-tests/test_pass/tests/implicit_pass/
    team/mnicholson/asttest/asttest/self-tests/test_pass/tests/implicit_pass/test.lua   (with props)
    team/mnicholson/asttest/asttest/self-tests/test_skip/
    team/mnicholson/asttest/asttest/self-tests/test_skip/test.lua   (with props)
    team/mnicholson/asttest/asttest/self-tests/test_skip/tests/
    team/mnicholson/asttest/asttest/self-tests/test_skip/tests/standard_skip/
    team/mnicholson/asttest/asttest/self-tests/test_skip/tests/standard_skip/test.lua   (with props)
    team/mnicholson/asttest/asttest/self-tests/test_testlib/
    team/mnicholson/asttest/asttest/self-tests/test_testlib/test.lua   (with props)
    team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/
    team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/check_false/
    team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/check_false/test.lua   (with props)
    team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/check_true/
    team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/check_true/test.lua   (with props)
    team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/error/
    team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/error/test.lua   (with props)
    team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/fail/
    team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/fail/test.lua   (with props)
    team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/fail_if_false/
    team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/fail_if_false/test.lua   (with props)
    team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/fail_if_true/
    team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/fail_if_true/test.lua   (with props)
    team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/pass/
    team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/pass/test.lua   (with props)
    team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/skip/
    team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/skip/test.lua   (with props)
    team/mnicholson/asttest/asttest/self-tests/test_xfail/
    team/mnicholson/asttest/asttest/self-tests/test_xfail/test.lua   (with props)
    team/mnicholson/asttest/asttest/self-tests/test_xfail/tests/
    team/mnicholson/asttest/asttest/self-tests/test_xfail/tests/standard_xfail/
    team/mnicholson/asttest/asttest/self-tests/test_xfail/tests/standard_xfail/test.lua   (with props)
    team/mnicholson/asttest/asttest/self-tests/test_xpass/
    team/mnicholson/asttest/asttest/self-tests/test_xpass/test.lua   (with props)
    team/mnicholson/asttest/asttest/self-tests/test_xpass/tests/
    team/mnicholson/asttest/asttest/self-tests/test_xpass/tests/explicit_xpass/
    team/mnicholson/asttest/asttest/self-tests/test_xpass/tests/explicit_xpass/test.lua   (with props)
    team/mnicholson/asttest/asttest/self-tests/test_xpass/tests/implicit_xpass/
    team/mnicholson/asttest/asttest/self-tests/test_xpass/tests/implicit_xpass/test.lua   (with props)

Added: team/mnicholson/asttest/asttest/self-tests/asttest.lua
URL: http://svn.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/self-tests/asttest.lua?view=auto&rev=170390
==============================================================================
--- team/mnicholson/asttest/asttest/self-tests/asttest.lua (added)
+++ team/mnicholson/asttest/asttest/self-tests/asttest.lua Fri Jan 23 00:10:42 2009
@@ -1,0 +1,58 @@
+-- spawn the test driver and parse the results
+
+module(..., package.seeall)
+
+asttest = {}
+function asttest:new(test_dir)
+	local a = {
+		dir = test_dir,
+		tests = {},
+		results = {},
+		totals = {
+			["pass"] = 0,
+			["fail"] = 0,
+			["xpass"] = 0,
+			["xfail"] = 0,
+			["skip"] = 0,
+			["error"] = 0,
+			["total"] = 0,
+		},
+	}
+	setmetatable(a, self)
+	self.__index = self
+	return a
+end
+
+function asttest:parse_output()
+	for test, result in string.gmatch(self.output, "%d+%.%s+(%S+)%s+(%S+)\n") do
+		table.insert(self.tests, test)
+
+		self.results[test] = result
+
+		self.totals[result] = self.totals[result] + 1
+		self.totals.total = self.totals.total + 1
+	end
+end
+
+function asttest:spawn()
+	local output = io.popen("../../asttest 2>&1 " .. self.dir)
+	if not output then
+		return true, "error running asttest"
+	end
+
+	self.log = self.dir .. "/asttest.log"
+	self.output = output:read("*a")
+	self:parse_output()
+	return false
+end
+
+function run(dir)
+	local a = asttest:new(dir)
+	e, reason = a:spawn()
+	if e then
+		return nil
+	else
+		return a
+	end
+end
+

Propchange: team/mnicholson/asttest/asttest/self-tests/asttest.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/mnicholson/asttest/asttest/self-tests/asttest.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/mnicholson/asttest/asttest/self-tests/asttest.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/mnicholson/asttest/asttest/self-tests/test_error/test.lua
URL: http://svn.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/self-tests/test_error/test.lua?view=auto&rev=170390
==============================================================================
--- team/mnicholson/asttest/asttest/self-tests/test_error/test.lua (added)
+++ team/mnicholson/asttest/asttest/self-tests/test_error/test.lua Fri Jan 23 00:10:42 2009
@@ -1,0 +1,12 @@
+-- spawn the test driver to test errors with various causes
+
+package.path = package.path .. ";../?.lua"
+require "asttest"
+
+a = asttest.run("tests")
+
+fail_if(a.results["generated_error"] ~= "error", "generated_error test failed")
+fail_if(a.results["missing_test_file"] ~= "error", "missing test file test failed")
+fail_if(a.results["runtime_error"] ~= "error", "runtime error test failed")
+fail_if(a.results["syntax_error"] ~= "error", "syntax error test failed")
+

Propchange: team/mnicholson/asttest/asttest/self-tests/test_error/test.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/mnicholson/asttest/asttest/self-tests/test_error/test.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/mnicholson/asttest/asttest/self-tests/test_error/test.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/mnicholson/asttest/asttest/self-tests/test_error/tests/generated_error/test.lua
URL: http://svn.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/self-tests/test_error/tests/generated_error/test.lua?view=auto&rev=170390
==============================================================================
--- team/mnicholson/asttest/asttest/self-tests/test_error/tests/generated_error/test.lua (added)
+++ team/mnicholson/asttest/asttest/self-tests/test_error/tests/generated_error/test.lua Fri Jan 23 00:10:42 2009
@@ -1,0 +1,2 @@
+-- test handling of a user generated error
+error("this is a user generated error")

Propchange: team/mnicholson/asttest/asttest/self-tests/test_error/tests/generated_error/test.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/mnicholson/asttest/asttest/self-tests/test_error/tests/generated_error/test.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/mnicholson/asttest/asttest/self-tests/test_error/tests/generated_error/test.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/mnicholson/asttest/asttest/self-tests/test_error/tests/missing_test_file/readme.txt
URL: http://svn.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/self-tests/test_error/tests/missing_test_file/readme.txt?view=auto&rev=170390
==============================================================================
--- team/mnicholson/asttest/asttest/self-tests/test_error/tests/missing_test_file/readme.txt (added)
+++ team/mnicholson/asttest/asttest/self-tests/test_error/tests/missing_test_file/readme.txt Fri Jan 23 00:10:42 2009
@@ -1,0 +1,2 @@
+The test.lua file for this test is intentionally missing to test the behavior
+of the test driver in the presence of a missing test.lua file.

Propchange: team/mnicholson/asttest/asttest/self-tests/test_error/tests/missing_test_file/readme.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/mnicholson/asttest/asttest/self-tests/test_error/tests/missing_test_file/readme.txt
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/mnicholson/asttest/asttest/self-tests/test_error/tests/missing_test_file/readme.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/mnicholson/asttest/asttest/self-tests/test_error/tests/runtime_error/test.lua
URL: http://svn.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/self-tests/test_error/tests/runtime_error/test.lua?view=auto&rev=170390
==============================================================================
--- team/mnicholson/asttest/asttest/self-tests/test_error/tests/runtime_error/test.lua (added)
+++ team/mnicholson/asttest/asttest/self-tests/test_error/tests/runtime_error/test.lua Fri Jan 23 00:10:42 2009
@@ -1,0 +1,4 @@
+-- test the handling of runtime errors
+
+-- attempt to call a function that does not exist
+generate_runtime_error()

Propchange: team/mnicholson/asttest/asttest/self-tests/test_error/tests/runtime_error/test.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/mnicholson/asttest/asttest/self-tests/test_error/tests/runtime_error/test.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/mnicholson/asttest/asttest/self-tests/test_error/tests/runtime_error/test.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/mnicholson/asttest/asttest/self-tests/test_error/tests/syntax_error/test.lua
URL: http://svn.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/self-tests/test_error/tests/syntax_error/test.lua?view=auto&rev=170390
==============================================================================
--- team/mnicholson/asttest/asttest/self-tests/test_error/tests/syntax_error/test.lua (added)
+++ team/mnicholson/asttest/asttest/self-tests/test_error/tests/syntax_error/test.lua Fri Jan 23 00:10:42 2009
@@ -1,0 +1,4 @@
+-- test handling of syntax errors
+
+s1 = "string"
+s2 = "syntax error, missing \"

Propchange: team/mnicholson/asttest/asttest/self-tests/test_error/tests/syntax_error/test.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/mnicholson/asttest/asttest/self-tests/test_error/tests/syntax_error/test.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/mnicholson/asttest/asttest/self-tests/test_error/tests/syntax_error/test.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/mnicholson/asttest/asttest/self-tests/test_fail/test.lua
URL: http://svn.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/self-tests/test_fail/test.lua?view=auto&rev=170390
==============================================================================
--- team/mnicholson/asttest/asttest/self-tests/test_fail/test.lua (added)
+++ team/mnicholson/asttest/asttest/self-tests/test_fail/test.lua Fri Jan 23 00:10:42 2009
@@ -1,0 +1,9 @@
+-- spawn the test driver to test failure
+
+package.path = package.path .. ";../?.lua"
+require "asttest"
+
+a = asttest.run("tests")
+
+fail_if(a.results["standard_fail"] ~= "fail", "fail test failed, how ironic")
+

Propchange: team/mnicholson/asttest/asttest/self-tests/test_fail/test.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/mnicholson/asttest/asttest/self-tests/test_fail/test.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/mnicholson/asttest/asttest/self-tests/test_fail/test.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/mnicholson/asttest/asttest/self-tests/test_fail/tests/standard_fail/test.lua
URL: http://svn.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/self-tests/test_fail/tests/standard_fail/test.lua?view=auto&rev=170390
==============================================================================
--- team/mnicholson/asttest/asttest/self-tests/test_fail/tests/standard_fail/test.lua (added)
+++ team/mnicholson/asttest/asttest/self-tests/test_fail/tests/standard_fail/test.lua Fri Jan 23 00:10:42 2009
@@ -1,0 +1,2 @@
+-- test fail
+fail("this test should fail")

Propchange: team/mnicholson/asttest/asttest/self-tests/test_fail/tests/standard_fail/test.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/mnicholson/asttest/asttest/self-tests/test_fail/tests/standard_fail/test.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/mnicholson/asttest/asttest/self-tests/test_fail/tests/standard_fail/test.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/mnicholson/asttest/asttest/self-tests/test_pass/test.lua
URL: http://svn.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/self-tests/test_pass/test.lua?view=auto&rev=170390
==============================================================================
--- team/mnicholson/asttest/asttest/self-tests/test_pass/test.lua (added)
+++ team/mnicholson/asttest/asttest/self-tests/test_pass/test.lua Fri Jan 23 00:10:42 2009
@@ -1,0 +1,10 @@
+-- spawn the test driver to test passing
+
+package.path = package.path .. ";../?.lua"
+require "asttest"
+
+a = asttest.run("tests")
+
+fail_if(a.results["explicit_pass"] ~= "pass", "pass test failed")
+fail_if(a.results["implicit_pass"] ~= "pass", "pass test failed")
+

Propchange: team/mnicholson/asttest/asttest/self-tests/test_pass/test.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/mnicholson/asttest/asttest/self-tests/test_pass/test.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/mnicholson/asttest/asttest/self-tests/test_pass/test.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/mnicholson/asttest/asttest/self-tests/test_pass/tests/explicit_pass/test.lua
URL: http://svn.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/self-tests/test_pass/tests/explicit_pass/test.lua?view=auto&rev=170390
==============================================================================
--- team/mnicholson/asttest/asttest/self-tests/test_pass/tests/explicit_pass/test.lua (added)
+++ team/mnicholson/asttest/asttest/self-tests/test_pass/tests/explicit_pass/test.lua Fri Jan 23 00:10:42 2009
@@ -1,0 +1,2 @@
+-- test explicitly passing
+pass("this is an explicit pass")

Propchange: team/mnicholson/asttest/asttest/self-tests/test_pass/tests/explicit_pass/test.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/mnicholson/asttest/asttest/self-tests/test_pass/tests/explicit_pass/test.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/mnicholson/asttest/asttest/self-tests/test_pass/tests/explicit_pass/test.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/mnicholson/asttest/asttest/self-tests/test_pass/tests/implicit_pass/test.lua
URL: http://svn.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/self-tests/test_pass/tests/implicit_pass/test.lua?view=auto&rev=170390
==============================================================================
--- team/mnicholson/asttest/asttest/self-tests/test_pass/tests/implicit_pass/test.lua (added)
+++ team/mnicholson/asttest/asttest/self-tests/test_pass/tests/implicit_pass/test.lua Fri Jan 23 00:10:42 2009
@@ -1,0 +1,3 @@
+-- test implicitily passing
+
+-- this test will implicitily pass

Propchange: team/mnicholson/asttest/asttest/self-tests/test_pass/tests/implicit_pass/test.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/mnicholson/asttest/asttest/self-tests/test_pass/tests/implicit_pass/test.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/mnicholson/asttest/asttest/self-tests/test_pass/tests/implicit_pass/test.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/mnicholson/asttest/asttest/self-tests/test_skip/test.lua
URL: http://svn.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/self-tests/test_skip/test.lua?view=auto&rev=170390
==============================================================================
--- team/mnicholson/asttest/asttest/self-tests/test_skip/test.lua (added)
+++ team/mnicholson/asttest/asttest/self-tests/test_skip/test.lua Fri Jan 23 00:10:42 2009
@@ -1,0 +1,9 @@
+-- spawn the test driver to test skip functionality
+
+package.path = package.path .. ";../?.lua"
+require "asttest"
+
+a = asttest.run("tests")
+
+fail_if(a.results["standard_skip"] ~= "skip", "skip test failed")
+

Propchange: team/mnicholson/asttest/asttest/self-tests/test_skip/test.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/mnicholson/asttest/asttest/self-tests/test_skip/test.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/mnicholson/asttest/asttest/self-tests/test_skip/test.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/mnicholson/asttest/asttest/self-tests/test_skip/tests/standard_skip/test.lua
URL: http://svn.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/self-tests/test_skip/tests/standard_skip/test.lua?view=auto&rev=170390
==============================================================================
--- team/mnicholson/asttest/asttest/self-tests/test_skip/tests/standard_skip/test.lua (added)
+++ team/mnicholson/asttest/asttest/self-tests/test_skip/tests/standard_skip/test.lua Fri Jan 23 00:10:42 2009
@@ -1,0 +1,2 @@
+-- test skip
+skip("skip this test")

Propchange: team/mnicholson/asttest/asttest/self-tests/test_skip/tests/standard_skip/test.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/mnicholson/asttest/asttest/self-tests/test_skip/tests/standard_skip/test.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/mnicholson/asttest/asttest/self-tests/test_skip/tests/standard_skip/test.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/mnicholson/asttest/asttest/self-tests/test_testlib/test.lua
URL: http://svn.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/self-tests/test_testlib/test.lua?view=auto&rev=170390
==============================================================================
--- team/mnicholson/asttest/asttest/self-tests/test_testlib/test.lua (added)
+++ team/mnicholson/asttest/asttest/self-tests/test_testlib/test.lua Fri Jan 23 00:10:42 2009
@@ -1,0 +1,17 @@
+-- test the test library
+-- note: ts_log() and print() are not tested
+
+package.path = package.path .. ";../?.lua"
+require "asttest"
+
+a = asttest.run("tests")
+
+fail_if(a.results["fail_if_true"] ~= "fail")
+fail_if(a.results["fail_if_false"] ~= "pass")
+fail_if(a.results["check_true"] ~= "pass")
+fail_if(a.results["check_false"] ~= "fail")
+fail_if(a.results["fail"] ~= "fail")
+fail_if(a.results["pass"] ~= "pass")
+fail_if(a.results["skip"] ~= "skip")
+fail_if(a.results["error"] ~= "error")
+

Propchange: team/mnicholson/asttest/asttest/self-tests/test_testlib/test.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/mnicholson/asttest/asttest/self-tests/test_testlib/test.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/mnicholson/asttest/asttest/self-tests/test_testlib/test.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/check_false/test.lua
URL: http://svn.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/check_false/test.lua?view=auto&rev=170390
==============================================================================
--- team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/check_false/test.lua (added)
+++ team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/check_false/test.lua Fri Jan 23 00:10:42 2009
@@ -1,0 +1,2 @@
+-- test check
+check(false)

Propchange: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/check_false/test.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/check_false/test.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/check_false/test.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/check_true/test.lua
URL: http://svn.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/check_true/test.lua?view=auto&rev=170390
==============================================================================
--- team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/check_true/test.lua (added)
+++ team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/check_true/test.lua Fri Jan 23 00:10:42 2009
@@ -1,0 +1,2 @@
+-- test check
+check(true)

Propchange: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/check_true/test.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/check_true/test.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/check_true/test.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/error/test.lua
URL: http://svn.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/error/test.lua?view=auto&rev=170390
==============================================================================
--- team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/error/test.lua (added)
+++ team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/error/test.lua Fri Jan 23 00:10:42 2009
@@ -1,0 +1,2 @@
+-- test error
+error()

Propchange: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/error/test.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/error/test.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/error/test.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/fail/test.lua
URL: http://svn.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/fail/test.lua?view=auto&rev=170390
==============================================================================
--- team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/fail/test.lua (added)
+++ team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/fail/test.lua Fri Jan 23 00:10:42 2009
@@ -1,0 +1,2 @@
+-- test fail
+fail()

Propchange: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/fail/test.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/fail/test.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/fail/test.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/fail_if_false/test.lua
URL: http://svn.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/fail_if_false/test.lua?view=auto&rev=170390
==============================================================================
--- team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/fail_if_false/test.lua (added)
+++ team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/fail_if_false/test.lua Fri Jan 23 00:10:42 2009
@@ -1,0 +1,2 @@
+-- test fail_if
+fail_if(false)

Propchange: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/fail_if_false/test.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/fail_if_false/test.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/fail_if_false/test.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/fail_if_true/test.lua
URL: http://svn.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/fail_if_true/test.lua?view=auto&rev=170390
==============================================================================
--- team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/fail_if_true/test.lua (added)
+++ team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/fail_if_true/test.lua Fri Jan 23 00:10:42 2009
@@ -1,0 +1,2 @@
+-- test fail_if
+fail_if(true)

Propchange: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/fail_if_true/test.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/fail_if_true/test.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/fail_if_true/test.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/pass/test.lua
URL: http://svn.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/pass/test.lua?view=auto&rev=170390
==============================================================================
--- team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/pass/test.lua (added)
+++ team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/pass/test.lua Fri Jan 23 00:10:42 2009
@@ -1,0 +1,2 @@
+-- test pass
+pass()

Propchange: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/pass/test.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/pass/test.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/pass/test.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/skip/test.lua
URL: http://svn.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/skip/test.lua?view=auto&rev=170390
==============================================================================
--- team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/skip/test.lua (added)
+++ team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/skip/test.lua Fri Jan 23 00:10:42 2009
@@ -1,0 +1,2 @@
+-- test skip
+skip()

Propchange: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/skip/test.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/skip/test.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/mnicholson/asttest/asttest/self-tests/test_testlib/tests/skip/test.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/mnicholson/asttest/asttest/self-tests/test_xfail/test.lua
URL: http://svn.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/self-tests/test_xfail/test.lua?view=auto&rev=170390
==============================================================================
--- team/mnicholson/asttest/asttest/self-tests/test_xfail/test.lua (added)
+++ team/mnicholson/asttest/asttest/self-tests/test_xfail/test.lua Fri Jan 23 00:10:42 2009
@@ -1,0 +1,9 @@
+-- spawn the test driver to test expected failures
+
+package.path = package.path .. ";../?.lua"
+require "asttest"
+
+a = asttest.run("tests")
+
+fail_if(a.results["standard_xfail"] ~= "xfail", "standard xfail failed")
+

Propchange: team/mnicholson/asttest/asttest/self-tests/test_xfail/test.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/mnicholson/asttest/asttest/self-tests/test_xfail/test.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/mnicholson/asttest/asttest/self-tests/test_xfail/test.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/mnicholson/asttest/asttest/self-tests/test_xfail/tests/standard_xfail/test.lua
URL: http://svn.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/self-tests/test_xfail/tests/standard_xfail/test.lua?view=auto&rev=170390
==============================================================================
--- team/mnicholson/asttest/asttest/self-tests/test_xfail/tests/standard_xfail/test.lua (added)
+++ team/mnicholson/asttest/asttest/self-tests/test_xfail/tests/standard_xfail/test.lua Fri Jan 23 00:10:42 2009
@@ -1,0 +1,4 @@
+-- test xfail
+xfail()
+
+fail("this is an expected failure")

Propchange: team/mnicholson/asttest/asttest/self-tests/test_xfail/tests/standard_xfail/test.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/mnicholson/asttest/asttest/self-tests/test_xfail/tests/standard_xfail/test.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/mnicholson/asttest/asttest/self-tests/test_xfail/tests/standard_xfail/test.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/mnicholson/asttest/asttest/self-tests/test_xpass/test.lua
URL: http://svn.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/self-tests/test_xpass/test.lua?view=auto&rev=170390
==============================================================================
--- team/mnicholson/asttest/asttest/self-tests/test_xpass/test.lua (added)
+++ team/mnicholson/asttest/asttest/self-tests/test_xpass/test.lua Fri Jan 23 00:10:42 2009
@@ -1,0 +1,10 @@
+-- spawn the test driver to test unexpected successes
+
+package.path = package.path .. ";../?.lua"
+require "asttest"
+
+a = asttest.run("tests")
+
+fail_if(a.results["implicit_xpass"] ~= "xpass", "implicit xpass failed")
+fail_if(a.results["explicit_xpass"] ~= "xpass", "explicit xpass failed")
+

Propchange: team/mnicholson/asttest/asttest/self-tests/test_xpass/test.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/mnicholson/asttest/asttest/self-tests/test_xpass/test.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/mnicholson/asttest/asttest/self-tests/test_xpass/test.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/mnicholson/asttest/asttest/self-tests/test_xpass/tests/explicit_xpass/test.lua
URL: http://svn.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/self-tests/test_xpass/tests/explicit_xpass/test.lua?view=auto&rev=170390
==============================================================================
--- team/mnicholson/asttest/asttest/self-tests/test_xpass/tests/explicit_xpass/test.lua (added)
+++ team/mnicholson/asttest/asttest/self-tests/test_xpass/tests/explicit_xpass/test.lua Fri Jan 23 00:10:42 2009
@@ -1,0 +1,4 @@
+-- test xpass/xfail with an explicit pass
+xfail()
+
+pass("this is an unexpected pass")

Propchange: team/mnicholson/asttest/asttest/self-tests/test_xpass/tests/explicit_xpass/test.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/mnicholson/asttest/asttest/self-tests/test_xpass/tests/explicit_xpass/test.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/mnicholson/asttest/asttest/self-tests/test_xpass/tests/explicit_xpass/test.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/mnicholson/asttest/asttest/self-tests/test_xpass/tests/implicit_xpass/test.lua
URL: http://svn.digium.com/svn-view/asterisk/team/mnicholson/asttest/asttest/self-tests/test_xpass/tests/implicit_xpass/test.lua?view=auto&rev=170390
==============================================================================
--- team/mnicholson/asttest/asttest/self-tests/test_xpass/tests/implicit_xpass/test.lua (added)
+++ team/mnicholson/asttest/asttest/self-tests/test_xpass/tests/implicit_xpass/test.lua Fri Jan 23 00:10:42 2009
@@ -1,0 +1,4 @@
+-- test xpass/xfail with an implicit pass
+xfail()
+
+-- this test will implicitly pass

Propchange: team/mnicholson/asttest/asttest/self-tests/test_xpass/tests/implicit_xpass/test.lua
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/mnicholson/asttest/asttest/self-tests/test_xpass/tests/implicit_xpass/test.lua
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/mnicholson/asttest/asttest/self-tests/test_xpass/tests/implicit_xpass/test.lua
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the asterisk-commits mailing list