Commit Graph

42 Commits

Author SHA1 Message Date
Johnny Chen 5f46b89df2 On second thought, inserting a delay of 1.0 second slows down the test suite
for the types directory quite a bit and masking out potential problems.  Enable
the delay via an environment variable, instead.

llvm-svn: 120719
2010-12-02 18:03:37 +00:00
Johnny Chen 560befce38 GenericTester.generic_type_expr_tester():
Don't overwhelm the expression mechanism.  Previously, there was no delay
    between successive invocations of 'expression' command.  The test suite
    run has experienced 'Resume timed out' or similar error messages.  Now we
    currently add a sleep of 1.0 second before issuing the next 'expression'
    command.

llvm-svn: 120626
2010-12-01 23:46:33 +00:00
Johnny Chen 1922a8dbea Remove @skip decorators for fixed crashes.
llvm-svn: 120479
2010-11-30 22:34:19 +00:00
Johnny Chen 876e6b31f5 Skip two test classes due to:
rdar://problem/8710994 Assertion failed: (reg_info) GDBRemoteRegisterContext.cpp, line 199

llvm-svn: 120462
2010-11-30 21:09:06 +00:00
Johnny Chen 94ce9711c1 We should make the class name of test cases which emphasize expression command
be different than the class name which uses frame variable command.

llvm-svn: 118602
2010-11-09 18:49:57 +00:00
Johnny Chen d2ed5dbf83 Clean up the test case by removing the filtering code related to fixed radars.
Also modify the:

    self.runCmd("expr %s" % var)

to be:

    self.runCmd("expression %s" % var)

since 'expr' is an alias of expression.  And fix the assert message to be either
'frame variable -t %s' or 'expression %s'.

llvm-svn: 118085
2010-11-02 22:01:37 +00:00
Johnny Chen fa3fa41d09 The remaining reference-related variable display failures have been fixed.
Comment out the filtering code.  The next check in will clean up the test case
by wiping off the filtering related logic.

llvm-svn: 118081
2010-11-02 21:43:50 +00:00
Johnny Chen 9a4c23635b Remove the reference-related variable displays that now pass from the 'notnow' set.
The failures that remain are:

        # rdar://problem/8620735 test/types: frame variable -t a_class_ref.m_b fails
        # The reference type related failures that remain are:
        notnow = set(['a_class_ref.m_b',
                      'a_struct_ref.b',
                      'a_union_nonzero_ref.u.a'])

llvm-svn: 118021
2010-11-02 17:06:08 +00:00
Johnny Chen 321ab7a1c8 Remove 8 @expectedFailure decorators, the following bug has been fixed:
# rdar://problem/8482903
    # test suite failure for types dir -- "long long" and "unsigned long long"

llvm-svn: 118017
2010-11-02 16:04:18 +00:00
Johnny Chen de7cd9229e Mark these test methods to be eligible for running only under the 'darwin' platform.
llvm-svn: 117071
2010-10-21 21:58:02 +00:00
Johnny Chen a295fd8045 Remove the two @skip decorators now that we are not seeing the hang while running the test suite.
llvm-svn: 116844
2010-10-19 18:43:57 +00:00
Johnny Chen 5517f64dae Uncomment the @skip decorator to reproduce the hang while running the test suite.
llvm-svn: 116763
2010-10-18 22:54:25 +00:00
Johnny Chen 690fcef762 Some re-achitecturing of the plugins interface. The caller is now required to
pass in a 'sender' arg to the buildDefault(), buildDsym(), buildDwarf(), and
cleanup() functions.  The sender arg will be the test instance itself (i.e.,
an instance of TestBase).  This is so that the relevant command execution can be
recorded in the TestBase.session object if sender is available.

The lldbtest.system() command has been modified to pop the 'sender' arg out of
the keyword arguments dictionary and use it as the test instance to facilitate
seesion recordings.  An example is in test/types/AbstractBase.py:

    def generic_type_tester(self, atoms, quotedDisplay=False):
        """Test that variables with basic types are displayed correctly."""

        # First, capture the golden output emitted by the oracle, i.e., the
        # series of printf statements.
        go = system("./a.out", sender=self)

There are cases when sender is None.  This is the case when the @classmethod is
involved in the use of these APIs.  When this happens, there is no recording
into a session object, but printing on the sys.stderr is still honored if the
trace flag is ON.

An example is in test/settings/TestSettings.py:

    @classmethod
    def classCleanup(cls):
        system(["/bin/sh", "-c", "rm -f output.txt"])
        system(["/bin/sh", "-c", "rm -f stdout.txt"])

llvm-svn: 116648
2010-10-15 23:55:05 +00:00
Johnny Chen 6e8ab6496a Fix these comments and the commented out code about 'frame variable -t', too.
llvm-svn: 116420
2010-10-13 19:25:42 +00:00
Johnny Chen 456c9c343e Apply (query-replace "frame variable" "frame variable -t") and fix a comment about 'expr var',
not 'frame variable var'.

llvm-svn: 116419
2010-10-13 19:22:50 +00:00
Johnny Chen 707b3c9c73 Added the capability for the test driver to relocate the tests and the intermediate
files to a different top level directory than those specified on the command line.

When relocated, the test clanups normally performed afterwards after each test method
and after each test class will not be exercised at all.  This allows for an easier
postmortem analysis of test failures.

Example:

./dotest.py -v -t -r /tmp/lldbtest types

will create a /tmp/lldbtest directory which houses the types directory and its supported
files.

Files modified:

o dotest.py, lldbtest.py:

  Add logic to process '-r dir' option to support relocating the tests to a different
  top level directory instead of exected in place.

o darwin.py, test/types/Makefile:

  The 'make clean' should only clean the minimum .o and .d files.

llvm-svn: 116255
2010-10-11 22:25:46 +00:00
Johnny Chen 2c2d69dff5 Change the regular expression used to grok the data type associated the output of
expression parser in light of the recent check ins.

Example:
    runCmd: expr a
    output: (double) $0 = 1100.12

llvm-svn: 115821
2010-10-06 20:00:48 +00:00
Johnny Chen 2f71831ceb Remove the @skip() and @expectedFaiure decorators, the previously affected tests
have now all passed.

rdar://problem/8502549 and rdar://problem/8493023 are fixed

llvm-svn: 115399
2010-10-02 01:46:20 +00:00
Johnny Chen b5051dc529 Added bug number to the @skip decorator.
llvm-svn: 115317
2010-10-01 16:34:53 +00:00
Johnny Chen 179543890e These currently crash (from running 'expr' command). Disable the entire class for the time being.
llvm-svn: 115316
2010-10-01 16:26:42 +00:00
Johnny Chen 9ea6e21f91 Updated to remove most of the @expectedFailure decorators for:
# rdar://problem/8493023
    # test/types failures for Test*TypesExpr.py: element offset computed wrong and sign error?

Two failures remain for test_short* test cases.

llvm-svn: 115229
2010-09-30 22:49:07 +00:00
Johnny Chen d8ed43cde0 Simple refactoring.
llvm-svn: 115075
2010-09-29 19:36:25 +00:00
Johnny Chen b19cd0fff4 Wrapped the regexp grokking of data type within a try:expect: instead of letting
the Python runtime take over in case there isn't a match.

llvm-svn: 115073
2010-09-29 19:29:42 +00:00
Johnny Chen 2c48dbec96 Added an example 'frame variable' output to demonstrate how the generic_type_tester
groks the data type of the variable.

llvm-svn: 115070
2010-09-29 19:12:10 +00:00
Johnny Chen c0ba019a19 Added @expectedFailure decorators for test suite failures:
# rdar://problem/8493023
    # test/types failures for Test*TypesExpr.py: element offset computed wrong?

llvm-svn: 115065
2010-09-29 19:02:20 +00:00
Johnny Chen cfd405fb42 Turn on generic type tester for expression parser; preparing to file bugs.
llvm-svn: 115063
2010-09-29 18:46:14 +00:00
Johnny Chen f3d3d1c743 Removed the two @skip class decorators. The assert failures have been fixed.
llvm-svn: 115055
2010-09-29 18:14:50 +00:00
Johnny Chen 06325d3020 Added TestIntegerTypesExpr.py and TestFloatTypesExpr.py which exercise 'expr'
command on the various basic types, similar to TestIntegerTypes.py and
TestFloatTypes.py, which exercise 'frame variable' on the various basic types.

Right now, they don't employ the self.expect() facility to compare against the
golden output.  They just invoke the self.runCmd() method to run the 'expr'
command.  Decorated the two classes with @unittest2.skip decorators for the time
being.

llvm-svn: 114987
2010-09-28 21:03:58 +00:00
Johnny Chen ecb17ffca1 Trivial assert message modification.
llvm-svn: 114927
2010-09-27 23:53:07 +00:00
Johnny Chen 58aa345df6 Use a better name for the abstract base class which contains the generic_type_tester()
method.  Renamed it to be AbstractBase.py, which contains the GenericTester class that
both IntegerTypesTestCase and FloatTypesTestCase inherit from.

llvm-svn: 114926
2010-09-27 23:46:46 +00:00
Johnny Chen 6316021bae Added "float" and "double" to types/TestBasicTypes.py. Abstracted the generic
type tester method into its own abstarct base class 'AbstractBase'.  And
added TestIntegerTypes.py and TestFloatTypes.py.

Added an option "-p reg-exp-pattern" to the test driver to specify a regular
expression pattern to match against eligible filenames as our test cases.

An example: 

/Volumes/data/lldb/svn/trunk/test $ ./dotest.py -v -p "TestFloat.*" types
----------------------------------------------------------------------
Collected 4 tests

test_double_type_with_dsym (TestFloatTypes.FloatTypesTestCase)
Test that double-type variables are displayed correctly. ... ok
test_double_type_with_dwarf (TestFloatTypes.FloatTypesTestCase)
Test that double-type variables are displayed correctly. ... ok
test_float_type_with_dwarf (TestFloatTypes.FloatTypesTestCase)
Test that float-type variables are displayed correctly. ... ok
test_float_types_with_dsym (TestFloatTypes.FloatTypesTestCase)
Test that float-type variables are displayed correctly. ... ok

----------------------------------------------------------------------
Ran 4 tests in 5.592s

OK

llvm-svn: 114923
2010-09-27 23:29:54 +00:00
Johnny Chen ff745c02ff Modified doc string.
llvm-svn: 114875
2010-09-27 21:04:54 +00:00
Johnny Chen ca54e280d5 Added @expectedFailure decorator for the "long long" and "unsigned long long"
test cases.

llvm-svn: 114872
2010-09-27 20:55:52 +00:00
Johnny Chen e1030cd883 Added "long long" and "unsigned long long" to the TestBasicTypes.py.
Added a special "clean" target to the types/Makefile to clean up all the *.o/.d
files.

The generic_type_tester() method is modified to take a set of atoms, instead of
type string as a required parameter, for example:

o unsigned int => set(['unsigned', 'int'])
o unsigned long long => set(['unsigned', 'long long'])
o long long => set(['long long'])

llvm-svn: 114871
2010-09-27 20:44:46 +00:00
Johnny Chen cdf612277a Commented out a debug stmt.
llvm-svn: 114770
2010-09-24 22:57:32 +00:00
Johnny Chen febf65f6fe Added 'char'/'unsigned char'/'short'/'unsigned short' to the test suite.
Extended generic_type_tester() method to take an additional keyword argument
quoteDisplay (default to False) to facilitate comparison with frame variable
display output of character types.

llvm-svn: 114769
2010-09-24 22:54:18 +00:00
Johnny Chen c01b78e7b2 Added two new .cpp files to be tested via TestBasicTypes.py for correct display
of various combinations of data structures with unsigned int or unsigned long
builtin types.

llvm-svn: 114756
2010-09-24 20:41:17 +00:00
Johnny Chen b052f6c595 Added a generic_type_tester() to the TestBasicTypes class to be used for
testing various combinations of displaying variales of basic types.

The generic_type_tester() works by first capturing the golden output produced
by the printf stmts of ./a.out, creating a list of (var, value) pairs, and then
running the a.out to a stop point, and comparing the 'frame variable var' output
against the list of (var, value) pairs.

Modified int_type() and added long_type() to use generic_type_tester().

Also modified TestBase.expect() such that substring matching also return ok if
the substring starts at the 0-th position.

llvm-svn: 114708
2010-09-23 23:35:28 +00:00
Johnny Chen 820b4c5153 Fixed a typo in member name; should be m_b, not b_a.
llvm-svn: 114660
2010-09-23 16:49:40 +00:00
Johnny Chen c70b02a324 Checked in an initial template for the types directory. Right now, it doesn't
actually test-and-compare anything yet.  The lldbtest.TestBase has an added
method setTearDownCleanup(dictionary=None) to facilitate running the cleanup
right after each data type test is run.  The test case can pass a dictionary
object when registering the test case cleanup.

There is currently only int_type test in the repository.

llvm-svn: 114600
2010-09-22 23:00:20 +00:00
Johnny Chen 6594b8cc9b Changed to facilitate 'breakpoint set -n Puts', then 'thread step-out' to workaround
rdar://problem/8464339 test/types directory: b basic_type.cpp:171 does not work, while gdb does work.

llvm-svn: 114557
2010-09-22 17:46:07 +00:00
Greg Clayton a4ddf7f802 Added the start of a test case that will test all basic types and all the
variety of ways they can be displayed in variable views.

llvm-svn: 114530
2010-09-22 04:50:38 +00:00