gdb/gdb-6.3-test-movedir-20050125.patch

96 lines
3.2 KiB
Diff
Raw Normal View History

2005-02-04 21:01:49 +00:00
2005-01-25 Elena Zannoni <ezannoni@redhat.com>
* gdb.base/move-dir.exp: New test.
* gdb.base/move-dir.c: Ditto.
* gdb.base/move-dir.h: Ditto.
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/move-dir.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/move-dir.c 2016-02-15 23:23:02.892499288 +0100
@@ -0,0 +1,10 @@
+#include <stdio.h>
2005-02-04 21:01:49 +00:00
+#include <stdlib.h>
+#include "move-dir.h"
+
+int main() {
+ const char* hw = "hello world.";
+ printf ("%s\n", hw);;
+ other();
+}
+
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/move-dir.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/move-dir.exp 2016-02-15 23:29:58.768461406 +0100
@@ -0,0 +1,57 @@
2005-02-04 21:01:49 +00:00
+# Copyright 2005
+# 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 2 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, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+set testfile "move-dir"
+set srcfile ${testfile}.c
+set incfile ${testfile}.h
+set binfile [standard_output_file ${testfile}]
2005-02-04 21:01:49 +00:00
+
+set testdir [standard_output_file incdir]
2005-02-04 21:01:49 +00:00
+
+remote_exec build "mkdir $testdir"
+remote_exec build "cp ${srcdir}/${subdir}/${srcfile} [standard_output_file ${srcfile}]"
+remote_exec build "cp ${srcdir}/${subdir}/${incfile} [standard_output_file ${incfile}]"
2005-02-04 21:01:49 +00:00
+
+set additional_flags "additional_flags=-I${subdir}/incdir"
+
+if { [gdb_compile [standard_output_file ${srcfile}] "${binfile}" executable [list debug $additional_flags]] != "" } {
2005-02-04 21:01:49 +00:00
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+
+set oldtimeout $timeout
+set timeout [expr "$timeout + 60"]
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_test "cd ../.." "" ""
+gdb_load ${binfile}
+gdb_test "list main" ".*hw.*other.*" "found main"
+gdb_test "list other" ".*ostring.*" "found include file"
+
+
+set timeout $oldtimeout
+return 0
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/move-dir.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/move-dir.h 2016-02-15 23:23:02.892499288 +0100
2005-02-04 21:01:49 +00:00
@@ -0,0 +1,7 @@
+#include <stdlib.h>
+
+void other() {
+ const char* ostring = "other";
+ printf ("%s\n", ostring);;
+}
+