Lines Matching +defs:test +defs:file
2 LLDB module which provides the abstract base class of lldb test case.
5 common behavior for unitest.TestCase.setUp/tearDown implemented in this file.
7 ./dotest.py provides a test driver which sets up the environment to run the
8 entire of part of the test suite . Example:
10 # Exercises the test suite in the types directory....
11 /Volumes/data/lldb/svn/ToT/test $ ./dotest.py -A x86_64 types
14 Session logs for test failures/errors/unexpected successes will go into directory '2012-05-16-13_35_42'
212 raise Exception("Unable to find '%s' within file %s" % (string_to_match, filename))
335 :param test_base: The current test's TestBase object.
358 def __init__(self, test, trace):
361 # The test might not have undergone the 'setUp(self)' phase yet, so that
363 self.session = getattr(test, "session", None) if test else None
380 print(self.getvalue(), file=sys.stderr)
382 print(self.getvalue(), file=self.session)
522 BenchBase for one example). lldbtest.Base works with the test driver to
552 "Test file '%s' must reside within lldb_test_src "
558 """Returns True if we are in trace mode (tracing detailed test execution)."""
563 print(*args, file=sbuf, **kwargs)
582 print("Change dir to:", full_dir, file=sys.stderr)
606 file=sys.stderr,
616 print("Restore dir to:", cls.oldcwd, file=sys.stderr)
624 # create a new set of log files for every test
627 # confirm that the file is writeable
677 # is writing to the "server.log" file in the current test directory. This can be
710 # by the test suite while leaving the directories untouched is neccessary because
711 # sub-directories might belong to an other test
715 # list of files we have to remove during test runs.
722 """Return the full path to the current test."""
729 """Return the full path to the current test."""
735 """Create the test-specific working directory, deleting any previous
743 """Return absolute path to an artifact in the test's build directory."""
747 """Return absolute path to a file in the test's source directory."""
799 """Fixture for unittest test case setup.
801 It works with the test driver to conditionally skip tests and does other
824 # If we spawn an lldb process for test (via pexpect), do not load the
825 # init file unless told otherwise.
829 # Assign the test method name to self.testMethodName.
831 # For an example of the use of this attribute, look at test/types dir.
832 # There are a bunch of test cases under test/types and we don't want the
834 # used for all the test cases.
857 # List of log files produced by the current test.
862 # before creating the first log file.
869 # initially. If the test errored/failed, the session info
870 # is then dumped into a session specific file for diagnosis.
961 cmd = cmd.replace("target create ", "file ")
967 print("runCmd:", cmd, file=sbuf)
969 print("check of return status not required", file=sbuf)
975 print("output:", self.res.GetOutput(), file=sbuf)
977 print("runCmd failed!", file=sbuf)
978 print(self.res.GetError(), file=sbuf)
986 print("Command '" + cmd + "' failed!", file=sbuf)
1001 During test execution, there might be cases where we don't want to show the
1010 In this case, the test method calls self.HideStdout(self) to redirect the
1013 Note that you should only call this method at most once during a test case
1049 print("Adding tearDown hook:", getsource_if_available(hook), file=sbuf)
1061 print("tearing down the child process....", file=sbuf)
1084 """Fixture for unittest test case teardown."""
1091 "Executing tearDown hook:", getsource_if_available(hook), file=sbuf
1110 # Remove subprocesses created by the test.
1128 # Various callbacks to allow introspection of test progress
1137 print("ERROR", file=sbuf)
1140 """Callback invoked when an error occurs while a test is cleaning up."""
1145 print("CLEANUP_ERROR", file=sbuf)
1148 """Callback invoked when a failure (test assertion failure) occurred."""
1153 print("FAIL", file=sbuf)
1162 print("expected failure", file=sbuf)
1165 """Callback invoked when a test is skipped."""
1168 # False because there's no need to write "skipped test" to the
1171 print("skipped test", file=sbuf)
1180 print("unexpected success", file=sbuf)
1188 log files pertaining to this test
1194 Dump the debugger interactions leading to a test error/failure. This
1199 addExpectedFailure methods to allow us to to mark the test instance as
1203 # We are here because self.tearDown() detected that this test instance
1240 for test, traceback in pairs:
1241 if test is self:
1242 print(traceback, file=session)
1249 file=session,
1281 # (enables reading of the current test configuration)
1286 enable parts of tests, if you want to skip a whole test use skipIfXmlSupportMissing
1320 'platform get-file "/proc/cpuinfo" ' + cpuinfo_path, check=False
1359 # mode. This is required by certain test programs to setup register
1397 """Returns the architecture in effect the test suite is running with."""
1405 """Returns the compiler in effect the test suite is running with."""
1426 """Returns the target platform the test suite is running on."""
1436 Any operator other than the following defaults to an equality test:
1461 """Command line option for -A and -C to run this test again, called from
1670 Create an object file at the given path from a yaml file.
1702 print(str(method) + ":", result, file=sbuf)
1731 # Metaclass for TestBase to change the list of test metods when a new TestCase is loaded.
1732 # We change the test methods to create a new test method for each test for each debug info we are
1733 # testing. The name of the new test method will be '<original-name>_<debug-info>' and with adding
1734 # the new test method we remove the old method at the same time. This functionality can be
1735 # supressed by at test case level setting the class attribute NO_DEBUG_INFO_TESTCASE or at test
1748 # where "None" means to run the test as usual.
1754 if attrname.startswith("test") and not getattr(
1805 # Setup the metaclass for this class to change the list of the test
1815 Important things for test class writers:
1818 with the debugger as part of the test. These include:
1819 - populate the test method name
1827 of the test to return the debugger to a good state for the next test.
1829 - execute any tearDown hooks registered by the test method with
1834 - perform build cleanup before running the next test method in the
1835 same test class; examples of registering for this service can be
1841 cleanup for the entire test class; also, subclasses can implement the
1845 test cases to send a command to the command interpreter and to perform
1851 particular test scenario. A plugin should be provided for the
1852 sys.platform running the test suite. The Mac OS X implementation is
1857 # test multiple times with various debug info types.
1893 # Works with the test driver to conditionally skip tests via
1912 """If we are remotely running the test suite, register the shared libraries with the target so they get uploaded, otherwise do nothing
1914 Any modules in the target that have their remote install file specification set will
1930 # The path can be a full path to a shared library, or a make file name like "Foo" for
2017 # local tests change directory into each test subdirectory
2022 # be sure that all test-specific resources have been freed before we
2028 # We'd like to reuse the debugger for our next test without incurring
2093 print("looking at:", output, file=sbuf)
2103 print("%s pattern: %s" % (heading, pattern), file=sbuf)
2104 print("Matched" if matched else "Not matched", file=sbuf)
2278 # Assemble the absolute path to the check file. As a convenience for
2279 # LLDB inline tests, assume that the check file is a relative path to
2280 # a file within the inline test directory.
2319 print(filecheck_trace, file=sbuf)
2409 print("looking at:", output, file=sbuf)
2488 print(log_msg, file=sbuf)
2622 Creates a target from the file found at the given file path.
2624 :param file_path: The file path that should be used to create the target.
2625 The default argument opens the current default test
2626 executable in the current test directory.
2647 # Misc. helper methods for debugging test execution
2691 def RemoveTempFile(cls, file):
2692 if os.path.exists(file):
2693 remove_file(file)
2696 # On Windows, the first attempt to delete a recently-touched file can fail
2701 def remove_file(file, num_retries=1, sleep_duration=0.5):
2704 os.remove(file)