summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2000-06-23 07:00:43 +0000
committerTim Potter <tpot@samba.org>2000-06-23 07:00:43 +0000
commita90b7ab61b1e1e93d515f74723f00382ced7ddf0 (patch)
tree39b2b32a748a1c571d1cce4c92f9207a5a651744 /testsuite
parentd4f652c9458e913081d036d54530c1a020b3b866 (diff)
downloadsamba-a90b7ab61b1e1e93d515f74723f00382ced7ddf0.tar.gz
samba-a90b7ab61b1e1e93d515f74723f00382ced7ddf0.tar.bz2
samba-a90b7ab61b1e1e93d515f74723f00382ced7ddf0.zip
Test harness stuff for compiling things.
(This used to be commit 0af2a1ea69fcdf21243fc7e9a9de8914817d4880)
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/lib/compile.exp66
1 files changed, 66 insertions, 0 deletions
diff --git a/testsuite/lib/compile.exp b/testsuite/lib/compile.exp
new file mode 100644
index 0000000000..6e79d431ea
--- /dev/null
+++ b/testsuite/lib/compile.exp
@@ -0,0 +1,66 @@
+#
+# Compilation utility functions
+#
+
+#
+# Unix SMB/Netbios implementation.
+# Copyright (C) Tim Potter 2000
+#
+# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+
+# Compile a program consisting of one .c file. For example
+# simple_compile "foo" will compile foo.c to the executable foo.exe
+
+proc simple_compile { args } {
+ global srcdir
+ global subdir
+
+ # Compile up program
+
+ set program [lindex $args 0]
+ set output [target_compile "$srcdir/$subdir/$program.c" \
+ "$srcdir/$subdir/$program" executable {additional_flags="-g"}]
+
+ # Check for errors
+
+ if {$output != ""} {
+ perror "compile $program"
+ puts $output
+ return -1
+ }
+}
+
+# Compile a program from a Makefile.suffix
+
+proc simple_make { args } {
+ global srcdir
+ global subdir
+
+ # Compile up program with make
+
+ set suffix [lindex $args 0]
+ set program [lindex $args 1]
+
+ set output [system "make -C $srcdir/$subdir -f Makefile.$suffix $program"]
+
+ # Check for errors
+
+ if { [regexp "Error" $output] } {
+ perror "make $program"
+ puts $output
+ return -1
+ }
+}