def METHOD_NAME(sys_argv):
    """
    Run all tests in the project.
    Arguments:
      sys_argv: a reference to sys.argv.
    """
    # TODO: use logging module
    print "pystache: running tests: argv: %s" % repr(sys_argv)
    should_source_exist = False
    spec_test_dir = None
    project_dir = None
    if len(sys_argv) > 1 and sys_argv[1] == FROM_SOURCE_OPTION:
        # This usually means the test_pystache.py convenience script
        # in the source directory was run.
        should_source_exist = True
        sys_argv.pop(1)
    try:
        # TODO: use optparse command options instead.
        project_dir = sys_argv[1]
        sys_argv.pop(1)
    except IndexError:
        if should_source_exist:
            project_dir = PROJECT_DIR
    try:
        # TODO: use optparse command options instead.
        spec_test_dir = sys_argv[1]
        sys_argv.pop(1)
    except IndexError:
        if project_dir is not None:
            # Then auto-detect the spec test directory.
            _spec_test_dir = get_spec_test_dir(project_dir)
            if not os.path.exists(_spec_test_dir):
                # Then the user is probably using a downloaded sdist rather
                # than a repository clone (since the sdist does not include
                # the spec test directory).
                print("pystache: skipping spec tests: spec test directory "
                      "not found")
            else:
                spec_test_dir = _spec_test_dir
    if len(sys_argv) <= 1 or sys_argv[-1].startswith("-"):
        # Then no explicit module or test names were provided, so
        # auto-detect all unit tests.
        module_names = _discover_test_modules(PACKAGE_DIR)
        sys_argv.extend(module_names)
        if project_dir is not None:
            # Add the current module for unit tests contained here (e.g.
            # to include SetupTests).
            sys_argv.append(__name__)
    SetupTests.project_dir = project_dir
    extra_tests = make_extra_tests(project_dir, spec_test_dir)
    test_program_class = make_test_program_class(extra_tests)
    # We pass None for the module because we do not want the unittest
    # module to resolve module names relative to a given module.
    # (This would require importing all of the unittest modules from
    # this module.)  See the loadTestsFromName() method of the
    # unittest.TestLoader class for more details on this parameter.
    test_program_class(argv=sys_argv, module=None)
    # No need to return since unitttest.main() exits.