objc++: add first basic test
authorPeter Breitenlohner <peb@mppmu.mpg.de>
Thu, 26 Apr 2012 23:00:27 +0000 (01:00 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 2 May 2012 15:33:00 +0000 (17:33 +0200)
* t/objcxx-basic.sh: New test.
* t/list-of-tests.mk: Add it.

Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
t/list-of-tests.mk
t/objcxx-basic.sh [new file with mode: 0755]

index d692561..bc6dfe2 100644 (file)
@@ -704,6 +704,7 @@ t/notrans.sh \
 t/number.sh \
 t/objc.sh \
 t/objc2.sh \
+t/objcxx-basic.sh \
 t/objext-pr10128.sh \
 t/obsolete.sh \
 t/oldvars.sh \
diff --git a/t/objcxx-basic.sh b/t/objcxx-basic.sh
new file mode 100755 (executable)
index 0000000..33b8017
--- /dev/null
@@ -0,0 +1,48 @@
+#! /bin/sh
+# Copyright (C) 2012 Free Software Foundation, Inc.
+#
+# 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, 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.
+
+# Basic tests on the Objective C++ support that don't actually
+# require an Objective-C++ compiler.
+
+. ./defs || Exit 1
+
+cat > Makefile.am <<'END'
+bin_PROGRAMS = hello
+hello_SOURCES = hello.mm
+END
+
+$ACLOCAL
+AUTOMAKE_fails
+grep "'OBJCXX'.* undefined" stderr
+grep "add .*'AC_PROG_OBJCXX'" stderr
+
+rm -rf autom4te*.cache
+
+cat >> configure.ac <<'END'
+dnl Support for Object C++ was introduced only in Autoconf 2.65.
+AC_PREREQ([2.65])
+AC_PROG_OBJCXX
+END
+
+if $ACLOCAL; then
+  : We have a modern enough autoconf, go ahead.
+elif test $? -eq 63; then
+  skip_ "Object C++ support requires Autoconf 2.65 or later"
+else
+  Exit 1 # Some other aclocal failure.
+fi
+
+$AUTOMAKE
+$EGREP '^\.SUFFIXES:.* \.mm( |$)' Makefile.in
+
+: