From 4bb97a4bd289fd0c917764399570b0d68fd9a612 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 3 Mar 2007 00:34:55 +0000 Subject: [PATCH] Provide a program_name variable on platforms other than glibc. --- ChangeLog | 6 ++++++ modules/argp-tests | 1 + tests/test-argp.c | 10 +++++++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 28ea90c22..acfe9b5d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-03-02 Bruno Haible + + * modules/argp-tests (Depends-on): Add progname. + * tests/test-argp.c: Include argp.h first. Include progname.h. + (main): Call set_program_name. + 2007-03-02 Paul Eggert * doc/gnulib-tool.texi (Initial import): Reword description of diff --git a/modules/argp-tests b/modules/argp-tests index 6deccf284..bc7d80ad9 100644 --- a/modules/argp-tests +++ b/modules/argp-tests @@ -3,6 +3,7 @@ tests/test-argp.c tests/test-argp-2.sh Depends-on: +progname Makefile.am: TESTS += test-argp test-argp-2.sh diff --git a/tests/test-argp.c b/tests/test-argp.c index 667ca9d66..25c927c90 100644 --- a/tests/test-argp.c +++ b/tests/test-argp.c @@ -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 #endif +#include "argp.h" + #include #include #if HAVE_STRING_H @@ -29,7 +31,7 @@ # include #endif -#include "argp.h" +#include "progname.h" struct test_args { @@ -355,7 +357,9 @@ main (int argc, char **argv) { 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; -- 2.11.0