bug-libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Libtool head: Testsuite newline comparison problem.


From: Ralf Wildenhues
Subject: Re: Libtool head: Testsuite newline comparison problem.
Date: Thu, 25 Aug 2005 14:36:42 +0200
User-agent: Mutt/1.4.1i

* Peter Ekberg wrote on Thu, Aug 25, 2005 at 12:24:04PM CEST:
> 
> On MSYS (both MinGW and MSVC), test 17 and 18 fail because
> of a line ending mixup. The test programs output text with
> \r\n line endings, but the test suite generates the expected
> output with \n line endings. For test 18 it is even a mix,
> since the testsuite is adding one line with \n line endings
> to the test program output (using echo >>"$at_output"). The
> difference in line endings cause the comparison between
> expected and actual output to fail.
> 
> The attached rather horrible hack, which is probably not
> very correct, works around the problem. A solution should
> probably be added to AT_CHECK and/or LT_AT_EXEC_CHECK.

Yes, it should be solved in LT_AT_EXEC_CHECK.

But I'd like a different solution now: Do not compare output,
but return value only.  Rationale: besides the EOL issues, I
have seen debug output from cross compile environments that
disturbs this as well (wine startup, for example).

Also note that the use of AT_CHECK in the second example breaks
with cross compilation.

How about this patch instead?

Cheers,
Ralf

        * tests/standalone.at, tests/template.at: Do not compare
        output because of EOL issues.  Resolve warnings, make cross-
        compilation aware.
        Reported by Peter Ekberg <address@hidden>.

Index: tests/standalone.at
===================================================================
RCS file: /cvsroot/libtool/libtool/tests/standalone.at,v
retrieving revision 1.1
diff -u -r1.1 standalone.at
--- tests/standalone.at 23 Aug 2005 01:52:07 -0000      1.1
+++ tests/standalone.at 25 Aug 2005 12:32:08 -0000
@@ -74,7 +74,7 @@
 AT_SETUP([linking libltdl without autotools])
 
 AT_DATA([module.c],
-[[char *
+[[const char *
 hello (void)
 {
   return "Hello!";
@@ -89,7 +89,7 @@
 main (int argc, char **argv)
 {
   lt_dlhandle handle;
-  char *(*func) (void) = 0;
+  const char *(*func) (void) = 0;
   int status = 1;
 
   LTDL_SET_PRELOADED_SYMBOLS();
@@ -104,7 +104,7 @@
     goto finish;
   }
 
-  func = (char *(*)(void)) lt_dlsym (handle, "hello");
+  func = (const char *(*)(void)) lt_dlsym (handle, "hello");
   if (!func) {
     fprintf (stderr, "error fetching func: %s\n", lt_dlerror());
     goto finish;
@@ -148,10 +148,6 @@
 LT_AT_LIBTOOLIZE([--copy --ltdl])
 ${MAKE-make} CC="$CC" CPPFLAGS="$CPPFLAGS" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS"
 
-AT_DATA([expout],
-[[Hello!
-]])
-
-AT_CHECK([./ltdldemo], 0, expout)
+LT_AT_EXEC_CHECK([./ltdldemo], 0, [ignore])
 
 AT_CLEANUP
Index: tests/template.at
===================================================================
RCS file: /cvsroot/libtool/libtool/tests/template.at,v
retrieving revision 1.5
diff -u -r1.5 template.at
--- tests/template.at   21 Aug 2005 18:47:08 -0000      1.5
+++ tests/template.at   25 Aug 2005 12:32:08 -0000
@@ -73,7 +73,7 @@
   cout << "a sample prog" << endl;
   cout << "f(3) = " << f(3) << endl;
   cout << "cf(3) = " << cf(3) << endl;
-  return 0;
+  return (f(3) + 3 - cf(3) != 0);
 }
 ]])
 
@@ -84,10 +84,7 @@
 AT_CHECK($CXX -I. $CPPFLAGS $CXXFLAGS -c -o prog.o prog.cpp, [0], [ignore], 
[ignore])
 AT_CHECK($LIBTOOL --tag=CXX --mode=link $CXX $CPPFLAGS $CXXFLAGS -o prog 
prog.o libalib.la, [0], [ignore], [ignore])
 
-LT_AT_EXEC_CHECK([./prog], [0], [a sample prog
-f(3) = 6
-cf(3) = 9
-], [ignore])
+LT_AT_EXEC_CHECK([./prog], [0], [ignore], [ignore])
 
 
 dnl with autoreconf, use:




reply via email to

[Prev in Thread] Current Thread [Next in Thread]