Example #1
0
def add_clang_options(parser,
                      report_path=False,
                      style_file=False,
                      force=False):
    """
    Adds optional arguments to the parser for specifying options for
    clang binaries and their execution settings.
    """
    add_clang_bin_path_option(parser)
    if report_path:
        add_tmp_directory_option(parser)
    if style_file:
        add_clang_format_style_file_option(parser)
    if force:
        add_clang_format_force_option(parser)
Example #2
0
    os.chdir(str(settings.repository))
    print(exec_cmd_no_error(cmd))
    os.chdir(original)


class TestReportsCmd(ScriptTestCmd):
    def __init__(self, settings):
        super().__init__(settings)
        self.title = __file__

    def _exec(self):
        return super()._exec(tests)


###############################################################################
# UI
###############################################################################

if __name__ == "__main__":
    description = ("Tests reports.py through its range of options.")
    parser = argparse.ArgumentParser(description=description)
    add_tmp_directory_option(parser)
    settings = parser.parse_args()
    settings.repository = (
        bitcoin_setup_build_ready_repo(settings.tmp_directory,
                                       branch="v0.14.0"))
    settings.test_bin_dir = clang_setup_bin_dir(settings.tmp_directory)
    settings.test_style_file = (
        clang_setup_test_style_file(settings.tmp_directory))
    TestReportsCmd(settings).run()