From 61273e9de56672a7fd665a328c9804de6cff9432 Mon Sep 17 00:00:00 2001 From: Jacob Bachmeyer Date: Tue, 20 Dec 2022 21:43:12 -0600 Subject: [PATCH] Add tests for result conversion after errors --- ChangeLog | 7 +++ .../nested/testsuite/stat.test/stats-sub.exp | 5 +- testsuite/runtest.main/stats.exp | 63 ++++++++++++++-------- 3 files changed, 53 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index a686cf3..b116af9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2022-12-20 Jacob Bachmeyer + + * testsuite/runtest.main/stats.exp: Add tests for UNRESOLVED + results after warnings and errors. + * testsuite/runtest.main/nested/testsuite/stat.test/stats-sub.exp: + Add support for above. + 2022-11-30 Jacob Bachmeyer * testsuite/libdejagnu/unit.exp: Rename this... diff --git a/testsuite/runtest.main/nested/testsuite/stat.test/stats-sub.exp b/testsuite/runtest.main/nested/testsuite/stat.test/stats-sub.exp index c797ad1..7f80c22 100644 --- a/testsuite/runtest.main/nested/testsuite/stat.test/stats-sub.exp +++ b/testsuite/runtest.main/nested/testsuite/stat.test/stats-sub.exp @@ -1,4 +1,4 @@ -# Copyright (C) 1997-2016 Free Software Foundation, Inc. +# Copyright (C) 1997-2016, 2022 Free Software Foundation, Inc. # # This file is part of DejaGnu. # @@ -23,6 +23,9 @@ if { ![info exists STATS_TEST] } { return } +for {set i 0} {$i < $ERROR_COUNT} {incr i} { perror "test error $i" } +for {set i 0} {$i < $WARNING_COUNT} {incr i} { warning "test warning $i" } + switch $STATS_TEST { pass { pass "pass test" } fail { fail "fail test" } diff --git a/testsuite/runtest.main/stats.exp b/testsuite/runtest.main/stats.exp index dd127fe..b2a578b 100644 --- a/testsuite/runtest.main/stats.exp +++ b/testsuite/runtest.main/stats.exp @@ -1,4 +1,4 @@ -# Copyright (C) 1995-2016, 2018, 2020 Free Software Foundation, Inc. +# Copyright (C) 1995-2016, 2018, 2020, 2022 Free Software Foundation, Inc. # # This file is part of DejaGnu. # @@ -25,35 +25,56 @@ load_lib util-defs.exp runtest_setup_nested_testsuite set tests { - { stats pass "expected passes\[ \t\]+1\n" } - { stats fail "unexpected failures\[ \t\]+1\n" } - { stats xpass "unexpected successes\[ \t\]+1\n" } - { stats xfail "expected failures\[ \t\]+1\n" } - { stats kpass "unknown successes\[ \t\]+1\n" } - { stats kfail "known failures\[ \t\]+1\n" } - { stats untested "untested testcases\[ \t\]+1\n" } - { stats unresolved "unresolved testcases\[ \t\]+1\n" } - { stats unsupported "unsupported tests\[ \t\]+1\n" } - - { unit pass "expected passes\[ \t\]+1\n" } - { unit fail "unexpected failures\[ \t\]+1\n" } - { unit xpass "unexpected successes\[ \t\]+1\n" } - { unit xfail "expected failures\[ \t\]+1\n" } - { unit untested "untested testcases\[ \t\]+1\n" } - { unit unresolved "unresolved testcases\[ \t\]+1\n" } - { unit unsupported "unsupported tests\[ \t\]+1\n" } + { stats 0 0 pass "expected passes\[ \t\]+1\n" } + { stats 0 0 fail "unexpected failures\[ \t\]+1\n" } + { stats 0 0 xpass "unexpected successes\[ \t\]+1\n" } + { stats 0 0 xfail "expected failures\[ \t\]+1\n" } + { stats 0 0 kpass "unknown successes\[ \t\]+1\n" } + { stats 0 0 kfail "known failures\[ \t\]+1\n" } + { stats 0 0 untested "untested testcases\[ \t\]+1\n" } + { stats 0 0 unresolved "unresolved testcases\[ \t\]+1\n" } + { stats 0 0 unsupported "unsupported tests\[ \t\]+1\n" } + + { stats 1 0 pass "unresolved testcases\[ \t\]+1\n" } + { stats 1 0 fail "unresolved testcases\[ \t\]+1\n" } + { stats 1 0 xpass "unresolved testcases\[ \t\]+1\n" } + { stats 1 0 xfail "unresolved testcases\[ \t\]+1\n" } + { stats 1 0 kpass "unresolved testcases\[ \t\]+1\n" } + { stats 1 0 kfail "unresolved testcases\[ \t\]+1\n" } + { stats 1 0 untested "unresolved testcases\[ \t\]+1\n" } + { stats 1 0 unresolved "unresolved testcases\[ \t\]+1\n" } + { stats 1 0 unsupported "unresolved testcases\[ \t\]+1\n" } + + { stats 0 4 pass "unresolved testcases\[ \t\]+1\n" } + { stats 0 4 fail "unresolved testcases\[ \t\]+1\n" } + { stats 0 4 xpass "unresolved testcases\[ \t\]+1\n" } + { stats 0 4 xfail "unresolved testcases\[ \t\]+1\n" } + { stats 0 4 kpass "unresolved testcases\[ \t\]+1\n" } + { stats 0 4 kfail "unresolved testcases\[ \t\]+1\n" } + { stats 0 4 untested "unresolved testcases\[ \t\]+1\n" } + { stats 0 4 unresolved "unresolved testcases\[ \t\]+1\n" } + { stats 0 4 unsupported "unresolved testcases\[ \t\]+1\n" } + + { unit 0 0 pass "expected passes\[ \t\]+1\n" } + { unit 0 0 fail "unexpected failures\[ \t\]+1\n" } + { unit 0 0 xpass "unexpected successes\[ \t\]+1\n" } + { unit 0 0 xfail "expected failures\[ \t\]+1\n" } + { unit 0 0 untested "untested testcases\[ \t\]+1\n" } + { unit 0 0 unresolved "unresolved testcases\[ \t\]+1\n" } + { unit 0 0 unsupported "unsupported tests\[ \t\]+1\n" } } foreach t $tests { if { [util_test $RUNTEST \ "--local_init nested-init.exp --tool stat\ - STATS_TEST=[lindex $t 1] [lindex $t 0]-sub.exp" \ + ERROR_COUNT=[lindex $t 1] WARNING_COUNT=[lindex $t 2]\ + STATS_TEST=[lindex $t 3] [lindex $t 0]-sub.exp" \ "" \ [lindex $t 2]] } { - fail "[lindex $t 0]/[lindex $t 1]" + fail [join [lrange $t 0 3] /] runtest_copy_nested_testsuite_log stat } else { - pass "[lindex $t 0]/[lindex $t 1]" + pass [join [lrange $t 0 3] /] } } -- 2.11.4.GIT