示例#1
0
    def __cmd_line(self):
        """Create GNATcheck command line arguments list.

        :return: the GNATcheck command line
        :rtype: collections.Iterable[str]
        """

        cmd_line = [
            'gnatcheck', '--show-rule', '-o', self.output,
            '-P', GNAThub.Project.path()]

        if GNAThub.u_process_all():
            cmd_line.extend(['-U'])

#  Keeping this for later implemntation of -U main switch
#        if GNAThub.u_main():
#            cmd_line.extend(['-U'])
#            cmd_line.extend([GNAThub.u_main()])

        cmd_line.extend(['-j%d' % GNAThub.jobs()])

        cmd_line = cmd_line + GNAThub.Project.scenario_switches()

        if GNAThub.Project.target():
            cmd = '{}-{}'.format(GNAThub.Project.target(), cmd_line[0])
            if self.__cmd_exists(cmd):
                cmd_line[0] = cmd
            else:
                cmd_line.extend(['--target', GNAThub.Project.target()])

        if GNAThub.Project.runtime():
            cmd_line.extend(('--RTS', GNAThub.Project.runtime()))
        if GNAThub.subdirs():
            cmd_line.extend(['--subdirs=' + GNAThub.subdirs()])
        return cmd_line
示例#2
0
    def __msg_reader_cmd_line():
        """Create GNATprove Message Reader command line arguments list.

        :return: the GNATprove message reader command line
        :rtype: collections.Iterable[str]
        """

        cmd_line = ['gnatprove', '-P', GNAThub.Project.path()]
        if GNAThub.subdirs():
            cmd_line.extend(['--subdirs=' + GNAThub.subdirs()])

        cmd_line.extend(['--report=all', '-j', str(GNAThub.jobs()),
                         '--output-msg-only', '--ide-progress-bar'])
        return cmd_line + GNAThub.Project.scenario_switches()
示例#3
0
    def __msg_reader_cmd_line():
        """Create GNATprove Message Reader command line arguments list.

        :return: the GNATprove message reader command line
        :rtype: collections.Iterable[str]
        """

        cmd_line = ['gnatprove', '-P', GNAThub.Project.path()]
        if GNAThub.subdirs():
            cmd_line.extend(['--subdirs=' + GNAThub.subdirs()])

        cmd_line.extend([
            '--report=all', '-j',
            str(GNAThub.jobs()), '--output-msg-only', '--ide-progress-bar'
        ])
        return cmd_line + GNAThub.Project.scenario_switches()
示例#4
0
    def __cmd_line():
        """Create GNATprove command line arguments list.

        :return: the GNATprove command line
        :rtype: collections.Iterable[str]
        """

        cmd_line = ['gnatprove', '-P', GNAThub.Project.path()]
        if GNAThub.u_process_all():
            cmd_line.extend(['-U'])

#  Keeping this for later implementation of -U main switch
#        if GNAThub.u_main():
#            cmd_line.extend([GNAThub.u_main()])

        if GNAThub.subdirs():
            cmd_line.extend(['--subdirs=' + GNAThub.subdirs()])

        cmd_line.extend(['--report=all', '-j', str(GNAThub.jobs())])
        return cmd_line + GNAThub.Project.scenario_switches()
示例#5
0
    def __cmd_line():
        """Create GNATprove command line arguments list.

        :return: the GNATprove command line
        :rtype: collections.Iterable[str]
        """

        cmd_line = ['gnatprove', '-P', GNAThub.Project.path()]
        if GNAThub.u_process_all():
            cmd_line.extend(['-U'])

#  Keeping this for later implementation of -U main switch
#        if GNAThub.u_main():
#            cmd_line.extend([GNAThub.u_main()])

        if GNAThub.subdirs():
            cmd_line.extend(['--subdirs=' + GNAThub.subdirs()])

        cmd_line.extend(['--report=all', '-j', str(GNAThub.jobs())])
        return cmd_line + GNAThub.Project.scenario_switches()
示例#6
0
    def __cmd_line():
        """Create CodePeer command line arguments list.

        :return: the CodePeer command line
        :rtype: collections.Iterable[str]
        """
        cmd_line = ['codepeer', '-P', GNAThub.Project.path(),
                    '-j%d' % GNAThub.jobs()]

        if GNAThub.u_process_all():
            cmd_line.extend(['-U'])

#  Keeping this for -U main switch implemntation
#        if GNAThub.u_main():
#            cmd_line.extend(['-U'])
#            cmd_line.extend([GNAThub.u_main()])

        if GNAThub.subdirs():
            cmd_line.extend(['--subdirs=' + GNAThub.subdirs()])

        return cmd_line + GNAThub.Project.scenario_switches()
示例#7
0
    def __cmd_line():
        """Create CodePeer command line arguments list.

        :return: the CodePeer command line
        :rtype: collections.Iterable[str]
        """
        cmd_line = [
            'codepeer', '-P',
            GNAThub.Project.path(),
            '-j%d' % GNAThub.jobs()
        ]

        if GNAThub.u_process_all():
            cmd_line.extend(['-U'])

#  Keeping this for -U main switch implemntation
#        if GNAThub.u_main():
#            cmd_line.extend(['-U'])
#            cmd_line.extend([GNAThub.u_main()])

        if GNAThub.subdirs():
            cmd_line.extend(['--subdirs=' + GNAThub.subdirs()])

        return cmd_line + GNAThub.Project.scenario_switches()
示例#8
0
assertEqual(relpath(GNAThub.logs()), os.path.join('obj', 'gnathub', 'logs'))

assertTrue(GNAThub.quiet())
assertFalse(GNAThub.verbose())
assertFalse(GNAThub.dry_run())
assertTrue(GNAThub.runners_only())
assertFalse(GNAThub.reporters_only())

assertTrue(os.path.isfile(GNAThub.database()))
assertEqual(
    relpath(GNAThub.database()),
    os.path.join('obj', 'gnathub', 'gnathub.db')
)

# Default for jobs number is 0
assertEqual(GNAThub.jobs(), 0)

# The plugin list is expected to be empty
assertEqual(len(GNAThub.plugins()), 0)

# We ensure that the core and extra plugins directories exist
repos = GNAThub.repositories()
for kind in ('system', 'global'):
    assertTrue(os.path.isdir(repos[kind]))

# GNAThub.run
TO_BE_ECHOED = 'this is the message to display on the standard output'

process = GNAThub.Run('echo', ('echo', TO_BE_ECHOED))

assertEqual(process.wait(), 0)