Running a single test

I've been away from LLDB development for a little while but am
starting to work on it again.

I used to run a few tests using's -f or -p flags, but they
don't seem to be working now.

  -f filterspec Specify a filter, which consists of the test class
                        name, a dot, followed by the test method, to only
                        admit such test into the test suite
  -p pattern Specify a regexp filename pattern for inclusion in the
                        test suite

For example, I'd expect this command:

% python --executable
/tank/emaste/src/llvm/build-nodebug/bin/lldb -C /usr/bin/clang -v -t
-p TestCppIncompleteTypes

to run just the test(s), but instead it
looks like it runs the full suite.

I'd also expect

% python --executable
/tank/emaste/src/llvm/build-nodebug/bin/lldb -C /usr/bin/clang -v -t
-f TestCppIncompleteTypes.test_limit_debug_info

to run a single test from the same suite, but it runs no tests
("Collected 0 tests").

I'm sure these options used to work, although this could be an issue
that affects only FreeBSD. Do they work on Linux/OS X?

Try passing the directory to start in as the last argument. Also make sure you include .py on the filename when using -p (I don’t actually know if this is required but I do it).

% python --executable /tank/emaste/src/llvm/build-nodebug/bin/lldb -C /usr/bin/clang -v -t -p ~/src/llvm/tools/lldb/packages/Python/lldbsuite/test

I don’t know off the top of my head why that last argument is required, and I agree it’s counterintuitive and probably doesn’t need to be that way for technical reasons.

LMK if this works

Zachary’s solution will work as well but that one won’t make debugging the test too easy (still using several processes). If you want to run just 1 test then you have to specify --no-multiprocess and then you can use the same flags as before (-p, -f)

Ah yes, that works for -p, and explains why it worked for me before:
the tests themselves used to be in lldb/tests/... (that is,
subdirectories of's location), so they were found without
specifying an explicit path. Thanks.