Running the test-suite remotely is similar to the process of running a local
test suite, but there are two things to have in mind:
1. You must have the lldb-server running on the remote system, ready to accept
multiple connections. For more information on how to setup remote debugging
see the Remote debugging page.
2. You must tell the test-suite how to connect to the remote system. This is
achieved using the ``--platform-name``, ``--platform-url`` and
``--platform-working-dir`` parameters to ``dotest.py``. These parameters
correspond to the platform select and platform connect LLDB commands. You
will usually also need to specify the compiler and architecture for the
remote system.
Currently, running the remote test suite is supported only with ``dotest.py`` (or
dosep.py with a single thread), but we expect this issue to be addressed in the
near future.
Debugging Test Failures
-----------------------
On non-Windows platforms, you can use the ``-d`` option to ``dotest.py`` which
will cause the script to wait for a while until a debugger is attached.
Debugging Test Failures on Windows
----------------------------------
On Windows, it is strongly recommended to use Python Tools for Visual Studio
for debugging test failures. It can seamlessly step between native and managed
code, which is very helpful when you need to step through the test itself, and
then into the LLDB code that backs the operations the test is performing.
A quick guide to getting started with PTVS is as follows:
#. Install PTVS
#. Create a Visual Studio Project for the Python code.
#. Go to File -> New -> Project -> Python -> From Existing Python Code.
#. Choose llvm/tools/lldb as the directory containing the Python code.
#. When asked where to save the .pyproj file, choose the folder ``llvm/tools/lldb/pyproj``. This is a special folder that is ignored by the ``.gitignore`` file, since it is not checked in.
#. Set test/dotest.py as the startup file
#. Make sure there is a Python Environment installed for your distribution. For example, if you installed Python to ``C:\Python35``, PTVS needs to know that this is the interpreter you want to use for running the test suite.
#. Go to Tools -> Options -> Python Tools -> Environment Options
#. Click Add Environment, and enter Python 3.5 Debug for the name. Fill out the values correctly.
#. Configure the project to use this debug interpreter.
#. Right click the Project node in Solution Explorer.
#. In the General tab, Make sure Python 3.5 Debug is the selected Interpreter.
#. In Debug/Search Paths, enter the path to your ninja/lib/site-packages directory.
#. In Debug/Environment Variables, enter ``VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\``.
#. If you want to enabled mixed mode debugging, check Enable native code debugging (this slows down debugging, so enable it only on an as-needed basis.)
#. Set the command line for the test suite to run.
#. Right click the project in solution explorer and choose the Debug tab.