summaryrefslogtreecommitdiff
path: root/tests/compile3.test
diff options
context:
space:
mode:
authorPeter Rosin <peda@lysator.liu.se>2012-03-06 09:31:43 +0100
committerPeter Rosin <peda@lysator.liu.se>2012-03-06 09:31:43 +0100
commit5f624a6af8abbbd9695bee8d21d0713238ccba03 (patch)
tree2e2ce94b9b672e4740e986c111066ce6be97e5f8 /tests/compile3.test
parent74a7f49212cb3428846da599ac488e4a31ff57ed (diff)
parent8902f83dcd7874d57d88f742bd4c62724634cc82 (diff)
downloadautomake-5f624a6af8abbbd9695bee8d21d0713238ccba03.tar.gz
Merge branch 'msvc'
* msvc: scripts: support -I <dir> -L <dir> and -l <lib> for cl in compile
Diffstat (limited to 'tests/compile3.test')
-rwxr-xr-xtests/compile3.test43
1 files changed, 24 insertions, 19 deletions
diff --git a/tests/compile3.test b/tests/compile3.test
index 6393e111e..009de7023 100755
--- a/tests/compile3.test
+++ b/tests/compile3.test
@@ -30,24 +30,29 @@ END
chmod +x ./cl
-# Check if compile handles "-o foo", -I, -l, -L, -Xlinker -Wl,
-opts=`LIB= ./compile ./cl foo.c -o foo -lbar -Lgazonk -Ibaz -Xlinker foobar -Wl,-foo,bar`
-test x"$opts" = x"foo.c -Fefoo bar.lib -Ibaz -link -LIBPATH:gazonk foobar -foo bar"
-
-# Check if compile handles "-o foo.obj"
-opts=`./compile ./cl -c foo.c -o foo.obj -Ibaz`
-test x"$opts" = x"-c foo.c -Fofoo.obj -Ibaz"
-
-# Check if compile handles "-o foo.o"
-opts=`./compile ./cl -c foo.c -o foo.o -Ibaz`
-test x"$opts" = x"-c foo.c -Fofoo.o -Ibaz"
-
-# Check if compile handles "foo.cc" as C++.
-opts=`./compile ./cl -c foo.cc -o foo.o -Ibaz`
-test x"$opts" = x"-c -Tpfoo.cc -Fofoo.o -Ibaz"
-
-# Check if compile clears the "eat" variable properly.
-opts=`eat=1 ./compile ./cl -c foo.c -o foo.obj -Ibaz`
-test x"$opts" = x"-c foo.c -Fofoo.obj -Ibaz"
+# POSIX mandates that the compiler accepts a space between the -I,
+# -l and -L options and their respective arguments. Traditionally,
+# this should work also without a space. Try both usages.
+for sp in '' ' '; do
+ # Check if compile handles "-o foo", -I, -l, -L, -Xlinker -Wl,
+ opts=`LIB= ./compile ./cl foo.c -o foo -l${sp}bar -L${sp}gazonk -I${sp}baz -Xlinker foobar -Wl,-foo,bar`
+ test x"$opts" = x"foo.c -Fefoo bar.lib -Ibaz -link -LIBPATH:gazonk foobar -foo bar"
+
+ # Check if compile handles "-o foo.obj"
+ opts=`./compile ./cl -c foo.c -o foo.obj -I${sp}baz`
+ test x"$opts" = x"-c foo.c -Fofoo.obj -Ibaz"
+
+ # Check if compile handles "-o foo.o"
+ opts=`./compile ./cl -c foo.c -o foo.o -I${sp}baz`
+ test x"$opts" = x"-c foo.c -Fofoo.o -Ibaz"
+
+ # Check if compile handles "foo.cc" as C++.
+ opts=`./compile ./cl -c foo.cc -o foo.o -I${sp}baz`
+ test x"$opts" = x"-c -Tpfoo.cc -Fofoo.o -Ibaz"
+
+ # Check if compile clears the "eat" variable properly.
+ opts=`eat=1 ./compile ./cl -c foo.c -o foo.obj -I${sp}baz`
+ test x"$opts" = x"-c foo.c -Fofoo.obj -Ibaz"
+done
: