Exemple #1
0
    def test_flat_genproj(self):
        app_path = join(tempfile.gettempdir(), 'apps', 'mockapp')
        args = [
            "--output_directory", app_path, "--buck_module_path",
            "/apps/mockapp", "--gen_type", "flat", "--lines_of_code", "150000"
        ]
        command = GenProjCommandLine()
        command.main(args)

        self.verify_genproj('MockLib53', 101, app_path)
    def test_flat_genproj(self):
        app_path = join(tempfile.gettempdir(), 'apps', 'mockapp')
        args = [
            "--output_directory", app_path, "--project_generator_type",
            "cocoapods", "--gen_type", "flat", "--swift_lines_of_code",
            "150000"
        ]
        command = GenProjCommandLine()
        command.main(args)

        self.verify_genproj(app_path, 104, 902, 0)
        self.verify_lib(app_path, 'MockLib53')
Exemple #3
0
 def test_genproj_with_objc(self):
     app_path = join(tempfile.gettempdir(), 'apps', 'mockapp')
     args = [
         "--output_directory", app_path, "--blaze_module_path", "/apps/mockapp", "--gen_type", "flat",
         "--swift_lines_of_code", "0",
         "--objc_lines_of_code", "150000"
     ]
     command = GenProjCommandLine()
     command.main(args)
     # 1 Swift file count expected due to main.swift for the app target.
     self.verify_genproj(app_path, 104, 1, 2200)
     self.verify_lib(app_path, 'MockLib53', Language.OBJC)
    def test_genproj_with_objc(self):
        app_path = join(tempfile.gettempdir(), 'apps', 'mockapp')
        args = [
            "--output_directory", app_path, "--project_generator_type",
            "cocoapods", "--gen_type", "flat", "--swift_lines_of_code", "0",
            "--objc_lines_of_code", "150000"
        ]
        command = GenProjCommandLine()
        command.main(args)

        # 2 Swift file count expected due to main.swift and dummy.swift files for the app target.
        self.verify_genproj(app_path, 104, 2, 2200)
        self.verify_lib(app_path, 'MockLib53', Language.OBJC)
Exemple #5
0
    def test_dot_genproj(self):
        app_path = join(tempfile.gettempdir(), 'apps', 'mockapp')

        test_fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures', 'test_dot.gv')
        args = [
            "--output_directory", app_path, "--blaze_module_path", "/apps/mockapp", "--gen_type", "dot",
            "--swift_lines_of_code", "150000", "--dot_file", test_fixture_path, "--dot_root", "DotReaderMainModule"
        ]
        command = GenProjCommandLine()
        command.main(args)

        self.verify_genproj(app_path, 341, 675, 0)
        self.verify_lib(app_path, 'DotReaderLib17')
Exemple #6
0
    def test_dot_genproj_with_loc_mappings(self):
        app_path = join(tempfile.gettempdir(), 'apps', 'mockapp')

        test_fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures', 'test_dot.gv')
        loc_test_fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures', 'loc_mappings.json')
        args = [
            "--output_directory", app_path, "--blaze_module_path", "/apps/mockapp", "--gen_type", "dot",
            "--dot_file", test_fixture_path, "--dot_root", "DotReaderMainModule",
            "--loc_json_file_path", loc_test_fixture_path
        ]
        command = GenProjCommandLine()
        command.main(args)

        self.verify_genproj(app_path, 342, 484, 2)
        self.verify_lib(app_path, 'DotReaderLib17')
Exemple #7
0
#!/usr/bin/env python

#  Copyright (c) 2018 Uber Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from uberpoet.genproj import GenProjCommandLine

if __name__ == "__main__":
    GenProjCommandLine().main()