Toad World® Forums

Display automatically names of unit test and unit code


#1

Hello,

I want to display automatically some information via dbms_output

I would like to create procedures that would display :

  • the name of the unit test : this procedure would be called in the part ‘initialization for this unit test’ of the customization

  • the name of the test code : this procedure would be called in the part ‘initialization for this test code’ of the customization

Is it possible ? If yes, can you say me how I can do that ?

Thank you for your help,

Philippe


#2

This code should do the trick:

DECLARE
l_unit_test qu_unit_test%rowtype
:= qu_unit_test_qp.onerow (qu_result_xp.current_unit_test);
l_test_case qu_test_case%rowtype
:= qu_test_case_qp.onerow (qu_result_xp.current_test_case);
BEGIN
DBMS_OUTPUT.put_line (l_unit_test.program_name);
DBMS_OUTPUT.put_line (l_test_case.name);
END;