Lines Matching refs:self

565     def test_target_cpu(self, cpu_para):
569 cmd = self.CMD.format('--target-cpu', cpu_para).split()
571 result = self.get_match_result(cmd, "target_cpu", cpu_para)
576 def test_ccache(self, ccache_para):
580 cmd = self.CMD.format('--ccache', ccache_para).split()
582 result = self.get_match_result(cmd, "ccache", ccache_para)
587 def test_rename_last_log(self, rename_last_log_para):
591 cmd = self.CMD.format('--rename-last-log', rename_last_log_para).split()
595 if self.is_exist(self.LOG_PATH):
596 mtime = os.stat(self.LOG_PATH).st_mtime
597 file_name = '{}/build.{}.log'.format(self.LOG_PATH, mtime)
599 result = self.get_match_result(cmd, "rename_last_log", rename_last_log_para)
600 new_path = os.path.join(os.path.dirname(self.LOG_PATH), "build.{}.log".format(mtime))
604 assert self.is_exist(new_path) and result == 0, "rename_last_log para {} failed".format(
607 assert not self.is_exist(new_path) and result == 0, "rename_last_log para {} failed".format(
611 def test_build_target(self, build_target):
615 cmd = self.CMD.format('--build-target', build_target).split()
617 result = self.get_match_result(cmd, "build_target", build_target)
622 def test_ninja_args(self, ninja_args):
626 cmd = self.NINJIA_CMD.format(ninja_args).split()
628 result = self.get_match_result(cmd, "ninja_args", ninja_args)
633 def test_full_compilation(self, full_compilation):
637 cmd = self.CMD.format('--full-compilation', full_compilation).split()
639 result = self.get_match_result(cmd, "full_compilation", full_compilation)
644 def test_strict_mode(self, strict_mode):
648 cmd = self.CMD.format('--strict-mode', strict_mode).split()
650 result = self.get_match_result(cmd, "strict_mode", strict_mode)
655 def test_scalable_build(self, scalable_build):
659 cmd = self.CMD.format('--scalable-build', scalable_build).split()
661 result = self.get_match_result(cmd, "scalable_build", scalable_build)
666 def test_build_example(self, build_example):
670 cmd = self.CMD.format('--build-example', build_example).split()
672 result = self.get_match_result(cmd, "build_example", build_example)
677 def test_build_platform_name(self, build_platform_name):
681 cmd = self.CMD.format('--build-platform-name', build_platform_name).split()
683 result = self.get_match_result(cmd, "build_platform_name", build_platform_name)
688 def test_build_xts(self, build_xts):
692 cmd = self.CMD.format('--build-xts', build_xts).split()
694 result = self.get_match_result(cmd, "build_xts", build_xts)
699 def test_ignore_api_check(self, ignore_api_check):
704 cmd = self.CMD.format('--ignore-api-check', ignore_api_check).split()
705 resolve_result, result, _ = self.get_common_spec_result(ignore_api_check, cmd,
715 assert self.same_element(para_list, ignor_li) and result == 0, "ignore api check para {} failed".format(
719 def test_load_test_config(self, load_test_config):
723 cmd = self.CMD.format('--load-test-config', load_test_config).split()
725 result = self.get_match_result(cmd, "load_test_config", load_test_config)
730 def test_build_type(self, build_type):
734 cmd = self.CMD.format('--build-type', build_type).split()
735 result = self.get_match_result(cmd, "build_type", build_type)
740 def test_log_level(self, log_level):
744 cmd = self.CMD.format('--log-level', log_level).split()
746 result = self.get_match_result(cmd, "log_level", log_level)
751 def test_build_only_gn(self, build_only_gn):
755 cmd = self.CMD.format('--build-only-gn', build_only_gn).split()
757 result = self.get_match_result(cmd, "build_only_gn", build_only_gn)
762 def test_test(self, test):
766 cmd = self.CMD.format('--test', test).split()
768 result = self.get_match_result(cmd, "test", test)
773 def test_gn_args(self, gn_args):
777 cmd = self.CMD.format('--gn-args', gn_args).split()
779 result = self.get_match_result(cmd, "gn_args", gn_args)
784 def test_fast_rebuild(self, fast_rebuild):
788 cmd = self.CMD.format('--fast-rebuild', fast_rebuild).split()
790 result = self.get_match_result(cmd, "fast_rebuild", fast_rebuild)
795 def test_keep_ninja_going(self, going_option):
799 cmd = self.CMD.format('--keep-ninja-going', going_option).split()
801 result = self.get_match_result(cmd, "keep_ninja_going", going_option)
806 def test_build_variant(self, variant_option):
810 cmd = self.CMD.format('--build-variant', variant_option).split()
812 resolve_result, result, _ = self.get_common_spec_result(variant_option, cmd)
822 check_file_flag = self.check_file_res(resolve_result, check_file_li)
828 def test_device_type(self, device_option):
832 cmd = self.CMD.format('--device-type', device_option).split()
834 resolve_result, result, _ = self.get_common_spec_result(device_option, cmd)
846 check_file_flag = self.check_file_res(resolve_result, check_file_li)
850 def test_archive_image(self, archive_option):
854 cmd = self.CMD.format('--archive-image', archive_option).split()
856 resolve_result, result, cmd_res = self.get_common_spec_result(archive_option, cmd)
866 check_file_flag = self.check_file_res(resolve_result, check_file_li)
871 archive_resolve_result = self.resolve_res(cmd_res, archive_flags)
872 archive_result = self.check_flags(archive_resolve_result)
878 def test_rom_size_statistics(self, rom_option):
882 cmd = self.CMD.format('--rom-size-statistics', rom_option).split()
884 resolve_result, result, _ = self.get_common_spec_result(rom_option, cmd, ptyflag=True)
894 check_file_flag = self.check_file_res(resolve_result, check_file_li)
902 def test_stat_ccache(self, ccache_option):
906 cmd = self.CMD.format('--stat-ccache', ccache_option).split()
908 result = self.get_match_result(cmd, "stat_ccache", ccache_option)
913 def test_get_warning_list(self, warning_option):
917 cmd = self.CMD.format('--get-warning-list', warning_option).split()
918 resolve_result, result, _ = self.get_common_spec_result(warning_option, cmd)
923 check_file_flag = self.check_file_res(resolve_result, check_file_li)
931 def test_generate_ninja_trace(self, ninja_option):
935 cmd = self.CMD.format('--generate-ninja-trace', ninja_option).split()
936 resolve_result, result, _ = self.get_common_spec_result(ninja_option, cmd)
941 check_file_flag = self.check_file_res(resolve_result, check_file_li)
950 def test_compute_overlap_rate(self, overlap_option):
954 cmd = self.CMD.format('--compute-overlap-rate', overlap_option).split()
955 result = self.get_match_result(cmd, "compute_overlap_rate", overlap_option)
960 def test_clean_args(self, clean_option):
964 cmd = self.CMD.format('--clean-args', clean_option).split()
965 resolve_result, result, _ = self.get_common_spec_result(clean_option, cmd)
981 def test_deps_guard(self, deps_guard_option):
985 cmd = self.CMD.format('--deps-guard', deps_guard_option).split()
986 resolve_result, result, cmd_res = self.get_common_spec_result(deps_guard_option, cmd,
996 standard_resolve_result = self.resolve_res(cmd_res, standard_flags)
998 standard_result = self.check_flags(standard_resolve_result)
1005 def test_skip_partlist_check(self, partlist_option):
1009 cmd = self.CMD.format('--skip-partlist-check', partlist_option).split()
1010 result = self.get_match_result(cmd, "skip_partlist_check", partlist_option)
1014 def test_enable_pycache(self, enable_pycache):
1018 cmd = self.CMD.format('--enable-pycache', enable_pycache).split()
1024 resolve_result, result, _ = self.get_common_spec_result(enable_pycache, cmd,
1030 check_file_flag = self.check_file_res(resolve_result, check_file_li, is_real_path=True)
1037 def exec_command_select(self, cmd, timeout=60, ptyflag=False):
1054 ready_to_read, _, _ = select.select([proc.stdout, proc.stderr], [], [], self.select_timeout)
1084 ready_to_read, _, _ = select.select([master, ], [], [], self.select_timeout)
1103 def get_match_result(self, cmd, para_type, para_value, ptyflag=PTYFLAG):
1104 cmd_res, returncode = self.exec_command(cmd, ptyflag=ptyflag)
1105 before_flags, expect_dict = self.get_match_flags(para_type, para_value)
1106 flag_res = self.resolve_res(cmd_res, before_flags)
1107 result = self.check_flags(flag_res, expect_dict, returncode)
1109 self.print_error_line(cmd_res)
1111 self.print_error_line(cmd_res, is_success=True)
1114 def get_match_flags(self, para_type, para_value):
1116 if hasattr(self, method_name):
1117 method = self.__getattribute__(method_name)
1122 def get_common_spec_result(self, option, cmd, para_type=None, ptyflag=PTYFLAG):
1124 flag_res, expect_dict = self.get_common_flags(option, check_file=True)
1126 flag_res, expect_dict = self.get_match_flags(para_type, option)
1127 cmd_res, returncode = self.exec_command(cmd, ptyflag=ptyflag)
1128 resolve_result = self.resolve_res(cmd_res, flag_res)
1129 result = self.check_flags(resolve_result, expect_dict, returncode)
1131 self.print_error_line(cmd_res)
1133 self.print_error_line(cmd_res, is_success=True)
1136 def exec_command(self, cmd, ptyflag=PTYFLAG, timeout=TIMEOUT):
1138 return self.exec_command_select(cmd, timeout=timeout, ptyflag=ptyflag)
1140 return self.exec_command_communicate(cmd, timeout=timeout