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.

Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.c	2008-12-07 23:57:41.000000000 +0100
@@ -0,0 +1,10 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include "move-dir.h"
+
+int main() {
+   const char* hw = "hello world.";
+   printf ("%s\n", hw);;
+   other();
+}
+
Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.exp
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.exp	2008-12-07 10:13:01.000000000 +0100
@@ -0,0 +1,57 @@
+#   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 ${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
Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.h	2008-12-07 10:13:01.000000000 +0100
@@ -0,0 +1,7 @@
+#include <stdlib.h>
+
+void other() {
+  const char* ostring = "other";
+  printf ("%s\n", ostring);;
+}
+