subroutine test_simple_report_timer_b() type (TimeProfiler), target :: prof type (ProfileReporter) :: reporter character(:), allocatable :: report_lines(:) prof = TimeProfiler('top') ! timer 1 call prof%start() call prof%start('timer_1') ! 2 call prof%start('timer_1a')! 3 call prof%stop('timer_1a') call prof%start('timer_1b') ! 4 call prof%start('timer_1b1') ! 5 call prof%stop('timer_1b1') call prof%stop('timer_1b') call prof%stop('timer_1') call prof%start('timer_2') ! 6 call prof%start('timer_2b')! 7 call prof%stop('timer_2b') call prof%stop('timer_2') call prof%start('timer_1') ! 2 call prof%start('timer_1a')! 3 call prof%stop('timer_1a') call prof%stop('timer_1') call prof%start('timer_2') ! 6 call prof%stop('timer_2') call prof%start('timer_2') ! 6 call prof%stop('timer_2') call prof%finalize() reporter = ProfileReporter(empty) call reporter%add_column(NameColumn(20)) call reporter%add_column(FormattedTextColumn('# cycles','(i8.0)', 8, NumCyclesColumn())) call reporter%add_column(FormattedTextColumn('T(incl)','(f15.6)', 15, InclusiveColumn())) report_lines = reporter%generate_report(prof) @assertEqual(1 + 7, size(report_lines)) @assertEqual(20 + 1 + 8 + 1 + 15, len(report_lines(1))) @assertEqual('Name # cycles', report_lines(1)(1:29)) @assertEqual('top 1', report_lines(2)(1:29)) @assertEqual('--timer_1 2', report_lines(3)(1:29)) @assertEqual('----timer_1a 2', report_lines(4)(1:29)) @assertEqual('----timer_1b 1', report_lines(5)(1:29)) @assertEqual('------timer_1b1 1', report_lines(6)(1:29)) @assertEqual('--timer_2 3', report_lines(7)(1:29)) @assertEqual('----timer_2b 1', report_lines(8)(1:29)) end subroutine test_simple_report_timer_b