-# Copyright (C) 2011-2012 Free Software Foundation, Inc.
+# Copyright (C) 2011-2018 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
# exposing values to Python.
if {[skip_shlib_tests]} {
- untested py-finish-breakpoint.exp
+ untested "skipping shared library tests"
return 0
}
load_lib gdb-python.exp
-if { $gdb_py_is_py24 == 1 } {
- # Python 2.4, 2.5 do not support the "ValueError as e" syntax used in
- # the py-finish-breakpoint.py script.
- untested py-finish-breakpoint.exp
- return 0
-}
-
set libfile "py-events-shlib"
set libsrc $srcdir/$subdir/$libfile.c
set lib_sl [standard_output_file $libfile-nodebug.so]
if { [gdb_compile_shlib $libsrc $lib_sl $lib_opts] != ""
|| [gdb_compile $srcdir/$subdir/$srcfile $binfile executable $exec_opts] != ""} {
- untested "Could not compile either $libsrc or $srcdir/$subdir/$srcfile."
+ untested "failed to compile"
return -1
}
# Start with a fresh gdb.
clean_restart ${testfile}
-set python_file ${srcdir}/${subdir}/${testfile}.py
+if { [skip_python_tests] } { continue }
+if { $gdb_py_is_py24 == 1 } {
+ # Python 2.4, 2.5 do not support the "ValueError as e" syntax used in
+ # the py-finish-breakpoint.py script.
+ untested "missing support on Python 2.4 and 2.5"
+ return 0
+}
# Skip all tests if Python scripting is not enabled.
if { [skip_python_tests] } { continue }
#
clean_restart ${testfile}
-gdb_load_shlibs ${lib_sl}
+gdb_load_shlib ${lib_sl}
if ![runto_main] then {
- fail "Cannot run to main."
+ fail "cannot run to main."
return 0
}
+set python_file [gdb_remote_download host \
+ ${srcdir}/${subdir}/${testfile}.py]
+
gdb_test_no_output "set confirm off" "disable confirmation"
gdb_test "source $python_file" "Python script imported.*" \
"import python scripts"
#
clean_restart ${testfile}
-gdb_load_shlibs ${lib_sl}
+gdb_load_shlib ${lib_sl}
gdb_test "source $python_file" "Python script imported.*" \
"import python scripts"
set cond_line [gdb_get_line_number "Condition Break."]
if ![runto_main] then {
- fail "Cannot run to main."
+ fail "cannot run to main."
return 0
}
#
clean_restart ${testfile}
-gdb_load_shlibs ${lib_sl}
+gdb_load_shlib ${lib_sl}
gdb_test "source $python_file" "Python script imported.*" \
"import python scripts"
#
clean_restart ${testfile}
-gdb_load_shlibs ${lib_sl}
+gdb_load_shlib ${lib_sl}
gdb_test "source $python_file" "Python script imported.*" \
"import python scripts"
if ![runto_main] then {
- fail "Cannot run to main."
+ fail "cannot run to main."
return 0
}
#
clean_restart ${testfile}
-gdb_load_shlibs ${lib_sl}
+gdb_load_shlib ${lib_sl}
gdb_test "source $python_file" "Python script imported.*" \
"import python scripts"
if ![runto_main] then {
- fail "Cannot run to main."
+ fail "cannot run to main."
return 0
}
#
clean_restart ${testfile}
-gdb_load_shlibs ${lib_sl}
+gdb_load_shlib ${lib_sl}
gdb_test "source $python_file" "Python script imported.*" \
"import python scripts"
if ![runto_main] then {
- fail "Cannot run to main."
+ fail "cannot run to main."
return 0
}
#
if ![runto "test_exec_exit"] then {
- fail "Cannot run to test_exec_exit."
+ fail "cannot run to test_exec_exit."
return 0
}
#
if ![runto "test_exec_exit"] then {
- fail "Cannot run to test_exec_exit."
+ fail "cannot run to test_exec_exit."
return 0
}