From dcc39ea43984fe9f9c683e48423794793a923e28 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Wed, 9 May 2001 04:59:49 +0000 Subject: Cleaned up bitrot in nsswitch testsuite. Merged tests across from TNG branch. (This used to be commit acef477383e5739292e764c17cef87822a09f13b) --- testsuite/lib/compile.exp | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'testsuite/lib/compile.exp') diff --git a/testsuite/lib/compile.exp b/testsuite/lib/compile.exp index 6e79d431ea..070498d958 100644 --- a/testsuite/lib/compile.exp +++ b/testsuite/lib/compile.exp @@ -23,6 +23,7 @@ # Compile a program consisting of one .c file. For example # simple_compile "foo" will compile foo.c to the executable foo.exe +# Use a second argument to specify link libraries. proc simple_compile { args } { global srcdir @@ -31,8 +32,19 @@ proc simple_compile { args } { # Compile up program set program [lindex $args 0] - set output [target_compile "$srcdir/$subdir/$program.c" \ - "$srcdir/$subdir/$program" executable {additional_flags="-g"}] + set libs [lindex $args 1] + + if { $libs == "" } { + + set output [target_compile "$srcdir/$subdir/$program.c" \ + "$srcdir/$subdir/$program" executable \ + {additional_flags="-g"}] + } else { + + set output [target_compile "$srcdir/$subdir/$program.c" \ + "$srcdir/$subdir/$program" executable \ + [list libs=$libs additional_flags="-g"]] + } # Check for errors @@ -54,13 +66,14 @@ proc simple_make { args } { set suffix [lindex $args 0] set program [lindex $args 1] - set output [system "make -C $srcdir/$subdir -f Makefile.$suffix $program"] + set output [util_start "make" \ + "-C $srcdir/$subdir -f Makefile.$suffix $program"] # Check for errors if { [regexp "Error" $output] } { - perror "make $program" - puts $output - return -1 + perror "make $program" + puts $output + return -1 } } -- cgit