$ ./mach cppunittest mfbt/tests/ cppunittests INFO | Running test Makefile.in ['/Users/ehsan/moz/src/mfbt/tests/Makefile.in'] 0:00.09 Caught exception running cpp unit tests: [Errno 13] Permission denied
The directory should be the path of binaries. e.g., /home/user/obj-x86_64-unknown-linux-gnu/dist/bin/mytest/
The bit of the mach command is here: http://hg.mozilla.org/mozilla-central/annotate/14a98501048c/testing/mach_commands.py#l259 It's currently calling extract_unittests_from_args: http://hg.mozilla.org/mozilla-central/annotate/14a98501048c/testing/runcppunittests.py#l148 which simply takes paths to executable files or directories of executable files. We ought to allow srcdir-relative paths (using knowledge from moz.build to choose just the cppunittests from those directories) or paths to .cpp files (similarly). This is probably somewhat involved to fix, since I'm not sure if we have the information we need in a useful format right now.