forked from Imagelibrary/binutils-gdb
[gdb/testsuite] Handle unbuffer_output.c for remote host
Handle $srcdir/lib/unbuffer_output.c using lappend_include_file. Tested on x86_64-linux.
This commit is contained in:
@@ -24,7 +24,11 @@ require {!gdb_skip_stdio_test "a2run.exp"}
|
|||||||
|
|
||||||
standard_testfile run.c
|
standard_testfile run.c
|
||||||
|
|
||||||
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
|
set flags {}
|
||||||
|
lappend flags debug
|
||||||
|
lappend_include_file flags $srcdir/lib/unbuffer_output.c
|
||||||
|
|
||||||
|
if { [prepare_for_testing "failed to prepare" $testfile $srcfile $flags] } {
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "../lib/unbuffer_output.c"
|
#include "unbuffer_output.c"
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* TESTS :
|
* TESTS :
|
||||||
|
|||||||
@@ -28,7 +28,11 @@ require {!target_info exists gdb,cannot_call_functions}
|
|||||||
|
|
||||||
set allow_float_test [allow_float_test]
|
set allow_float_test [allow_float_test]
|
||||||
|
|
||||||
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
|
set flags {}
|
||||||
|
lappend flags debug
|
||||||
|
lappend_include_file flags $srcdir/lib/unbuffer_output.c
|
||||||
|
|
||||||
|
if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "../lib/unbuffer_output.c"
|
#include "unbuffer_output.c"
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* TESTS :
|
* TESTS :
|
||||||
|
|||||||
@@ -25,7 +25,12 @@ require {!target_info exists gdb,cannot_call_functions}
|
|||||||
|
|
||||||
standard_testfile .c
|
standard_testfile .c
|
||||||
|
|
||||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
|
set flags {}
|
||||||
|
lappend flags debug
|
||||||
|
lappend flags nowarnings
|
||||||
|
lappend_include_file flags $srcdir/lib/unbuffer_output.c
|
||||||
|
|
||||||
|
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $flags] != "" } {
|
||||||
untested "failed to compile"
|
untested "failed to compile"
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "../lib/unbuffer_output.c"
|
#include "unbuffer_output.c"
|
||||||
|
|
||||||
char buf[100];
|
char buf[100];
|
||||||
char bigbuf[1000];
|
char bigbuf[1000];
|
||||||
|
|||||||
@@ -29,8 +29,11 @@ standard_testfile
|
|||||||
# test.
|
# test.
|
||||||
require {!target_info exists gdb,cannot_call_functions}
|
require {!target_info exists gdb,cannot_call_functions}
|
||||||
|
|
||||||
|
set flags {}
|
||||||
|
lappend flags debug
|
||||||
|
lappend_include_file flags $srcdir/lib/unbuffer_output.c
|
||||||
|
|
||||||
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
|
if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "../lib/unbuffer_output.c"
|
#include "unbuffer_output.c"
|
||||||
|
|
||||||
int
|
int
|
||||||
main (void)
|
main (void)
|
||||||
|
|||||||
@@ -28,7 +28,11 @@ require {!target_info exists gdb,cannot_call_functions}
|
|||||||
set dp_location [gdb_get_line_number "set dprintf here"]
|
set dp_location [gdb_get_line_number "set dprintf here"]
|
||||||
set bp_location [gdb_get_line_number "set breakpoint here"]
|
set bp_location [gdb_get_line_number "set breakpoint here"]
|
||||||
|
|
||||||
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
|
set flags {}
|
||||||
|
lappend flags debug
|
||||||
|
lappend_include_file flags $srcdir/lib/unbuffer_output.c
|
||||||
|
|
||||||
|
if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} {
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,9 +25,14 @@
|
|||||||
|
|
||||||
set allow_hw_watchpoint_tests_p [allow_hw_watchpoint_tests]
|
set allow_hw_watchpoint_tests_p [allow_hw_watchpoint_tests]
|
||||||
|
|
||||||
standard_testfile
|
standard_testfile run.c
|
||||||
|
|
||||||
if { [prepare_for_testing "failed to prepare" commands run.c {debug additional_flags=-DFAKEARGV}] } {
|
set flags {}
|
||||||
|
lappend flags debug
|
||||||
|
lappend flags additional_flags=-DFAKEARGV
|
||||||
|
lappend_include_file flags $srcdir/lib/unbuffer_output.c
|
||||||
|
|
||||||
|
if { [prepare_for_testing "failed to prepare" $testfile $srcfile $flags] } {
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "../lib/unbuffer_output.c"
|
#include "unbuffer_output.c"
|
||||||
|
|
||||||
static int g;
|
static int g;
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,11 @@
|
|||||||
|
|
||||||
standard_testfile
|
standard_testfile
|
||||||
|
|
||||||
if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
|
set flags {}
|
||||||
|
lappend flags debug
|
||||||
|
lappend_include_file flags $srcdir/lib/unbuffer_output.c
|
||||||
|
|
||||||
|
if { [prepare_for_testing "failed to prepare" $testfile $srcfile $flags] } {
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "../lib/unbuffer_output.c"
|
#include "unbuffer_output.c"
|
||||||
|
|
||||||
int callee (int x)
|
int callee (int x)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,7 +23,11 @@
|
|||||||
|
|
||||||
standard_testfile
|
standard_testfile
|
||||||
|
|
||||||
if { [prepare_for_testing "failed to prepare" $testfile] } {
|
set flags {}
|
||||||
|
lappend flags debug
|
||||||
|
lappend_include_file flags $srcdir/lib/unbuffer_output.c
|
||||||
|
|
||||||
|
if { [prepare_for_testing "failed to prepare" $testfile $srcfile $flags] } {
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
remote_exec build "rm -f core"
|
remote_exec build "rm -f core"
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "../lib/unbuffer_output.c"
|
#include "unbuffer_output.c"
|
||||||
|
|
||||||
#ifdef SIGNALS
|
#ifdef SIGNALS
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|||||||
@@ -19,7 +19,10 @@ require {!target_info exists gdb,noinferiorio}
|
|||||||
|
|
||||||
standard_testfile
|
standard_testfile
|
||||||
|
|
||||||
set options { debug }
|
set options {}
|
||||||
|
lappend options debug
|
||||||
|
lappend_include_file options $srcdir/lib/unbuffer_output.c
|
||||||
|
|
||||||
if { ! [target_info exists gdb,nosignals] } {
|
if { ! [target_info exists gdb,nosignals] } {
|
||||||
lappend options "additional_flags=-DSIGNALS"
|
lappend options "additional_flags=-DSIGNALS"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "../lib/unbuffer_output.c"
|
#include "unbuffer_output.c"
|
||||||
|
|
||||||
pid_t pids[4];
|
pid_t pids[4];
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,11 @@ require {istarget "*-*-linux*"}
|
|||||||
|
|
||||||
standard_testfile .c
|
standard_testfile .c
|
||||||
|
|
||||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
|
set flags {}
|
||||||
|
lappend flags debug
|
||||||
|
lappend_include_file flags $srcdir/lib/unbuffer_output.c
|
||||||
|
|
||||||
|
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $flags] != "" } {
|
||||||
untested "failed to compile"
|
untested "failed to compile"
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "../lib/unbuffer_output.c"
|
#include "unbuffer_output.c"
|
||||||
|
|
||||||
int factorial (int);
|
int factorial (int);
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,12 @@ set lib1 [standard_output_file shr1.sl]
|
|||||||
set lib2 [standard_output_file shr2.sl]
|
set lib2 [standard_output_file shr2.sl]
|
||||||
|
|
||||||
set lib_opts "debug"
|
set lib_opts "debug"
|
||||||
set exec_opts [list debug shlib=${lib1} shlib=${lib2}]
|
|
||||||
|
set exec_opts {}
|
||||||
|
lappend exec_opts debug
|
||||||
|
lappend exec_opts shlib=$lib1
|
||||||
|
lappend exec_opts shlib=$lib2
|
||||||
|
lappend_include_file exec_opts $srcdir/lib/unbuffer_output.c
|
||||||
|
|
||||||
if { [gdb_compile_shlib ${lib1src} ${lib1} $lib_opts] != ""
|
if { [gdb_compile_shlib ${lib1src} ${lib1} $lib_opts] != ""
|
||||||
|| [gdb_compile_shlib ${lib2src} ${lib2} $lib_opts] != ""
|
|| [gdb_compile_shlib ${lib2src} ${lib2} $lib_opts] != ""
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#include "ss.h"
|
#include "ss.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "../lib/unbuffer_output.c"
|
#include "unbuffer_output.c"
|
||||||
|
|
||||||
extern int structarg(struct s);
|
extern int structarg(struct s);
|
||||||
extern int pstructarg(struct s*);
|
extern int pstructarg(struct s*);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
#include "../lib/unbuffer_output.c"
|
#include "unbuffer_output.c"
|
||||||
|
|
||||||
int find_max1(int, ...);
|
int find_max1(int, ...);
|
||||||
int find_max2(int, int, ...);
|
int find_max2(int, int, ...);
|
||||||
|
|||||||
@@ -33,14 +33,16 @@ standard_testfile .c
|
|||||||
|
|
||||||
set allow_float_test [allow_float_test]
|
set allow_float_test [allow_float_test]
|
||||||
|
|
||||||
set additional_flags {debug}
|
set flags {}
|
||||||
|
lappend flags debug
|
||||||
|
lappend_include_file flags $srcdir/lib/unbuffer_output.c
|
||||||
if [support_complex_tests] {
|
if [support_complex_tests] {
|
||||||
lappend additional_flags "additional_flags=-DTEST_COMPLEX"
|
lappend flags "additional_flags=-DTEST_COMPLEX"
|
||||||
}
|
}
|
||||||
|
|
||||||
# build the first test case
|
# build the first test case
|
||||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
|
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
|
||||||
executable ${additional_flags}] != "" } {
|
executable $flags] != "" } {
|
||||||
untested "failed to compile"
|
untested "failed to compile"
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "../lib/unbuffer_output.c"
|
#include "unbuffer_output.c"
|
||||||
|
|
||||||
static int g;
|
static int g;
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,11 @@ set MIFLAGS "-i=mi"
|
|||||||
|
|
||||||
standard_testfile
|
standard_testfile
|
||||||
|
|
||||||
if {[build_executable $testfile.exp $testfile $srcfile {debug}] == -1} {
|
set flags {}
|
||||||
|
lappend flags debug
|
||||||
|
lappend_include_file flags $srcdir/lib/unbuffer_output.c
|
||||||
|
|
||||||
|
if {[build_executable $testfile.exp $testfile $srcfile $flags] == -1} {
|
||||||
untested "failed to compile"
|
untested "failed to compile"
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user