Ejemplo n.º 1
0
    def test_export_project3_all_tools(self):
        export.setup(self.subparser)
        args = self.parser.parse_args(["export", "-f", "test_workspace/projects.yaml", "-p", "project_3"])
        result = export.run(args)

        # one of the tools is unknown , should return -1
        assert result == -1
Ejemplo n.º 2
0
    def test_export_project2_all_tools(self):
        export.setup(self.subparser)
        args = self.parser.parse_args(["export", "-f", "test_workspace/projects.yaml", "-p", "project_2"])
        result = export.run(args)

        # No tools defined
        assert result == -1
Ejemplo n.º 3
0
    def test_clean_one_project(self):
        # We first export project, then clean it
        export.setup(self.export_subparser)
        args = self.parser.parse_args([
            'export', '-f', 'test_workspace/projects.yaml', '-p', 'project_2',
            '-t', 'uvision'
        ])
        result = export.run(args)

        # this should export a project to generated_projects/uvision_project_2/project_2.uvproj
        assert os.path.isfile(
            'generated_projects/uvision_project_2/project_2.uvproj')
        assert result == 0

        # now clean
        clean.setup(self.clean_subparser)
        args = self.parser.parse_args([
            'clean', '-f', 'test_workspace/projects.yaml', '-p', 'project_2',
            '-t', 'uvision'
        ])
        result = clean.run(args)

        assert not os.path.isfile(
            'generated_projects/uvision_project_2/project_2.uvproj')
        assert not os.path.isdir('generated_projects/uvision_project_2')
        assert result == 0
Ejemplo n.º 4
0
    def test_export_one_project_eclipse_make_gcc_arm(self):
        export.setup(self.subparser)
        args = self.parser.parse_args(
            ["export", "-f", "test_workspace/projects.yaml", "-p", "project_2", "-t", "eclipse_make_gcc_arm"]
        )
        result = export.run(args)

        assert result == 0
Ejemplo n.º 5
0
    def test_export_one_project_arm_none_eabi_gdb(self):
        export.setup(self.subparser)
        args = self.parser.parse_args(
            ["export", "-f", "test_workspace/projects.yaml", "-p", "project_2", "-t", "arm_none_eabi_gdb"]
        )
        result = export.run(args)

        assert result == 0
Ejemplo n.º 6
0
    def test_export_workspace_iar_arm(self):
        export.setup(self.subparser)
        args = self.parser.parse_args(
            ["export", "-f", "test_workspace/projects.yaml", "-p", "project_workspace", "-t", "iar_arm"]
        )
        result = export.run(args)

        assert result == 0
Ejemplo n.º 7
0
    def test_export_project2_all_tools(self):
        export.setup(self.subparser)
        args = self.parser.parse_args([
            'export', '-f', 'test_workspace/projects.yaml', '-p', 'project_2'
        ])
        result = export.run(args)

        # No tools defined
        assert result == -1
Ejemplo n.º 8
0
    def test_export_project3_all_tools(self):
        export.setup(self.subparser)
        args = self.parser.parse_args([
            'export', '-f', 'test_workspace/projects.yaml', '-p', 'project_3'
        ])
        result = export.run(args)

        # one of the tools is unknown , should return -1
        assert result == -1
Ejemplo n.º 9
0
    def test_export_workspace_iar_arm(self):
        export.setup(self.subparser)
        args = self.parser.parse_args([
            'export', '-f', 'test_workspace/projects.yaml', '-p',
            'project_workspace', '-t', 'iar_arm'
        ])
        result = export.run(args)

        assert result == 0
Ejemplo n.º 10
0
    def test_export_one_project_eclipse_make_gcc_arm(self):
        export.setup(self.subparser)
        args = self.parser.parse_args([
            'export', '-f', 'test_workspace/projects.yaml', '-p', 'project_2',
            '-t', 'eclipse_make_gcc_arm'
        ])
        result = export.run(args)

        assert result == 0
Ejemplo n.º 11
0
    def test_export_one_project_arm_none_eabi_gdb(self):
        export.setup(self.subparser)
        args = self.parser.parse_args([
            'export', '-f', 'test_workspace/projects.yaml', '-p', 'project_2',
            '-t', 'arm_none_eabi_gdb'
        ])
        result = export.run(args)

        assert result == 0
Ejemplo n.º 12
0
    def test_export_workspace_all_tools(self):
        export.setup(self.subparser)
        args = self.parser.parse_args(["export", "-f", "test_workspace/projects.yaml", "-p", "project_workspace"])
        result = export.run(args)

        # we dont specify tool to export, which is not valid for workspace.
        # we don't know which tool we should build worksapce for as it consists
        # of projects, and each can speficify tools supported.
        assert result == -1
Ejemplo n.º 13
0
    def test_export_one_project_make_gcc_arm(self):
        export.setup(self.subparser)
        args = self.parser.parse_args(
            ["export", "-f", "test_workspace/projects.yaml", "-p", "project_2", "-t", "make_gcc_arm"]
        )
        result = export.run(args)

        assert result == 0
        # this should export a project to generated_projects/uvision_project_2/Makefile
        assert os.path.isfile("generated_projects/make_gcc_arm_project_2/Makefile")
Ejemplo n.º 14
0
    def test_export_one_project_coide(self):
        export.setup(self.subparser)
        args = self.parser.parse_args(
            ["export", "-f", "test_workspace/projects.yaml", "-p", "project_2", "-t", "coide"]
        )
        result = export.run(args)

        assert result == 0

        # this should export a project to generated_projects/uvision_project_2/project_2.coproj
        assert os.path.isfile("generated_projects/coide_project_2/project_2.coproj")
Ejemplo n.º 15
0
    def test_export_workspace_all_tools(self):
        export.setup(self.subparser)
        args = self.parser.parse_args([
            'export', '-f', 'test_workspace/projects.yaml', '-p',
            'project_workspace'
        ])
        result = export.run(args)

        # we dont specify tool to export, which is not valid for workspace.
        # we don't know which tool we should build worksapce for as it consists
        # of projects, and each can speficify tools supported.
        assert result == -1
Ejemplo n.º 16
0
    def test_export_one_project_make_gcc_arm(self):
        export.setup(self.subparser)
        args = self.parser.parse_args([
            'export', '-f', 'test_workspace/projects.yaml', '-p', 'project_2',
            '-t', 'make_gcc_arm'
        ])
        result = export.run(args)

        assert result == 0
        # this should export a project to generated_projects/uvision_project_2/Makefile
        assert os.path.isfile(
            'generated_projects/make_gcc_arm_project_2/Makefile')
Ejemplo n.º 17
0
    def test_export_one_project_coide(self):
        export.setup(self.subparser)
        args = self.parser.parse_args([
            'export', '-f', 'test_workspace/projects.yaml', '-p', 'project_2',
            '-t', 'coide'
        ])
        result = export.run(args)

        assert result == 0

        # this should export a project to generated_projects/uvision_project_2/project_2.coproj
        assert os.path.isfile(
            'generated_projects/coide_project_2/project_2.coproj')
Ejemplo n.º 18
0
    def test_export_one_project_iar_arm(self):
        export.setup(self.subparser)
        args = self.parser.parse_args(
            ["export", "-f", "test_workspace/projects.yaml", "-p", "project_2", "-t", "iar_arm"]
        )
        result = export.run(args)

        assert result == 0

        # this should export a project to generated_projects/uvision_project_2/project_2.ewp/ewd/eww
        assert os.path.isfile("generated_projects/iar_arm_project_2/project_2.ewp")
        assert os.path.isfile("generated_projects/iar_arm_project_2/project_2.ewd")
        assert os.path.isfile("generated_projects/iar_arm_project_2/project_2.eww")
Ejemplo n.º 19
0
    def test_export_one_project_iar_arm(self):
        export.setup(self.subparser)
        args = self.parser.parse_args([
            'export', '-f', 'test_workspace/projects.yaml', '-p', 'project_2',
            '-t', 'iar_arm'
        ])
        result = export.run(args)

        assert result == 0

        # this should export a project to generated_projects/uvision_project_2/project_2.ewp/ewd/eww
        assert os.path.isfile(
            'generated_projects/iar_arm_project_2/project_2.ewp')
        assert os.path.isfile(
            'generated_projects/iar_arm_project_2/project_2.ewd')
        assert os.path.isfile(
            'generated_projects/iar_arm_project_2/project_2.eww')
Ejemplo n.º 20
0
    def test_clean_one_project(self):
        # We first export project, then clean it
        export.setup(self.export_subparser)
        args = self.parser.parse_args(['export','-f','test_workspace/projects.yaml','-p','project_2',
            '-t', 'uvision'])
        result = export.run(args)

        # this should export a project to generated_projects/uvision_project_2/project_2.uvproj
        assert os.path.isfile('generated_projects/uvision_project_2/project_2.uvproj')
        assert result == 0

        # now clean
        clean.setup(self.clean_subparser)
        args = self.parser.parse_args(['clean','-f','test_workspace/projects.yaml','-p','project_2',
            '-t', 'uvision'])
        result = clean.run(args)

        assert not os.path.isfile('generated_projects/uvision_project_2/project_2.uvproj')
        assert not os.path.isdir('generated_projects/uvision_project_2')
        assert result == 0