diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2011-07-26 18:38:55 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2011-07-26 18:38:55 +0000 |
commit | db8e457004db245d2d9dbf680d0a948885b85154 (patch) | |
tree | b615af1834cdd0622c972ea23692de37100f86a1 /gdb/testsuite/gdb.python/py-value.exp | |
parent | dbdaa23218da484d7ae2e36b07882c7837e53bd7 (diff) | |
download | gdb-db8e457004db245d2d9dbf680d0a948885b85154.zip gdb-db8e457004db245d2d9dbf680d0a948885b85154.tar.gz gdb-db8e457004db245d2d9dbf680d0a948885b85154.tar.bz2 |
* gdb.python/py-mi.exp: Avoid '+' in filenames. Call C version of
executable file "${binfile}", C++ version "${binfile}-cxx".
* gdb.python/py-prettyprint.exp: Likewise.
* gdb.python/py-symbol.exp: Likewise.
* gdb.python/py-type.exp: Likewise.
* gdb.python/py-value.exp: Likewise.
* gdb.python/py-template.exp (test_template_arg): Pass full executable
file name instead of just suffix.
Diffstat (limited to 'gdb/testsuite/gdb.python/py-value.exp')
-rw-r--r-- | gdb/testsuite/gdb.python/py-value.exp | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp index cd8b9a5..bb9bed5 100644 --- a/gdb/testsuite/gdb.python/py-value.exp +++ b/gdb/testsuite/gdb.python/py-value.exp @@ -25,9 +25,15 @@ load_lib gdb-python.exp set testfile "py-value" set srcfile ${testfile}.c set binfile ${objdir}/${subdir}/${testfile} -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { - untested "Couldn't compile ${srcfile}" - return -1 + +# Build inferior to language specification. +proc build_inferior {exefile lang} { + global srcdir subdir srcfile testfile hex + + if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${exefile}" executable "debug $lang"] != "" } { + untested "Couldn't compile ${srcfile} in $lang mode" + return -1 + } } proc test_value_creation {} { @@ -323,19 +329,15 @@ proc test_value_after_death {} { # the type of the value was not being checked before allowing a # subscript operation to proceed. -proc test_subscript_regression {lang} { +proc test_subscript_regression {exefile lang} { - global srcdir subdir srcfile binfile testfile hex - if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}-${lang}" executable "debug $lang"] != "" } { - untested "Couldn't compile ${srcfile} in $lang mode" - return -1 - } + global srcdir subdir # Start with a fresh gdb. gdb_exit gdb_start gdb_reinitialize_dir $srcdir/$subdir - gdb_load ${binfile}-${lang} + gdb_load ${exefile} if ![runto_main ] then { perror "couldn't run to breakpoint" @@ -426,6 +428,9 @@ proc test_value_hash {} { gdb_test "python print one.__hash__() == hash(one)" "True" "Test inbuilt hash" } +# Build C and C++ versions of executable +build_inferior "${binfile}" "c" +build_inferior "${binfile}-cxx" "c++" # Start with a fresh gdb. @@ -457,7 +462,6 @@ test_inferior_function_call test_lazy_strings test_value_after_death -# The following test recompiles the binary to test either C or C++ -# values. -test_subscript_regression "c++" -test_subscript_regression "c" +# Test either C or C++ values. +test_subscript_regression "${binfile}" "c" +test_subscript_regression "${binfile}-cxx" "c++" |