def end_test():
    '''
    Run test cases. Random or repeat test cases. First, lead test suit list. Second,repeat case 1~x x is be defined on Settings config.Third, random test case if you choose on  Settings config.
    '''
    import logging_wrapper

    #end track and export track as KML
    end_current_track_and_export_kml(get_log_root())

    #move the crash to the current log dir
    move_crash()
    clear_status()
    #back to auto test after end
    set_can_continue()
    launcher = Launcher()
    launcher.launch_from_launcher('auto_test')
    end_test_runners_accessibility()
    log_root = logging_wrapper.log_root
    if os.path.exists(log_root):
        log_status = log_root + os.sep + "log_status.qsst"
        logging_wrapper.__write_log(SERVICE_END_TIME + DIVIDE + get_file_timestring(), log_status)

    enableTouchPanel()
    if SC.PRIVATE_HOSTLOGGING_ENABLE_FEATURE:
        quit_qxdm()
Beispiel #2
0
def end_test():
    '''
    Run test cases. Random or repeat test cases. First, lead test suit list. Second,repeat case 1~x x is be defined on Settings config.Third, random test case if you choose on  Settings config.
    '''
    #move the crash to the current log dir
    move_crash()
    clear_status()
    #back to auto test after end
    set_can_continue()
    launcher = Launcher()
    launcher.launch_from_launcher('auto_test')
    end_test_runners_accessibility()
Beispiel #3
0
    def test_case_init(self):
        '''
        init the test case . such as: set the L{current_case_continue_flag<current_case_continue_flag>} to True;
        save the current case name; init the logging; launcher this application
        '''
        case_config_map = fs_wrapper.get_test_case_config(
            self.name, self.suit_name)
        global case_des
        case_des = case_config_map.get(fs_wrapper.CASE_DESCRIPTION)
        if case_des == None:
            case_des = ''

        #if auto insert case waypoint.
        if SC.PRIVATE_TRACKING_AUTO_INSERT_CASE_WAYPOINT:
            if int(SC.PUBLIC_RUNNING_REPEAT_NUMBER) == 1:
                case_utility.insert_waypoint(
                    case_utility.START_RUN + self.name, case_des)
            else:
                case_utility.insert_waypoint(
                    case_utility.START_RUN + '(' + str(self.cycle_index) +
                    '/' + str(SC.PUBLIC_RUNNING_REPEAT_NUMBER) + ') ' +
                    self.name, case_des)

        if getprop_suspend():
            log_test_case('TestCaseBase', 'enable touch panel')
            enableTouchPanel()
            log_test_case('TestCaseBase', 'end enable touch panel')

        if getprop_suspend():
            signal.signal(signal.SIGUSR1, OnshakeSignal_handler)
            log_test_case(
                'suspend',
                'suspended, wait for shake-signal from java resume --- 3')
            signal.pause()
            log_test_case(
                'Finally!!!',
                'good luck, already gotten signal and resumed.... --- 4')
        log_test_framework(self.name, 'case init...')
        set_can_continue()
        if (self.runReason == CASE_BE_REFERED):
            (ori_suit_name,
             ori_case_name) = self.original_ClassName.rsplit('.', 1)
            set_cur_case_name(ori_case_name)
        elif (self.runReason == CASE_RUN_SELF):
            set_cur_case_name(self.name)
        qsst_log_case_init()
        clear_logcat()
        #deal with watcher ANR and FC
        global enable_watcher_anr_fc
        enable_watcher_anr_fc = case_config_map.get(
            fs_wrapper.CASE_ENABLE_WATCHER_ANR_AND_FC)
        if (enable_watcher_anr_fc == '0'):
            case_utility.disable_watcher_anr_fc()
 def test_case_init(self):
     '''
     init the test case . such as: set the L{current_case_continue_flag<current_case_continue_flag>} to True;
     save the current case name; init the logging; launcher this application
     '''
     if getprop_suspend() :
         signal.signal(signal.SIGUSR1, OnshakeSignal_handler)
         log_test_case('suspend', 'suspended, wait for shake-signal from java resume --- 3')
         signal.pause()
         log_test_case('Finally!!!', 'good luck, already gotten signal and resumed.... --- 4')
     log_test_framework(self.name, 'case init...')
     set_can_continue()
     set_cur_case_name(self.name)
     qsst_log_case_init()
     self.launcher.launch_from_launcher(self.app_name)
     clear_logcat()
Beispiel #5
0
 def test_case_notification(self):
     '''
     send notification to tell user that the current case is starting
     '''
     import settings.common as SC
     if fs_wrapper.run_init_settings:
         case_utility.update_notificationbar('presettings is running...')
     else:
         set_can_continue()
         if (self.runReason == CASE_BE_REFERED):
             (ori_suit_name,
              ori_case_name) = self.original_ClassName.rsplit('.', 1)
         elif (self.runReason == CASE_RUN_SELF):
             ori_suit_name = self.suit_name
             ori_case_name = self.name
         else:
             return
         case_description = self.case_config_map.get(
             fs_wrapper.CASE_DESCRIPTION)
         if (case_description == None or case_description == ""):
             note_case_info = ori_case_name
         else:
             note_case_info = case_description
         suit_config_map = fs_wrapper.get_test_suit_config(ori_suit_name)
         suit_description = suit_config_map.get(fs_wrapper.SUIT_DESCRIPTION)
         if (suit_description == None or suit_description == ""):
             note_suit_info = ori_suit_name
         else:
             note_suit_info = suit_description
         #case_utility.update_notificationbar('(' + str(self.cycle_index) +'/' + str(SC.PUBLIC_RUNNING_REPEAT_NUMBER) + ')' + self.suit_name + '.' + self.name)
         log_test_framework(
             'notify', '(' + str(self.cycle_index) + '/' +
             str(SC.PUBLIC_RUNNING_REPEAT_NUMBER) + ')' + note_suit_info +
             '.' + note_case_info)
         case_utility.update_notificationbar(
             '(' + str(self.cycle_index) + '/' +
             str(SC.PUBLIC_RUNNING_REPEAT_NUMBER) + ')' + note_suit_info +
             '.' + note_case_info)