Commit Graph

14 Commits

Author SHA1 Message Date
Kate Stone b9c1b51e45 *** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style.  This kind of mass change has
*** two obvious implications:

Firstly, merging this particular commit into a downstream fork may be a huge
effort.  Alternatively, it may be worth merging all changes up to this commit,
performing the same reformatting operation locally, and then discarding the
merge for this particular commit.  The commands used to accomplish this
reformatting were as follows (with current working directory as the root of
the repository):

    find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} +
    find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ;

The version of clang-format used was 3.9.0, and autopep8 was 1.2.4.

Secondly, “blame” style tools will generally point to this commit instead of
a meaningful prior commit.  There are alternatives available that will attempt
to look through this change and find the appropriate prior commit.  YMMV.

llvm-svn: 280751
2016-09-06 20:57:50 +00:00
Zachary Turner 6c29ca7dd0 Put progress.py back, apparently this can't be deleted.
llvm-svn: 255159
2015-12-09 21:32:28 +00:00
Zachary Turner 94ea56bc8b Remove the -P option from dotest.py
This was an option to display a graphical progress bar.  Nobody
is using this, and it doesn't work correctly anyway with the new
result formatter.

llvm-svn: 255153
2015-12-09 20:48:59 +00:00
Zachary Turner 059e52c44c Python 3 - Fix some issues with class / instance variables in unittest2.
Explanation from a Python wizard (not me) about why this exhibited
different behavior under Python 2 and Python 3.

    `cmp` is a builtin_function_or_method in Python 2.7, which doesn't
    have a __get__ and doesn't qualify as a "descriptor".  Your lambda is a
    regular function which qualifies as a descriptor whose __get__ method
    returns a bound instance.

His suggested fix was to write

    sortTestMethodsUsing = staticmethod(cmp_)

However, I don't think `sortTestMethodsUsing` (or any of the other fields
of `TestLoader`) should be class attributes anyway.  They are all accessed
through self, so they should be instance attributes.  So the fix employed
here is to convert them to instance attributes.

Differential Revision: http://reviews.llvm.org/D14453
Reviewed By: Todd Fiala

llvm-svn: 252346
2015-11-06 21:37:07 +00:00
Zachary Turner 71d468be66 Python 3 - Fix usage of `unicode` in unittest2.
llvm-svn: 252189
2015-11-05 19:21:56 +00:00
Zachary Turner cc8aa4f619 Python 3 - Apply 2to3 `filter` fixer to unittest2.
llvm-svn: 252181
2015-11-05 18:38:02 +00:00
Zachary Turner 46f1784bac Python 3 - Fix checking of string types in unittest2 module.
This patch actually introduces a dependency from unittest2 to
six.  This should be ok since both packages are in our own
repo, and we assume a sys.path of the top-level script that
can find the third party packages.  So unittest2 should be
able to find six.

llvm-svn: 251983
2015-11-03 21:37:42 +00:00
Zachary Turner 234860133b Python 3 - Fix some issues in unittest2.
unittest2 was using print statements in a few places, and also
using the `cmp` function (which is removed in Python 3).  Again,
we need to stop using unittest2 and using unittest instead, but
this seems like an easier route for now.

llvm-svn: 251978
2015-11-03 21:02:00 +00:00
Zachary Turner 9618980a19 Python 3: Modernize exception raising syntax.
Old-style: `raise foo, bar`
New-style: `raise foo(bar)`

These two statements are equivalent, but the former is an error in
Python 3.

llvm-svn: 251977
2015-11-03 21:01:45 +00:00
Zachary Turner c07138f6a0 Python 3 - modernize exception catching syntax.
Old-style syntax:  `except Exception, e:`
New-style syntax:  `except Exception as e:`

These two statements are identical, except that the former has
been deprecated for may versions, and was removed in Python 3.

This converts everything to use the new syntax (which also works
in Python 2).  I had to convert unittest2 as well.  What we really
need to do is just delete unittest2, and use unittest instead since
it is a standard module that ships with every Python distribution.
But this is the path of least resistance for now, although at
some point we will really need to do it.

llvm-svn: 251968
2015-11-03 19:49:05 +00:00
Zachary Turner af383ff70c Preparation for turning lldbsuite into a Python package.
The idea behind this patch is to expose the meat of
LLDB's Python infrastructure (test suite, scripts, etc)
as a single package.  This makes reusability and code
sharing among sub-packages easy.

Differential Revision: http://reviews.llvm.org/D14131

llvm-svn: 251460
2015-10-27 22:33:47 +00:00
Zachary Turner 0a0490b152 Rename `lldb_shared` to `use_lldb_suite`.
llvm-svn: 251444
2015-10-27 20:12:05 +00:00
Zachary Turner 746bb5e457 Move third party libraries to lldb/third_party
llvm-svn: 251046
2015-10-22 19:55:01 +00:00
Zachary Turner 4718944d50 Add `six` Python module to lldb/third_party.
Six is a python module designed to smooth the process of porting
Python 2 code to Python 3.  Specifically, six provides a consistent
interface to some of the breaking changes between 2 and 3.  For example,
the syntax for assigning a metaclass differs in Python 2 and 3.  Six
addresses this by providing a single class decorator that will do the
right thing depending on which version of Python is being run.

There are other examples too, such as dealing with renamed modules,
unicode literals, etc.

llvm-svn: 250857
2015-10-20 21:05:49 +00:00