aboutsummaryrefslogtreecommitdiff
path: root/testsuite/runtest.libs/clone_output.test
blob: 18425fe9371fea1d5387ffd26cefcee93074c1c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# test clone_output						-*- Tcl -*-
#
# Copyright (C) 1996-2019, 2020 Free Software Foundation, Inc.
#
# This file is part of DejaGnu.
#
# DejaGnu is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# DejaGnu is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with DejaGnu; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.

if [ file exists $srcdir/$subdir/default_procs.tcl ] {
    source $srcdir/$subdir/default_procs.tcl
} else {
    puts "ERROR: $srcdir/$subdir/default_procs.tcl doesn't exist"
}
if [ file exists $srcdir/../lib/framework.exp] {
    source $srcdir/../lib/framework.exp
} else {
    puts "ERROR: $srcdir/../lib/framework.exp doesn't exist"
}

set all_flag 0
set errno ""

# The results in these tests are slightly convoluted because everything
# sent to the error or user stream is also copied to the log stream when
# actually using Expect, but the test harness records exactly what is
# explicitly passed, rather than what Expect will do with it.

# stuff that shouldn't print anything without all_flag set
set all_flag 0
run_tests {
    { lib_output_test clone_output {"PASS: Foo"}
	{ tty "" log "PASS: Foo\n" user "" error "" }
	"clone_output(pass) without all_flag set" }
    { lib_output_test clone_output {"XFAIL: Foo"}
	{ tty "" log "XFAIL: Foo\n" user "" error "" }
	"clone_output(xfail) without all_flag set" }
    { lib_output_test clone_output {"KFAIL: Foo"}
	{ tty "" log "KFAIL: Foo\n" user "" error "" }
	"clone_output(kfail) without all_flag set" }
    { lib_output_test clone_output {"UNRESOLVED: Foo"}
	{ tty "" log "UNRESOLVED: Foo\n" user "" error "" }
	"clone_output(unresolved) without all_flag set" }
    { lib_output_test clone_output {"UNSUPPORTED: Foo"}
	{ tty "" log "UNSUPPORTED: Foo\n" user "" error "" }
	"clone_output(unsupported) without all_flag set" }
    { lib_output_test clone_output {"UNTESTED: Foo"}
	{ tty "" log "UNTESTED: Foo\n" user "" error "" }
	"clone_output(untested) without all_flag set" }
    { lib_output_test clone_output {"ERROR: Bar"}
	{ tty "" log "" user "" error "ERROR: Bar\n" }
	"clone_output(error) without all_flag set" }
    { lib_output_test clone_output {"WARNING: Bar"}
	{ tty "" log "" user "" error "WARNING: Bar\n" }
	"clone_output(warning) without all_flag set" }
    { lib_output_test clone_output {"NOTE: Bar"}
	{ tty "" log "" user "" error "NOTE: Bar\n" }
	"clone_output(note) without all_flag set" }
}

# tests for all_flag set to 1
set all_flag 1
run_tests {
    { lib_output_test clone_output {"PASS: Foo"}
	{ tty "" log "" user "PASS: Foo\n" error "" }
	"clone_output(pass) with all_flag set" }
    { lib_output_test clone_output {"XFAIL: Foo"}
	{ tty "" log "" user "XFAIL: Foo\n" error "" }
	"clone_output(xfail) with all_flag set" }
    { lib_output_test clone_output {"KFAIL: Foo"}
	{ tty "" log "" user "KFAIL: Foo\n" error "" }
	"clone_output(kfail) with all_flag set" }
    { lib_output_test clone_output {"UNRESOLVED: Foo"}
	{ tty "" log "" user "UNRESOLVED: Foo\n" error "" }
	"clone_output(unresolved) with all_flag set" }
    { lib_output_test clone_output {"UNSUPPORTED: Foo"}
	{ tty "" log "" user "UNSUPPORTED: Foo\n" error "" }
	"clone_output(unsupported) with all_flag set" }
    { lib_output_test clone_output {"UNTESTED: Foo"}
	{ tty "" log "" user "UNTESTED: Foo\n" error "" }
	"clone_output(untested) with all_flag set" }
    { lib_output_test clone_output {"ERROR: Bar"}
	{ tty "" log "" user "" error "ERROR: Bar\n" }
	"clone_output(error) with all_flag set" }
    { lib_output_test clone_output {"WARNING: Bar"}
	{ tty "" log "" user "" error "WARNING: Bar\n" }
	"clone_output(warning) with all_flag set" }
    { lib_output_test clone_output {"NOTE: Bar"}
	{ tty "" log "" user "" error "NOTE: Bar\n" }
	"clone_output(note) with all_flag set" }
}

puts "END clone_output.test"