X-Git-Url: http://git.samba.org/samba.git/?p=ira%2Fwip.git;a=blobdiff_plain;f=testsuite%2Flib%2Fcompile.exp;h=070498d95895403bcf27d83bf4276173ee0ff16b;hp=6e79d431ea946c3d3397c4d56203c0daf1d66451;hb=9e9ef914acebd7291e0f4cfd2e0b6447d2e0e5bb;hpb=a90b7ab61b1e1e93d515f74723f00382ced7ddf0;ds=inline diff --git a/testsuite/lib/compile.exp b/testsuite/lib/compile.exp index 6e79d431ea9..070498d9589 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 } }