[llvm-commits] [test-suite] r141421 - in /test-suite/trunk/LNTBased: ./ Examples/ Examples/README.txt Examples/Simple/ Examples/Simple/README.txt Examples/Simple/TestModule README.txt
Daniel Dunbar
daniel at zuster.org
Fri Oct 7 15:10:12 PDT 2011
Author: ddunbar
Date: Fri Oct 7 17:10:12 2011
New Revision: 141421
URL: http://llvm.org/viewvc/llvm-project?rev=141421&view=rev
Log:
test-suite/LNTBased: Add an example of how to define a minimal LNTBased test.
Added:
test-suite/trunk/LNTBased/
test-suite/trunk/LNTBased/Examples/
test-suite/trunk/LNTBased/Examples/README.txt
test-suite/trunk/LNTBased/Examples/Simple/
test-suite/trunk/LNTBased/Examples/Simple/README.txt
test-suite/trunk/LNTBased/Examples/Simple/TestModule
test-suite/trunk/LNTBased/README.txt
Added: test-suite/trunk/LNTBased/Examples/README.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/LNTBased/Examples/README.txt?rev=141421&view=auto
==============================================================================
--- test-suite/trunk/LNTBased/Examples/README.txt (added)
+++ test-suite/trunk/LNTBased/Examples/README.txt Fri Oct 7 17:10:12 2011
@@ -0,0 +1 @@
+This directory contains LNT-based example tests.
Added: test-suite/trunk/LNTBased/Examples/Simple/README.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/LNTBased/Examples/Simple/README.txt?rev=141421&view=auto
==============================================================================
--- test-suite/trunk/LNTBased/Examples/Simple/README.txt (added)
+++ test-suite/trunk/LNTBased/Examples/Simple/README.txt Fri Oct 7 17:10:12 2011
@@ -0,0 +1 @@
+This is a minimal LNT-based NT test module.
Added: test-suite/trunk/LNTBased/Examples/Simple/TestModule
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/LNTBased/Examples/Simple/TestModule?rev=141421&view=auto
==============================================================================
--- test-suite/trunk/LNTBased/Examples/Simple/TestModule (added)
+++ test-suite/trunk/LNTBased/Examples/Simple/TestModule Fri Oct 7 17:10:12 2011
@@ -0,0 +1,40 @@
+#!/usr/bin/env python
+# -*- Python -*-
+
+# We import test functionity from LNT.
+from lnt.tests import nt
+from lnt.testing import TestSamples, PASS, FAIL, XFAIL
+
+# Test module classes are currently required to subclass 'nt.TestModule'.
+class Simple(nt.TestModule):
+ def execute_test(self, options):
+ # The options dictionary defines the user command line parameters that
+ # are supposed to apply to the test. Some important variables which are
+ # guaranteed to be present are:
+ # ... FIXME
+
+ # We are expected to return a list of test samples, which will be merged
+ # with all the other reports.
+ #
+ # There are no constraints on the test names (i.e., they do not need to
+ # match the directory structure as the SingleSource or MultiSource tests
+ # would), but must be unique.
+ #
+ # The tests should follow the current LNT test schema for reporting test
+ # status (success and failure). The current schema is that status is
+ # reported as an additional test with the '.status' suffix and
+ # appropriate test codes (defined by the 'lnt.testing' module, see
+ # below). If no '.status' result is reported, the test is assumed to
+ # have passed.
+ return [
+ TestSamples('nts.LNT/Examples/Simple.compile', [1.0]),
+ TestSamples('nts.LNT/Examples/Simple.exec', [1.0]),
+ TestSamples('nts.LNT/Examples/Simple.exec.status', [FAIL])]
+
+# This is the only required entry point to the module.
+test_class = Simple
+
+# This is not required, but allows users with LNT in the environment (required
+# for initial imports to work) to execute this test directly.
+if __name__ == '__main__':
+ test_class().main()
Added: test-suite/trunk/LNTBased/README.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/LNTBased/README.txt?rev=141421&view=auto
==============================================================================
--- test-suite/trunk/LNTBased/README.txt (added)
+++ test-suite/trunk/LNTBased/README.txt Fri Oct 7 17:10:12 2011
@@ -0,0 +1,14 @@
+llvm-test LNT-based tests
+=========================
+
+This directory contains test components designed to run as part of the LNT based
+"nightly test" infrastructure.
+
+These test components are designed to impose minimal requirements on the code
+being tested or on how the test is run. Instead, the tests must provide an
+extension module that will be run by LNT and will be passed the user parameters
+(compiler to test, optimization flags, etc.), and is expected to return back an
+LNT testing report.
+
+Tests are auto-discovered by the LNT 'nt' test by looking for the TestModule
+extension module files. See the 'Examples' sub-directory for more information.
More information about the llvm-commits
mailing list