bug-gnulib
[Top][All Lists]
Advanced

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

argp test failure


From: Bruno Haible
Subject: argp test failure
Date: Sat, 3 Mar 2007 01:34:58 +0100
User-agent: KMail/1.5.4

Hi,

On any platform except glibc-based ones, the argp test fails. For example,
on MacOS X, like this:

Making all in gltests
make  all-recursive
gcc  -g -O2   -o test-argp test-argp.o ../gllib/libgnu.a 
ld: Undefined symbols:
_program_name
make[4]: *** [test-argp] Error 1

This is because 'error' needs a program_name variable, but in the discussions
on 2006-09-09 and 2006-12-28 we found that it cannot be done automatically.

This fixes it for me. Committed.

2007-03-02  Bruno Haible  <address@hidden>

        * modules/argp-tests (Depends-on): Add progname.
        * tests/test-argp.c: Include argp.h first. Include progname.h.
        (main): Call set_program_name.

--- modules/argp-tests  25 Feb 2007 13:22:57 -0000      1.3
+++ modules/argp-tests  3 Mar 2007 00:31:46 -0000
@@ -3,6 +3,7 @@
 tests/test-argp-2.sh
 
 Depends-on:
+progname
 
 Makefile.am:
 TESTS += test-argp test-argp-2.sh
--- tests/test-argp.c   21 Jan 2006 19:09:06 -0000      1.1
+++ tests/test-argp.c   3 Mar 2007 00:31:46 -0000
@@ -1,5 +1,5 @@
 /* Test suite for argp.
-   Copyright (C) 2006 Free Software Foundation, Inc.
+   Copyright (C) 2006-2007 Free Software Foundation, Inc.
    This file is part of the GNUlib Library.
 
    This program is free software; you can redistribute it and/or modify
@@ -20,6 +20,8 @@
 # include <config.h>
 #endif
 
+#include "argp.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #if HAVE_STRING_H
@@ -29,7 +31,7 @@
 # include <strings.h>
 #endif
 
-#include "argp.h"
+#include "progname.h"
 
 struct test_args
 {
@@ -355,7 +357,9 @@
 {
   struct argp_child argp_children[3];
   test_fp *fun;
-  
+
+  set_program_name (argv[0]);
+
   argp_children[0] = group1_child;
   argp_children[1] = group2_child;
   argp_children[2].argp = NULL;





reply via email to

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