blob: a3bac8b6f953f5de88f39ee67c5ce7ce999b506a (
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
|
# Copyright (C) 2014 Free Software Foundation, Inc.
# This program 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.
#
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
set testfile "py-completion"
load_lib gdb-python.exp
gdb_exit
gdb_start
# Skip all tests if Python scripting is not enabled.
if { [skip_python_tests] } { continue }
gdb_test_no_output "source ${srcdir}/${subdir}/${testfile}.py"
# Create a temporary directory
set testdir "[standard_output_file "py-completion-testdir"]/"
set testdir_regex [string_to_regexp $testdir]
set testdir_complete [standard_output_file "py-completion-test"]
file mkdir $testdir
# This one should always pass.
send_gdb "completefileinit ${testdir_complete}\t"
gdb_test_multiple "" "completefileinit completion" {
-re "^completefileinit ${testdir_regex}$" {
pass "completefileinit completion"
}
}
# Just discarding whatever we typed.
gdb_test " " ".*" "discard #1"
# This is the problematic one.
send_gdb "completefilemethod ${testdir_complete}\t"
gdb_test_multiple "" "completefilemethod completion" {
-re "^completefilemethod ${testdir_regex} $" {
fail "completefilemethod completion (completed filename as wrong command arg)"
}
-re "^completefilemethod ${testdir_regex}$" {
pass "completefilemethod completion"
}
}
# Discarding again
gdb_test " " ".*" "discard #2"
# Another problematic
set completion_regex "[string_to_regexp [standard_output_file "py-completion-t"]]"
send_gdb "completefilecommandcond [standard_output_file "py-completion-t\t"]"
gdb_test_multiple "" "completefilecommandcond completion" {
-re "^completefilecommandcond ${testdir}$" {
fail "completefilecommandcond completion (completed filename instead of command)"
}
-re "^completefilecommandcond ${completion_regex}\007$" {
pass "completefilecommandcond completion"
}
}
|