Code: Alles auswählen.
" one test class only
temp_Class_Handles = au_Factory->get_Test_Class_Handles(
obj_Type = node_Info-object-trobjtype
obj_Name = node_Info-object-sobj_Name ).
loop at temp_Class_Handles into test_Class_Handle.
class_Name = test_Class_Handle->get_Class_Name( ).
if ( class_Name ne sub_Key-class_Name ).
continue.
endif.
if ( sub_Key-method_Name is initial ).
" complete test class
insert test_Class_Handle into table test_Class_Handles.
else.
" single test method
clear method_Range.
insert initial line into table method_Range
assigning <range_Entry>.
<range_Entry>-sign = 'I'.
<range_Entry>-option = 'EQ'.
<range_Entry>-low = sub_Key-method_Name.
create object method_Decorator
exporting
test_Instance = test_Class_Handle.
method_Decorator->restrict_Methods(
range = method_Range ).
insert method_Decorator into table test_Class_Handles.
endif.
exit. " loop
endloop.
Code: Alles auswählen.
CLASS passport DEFINITION FINAL CREATE PRIVATE.
PUBLIC SECTION.
CLASS-METHODS
get
RETURNING VALUE(result) TYPE REF TO passport.
ENDCLASS.
CLASS passport IMPLEMENTATION.
METHOD get.
CREATE OBJECT result.
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
DATA aunit_result TYPE REF TO if_saunit_internal_result.
DATA cvrg_rslt_provider TYPE REF TO if_aucv_cvrg_rslt_provider.
DATA runner TYPE REF TO cl_aucv_test_runner_abstract.
runner = zcl_aucv_test_runner_acp=>create( passport=>get( ) ).
runner->run_for_program_keys(
EXPORTING
i_limit_on_risk_level = 0
i_limit_on_duration_category = 0
i_program_keys = VALUE #( ( obj_name = 'ZCL_CLASSNAME' obj_type = 'CLAS' ) )
i_packages_to_measure = VALUE #( ( `$TMP` ) )
IMPORTING
e_aunit_result = aunit_result
e_coverage_result = cvrg_rslt_provider ). " can be initial
DATA task_data TYPE if_saunit_internal_rt_v3=>ty_s_task.
DATA task_result_casted TYPE REF TO cl_saunit_internal_result.
task_result_casted ?= aunit_result.
CALL FUNCTION '_SAUNIT_DSPL_RSLT_AS_DYNP_V3'
EXPORTING
task_data = task_result_casted->f_task_data
on_success_only_message = abap_true.