Blob Blame History Raw
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.

--- gdb-6.3/gdb/testsuite/gdb.base/move-dir.c.fix	Tue Jan 25 19:13:14 2005
+++ gdb-6.3/gdb/testsuite/gdb.base/move-dir.c	Tue Jan 25 19:12:40 2005
@@ -0,0 +1,9 @@
+#include <stdlib.h>
+#include "move-dir.h"
+
+int main() {
+   const char* hw = "hello world.";
+   printf ("%s\n", hw);;
+   other();
+}
+
--- gdb-6.3/gdb/testsuite/gdb.base/move-dir.exp.fix	Tue Jan 25 19:13:21 2005
+++ gdb-6.3/gdb/testsuite/gdb.base/move-dir.exp	Tue Jan 25 19:12:40 2005
@@ -0,0 +1,67 @@
+#   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.  
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel then {
+        strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "move-dir"
+set srcfile ${testfile}.c
+set incfile ${testfile}.h
+set binfile ${objdir}/${subdir}/${testfile}
+
+set testdir "${objdir}/${subdir}/incdir"
+
+remote_exec build "mkdir $testdir"
+remote_exec build "cp ${srcdir}/${subdir}/${srcfile} ${objdir}/${subdir}"
+remote_exec build "cp ${srcdir}/${subdir}/${incfile} ${testdir}"
+
+set additional_flags "additional_flags=-I${subdir}/incdir"
+
+if  { [gdb_compile "${objdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } {
+    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
--- gdb-6.3/gdb/testsuite/gdb.base/move-dir.h.fix	Tue Jan 25 19:17:50 2005
+++ gdb-6.3/gdb/testsuite/gdb.base/move-dir.h	Tue Jan 25 19:19:20 2005
@@ -0,0 +1,7 @@
+#include <stdlib.h>
+
+void other() {
+  const char* ostring = "other";
+  printf ("%s\n", ostring);;
+}
+