From dff516edc8c173e8444abecf70532d829f45c13d Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Sun, 12 Aug 2001 14:12:02 +0000 Subject: [PATCH] Find test case for srcdir != builddir, miscellaneous cleanups. Sun Aug 12 10:09:00 2001 Owen Taylor * tests/iochannel-test.c (main): Find test case for srcdir != builddir, miscellaneous cleanups. * tests/Makefile.am (EXTRA_DIST): Distribute casefold.txt, casemap.txt iochannel-test-infile. * glib-2.0-uninstalled.pc.in: Fix for move of glib files into subdir. (Pointed out by Steve Baker) --- ChangeLog | 11 +++++++++++ ChangeLog.pre-2-0 | 11 +++++++++++ ChangeLog.pre-2-10 | 11 +++++++++++ ChangeLog.pre-2-12 | 11 +++++++++++ ChangeLog.pre-2-2 | 11 +++++++++++ ChangeLog.pre-2-4 | 11 +++++++++++ ChangeLog.pre-2-6 | 11 +++++++++++ ChangeLog.pre-2-8 | 11 +++++++++++ glib-2.0-uninstalled.pc.in | 4 ++-- tests/Makefile.am | 17 +++++++++++------ tests/iochannel-test.c | 26 +++++++++++++++----------- 11 files changed, 116 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0471ef76f..92b75971b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +Sun Aug 12 10:09:00 2001 Owen Taylor + + * tests/iochannel-test.c (main): Find test case for + srcdir != builddir, miscellaneous cleanups. + + * tests/Makefile.am (EXTRA_DIST): Distribute casefold.txt, + casemap.txt iochannel-test-infile. + + * glib-2.0-uninstalled.pc.in: Fix for move of glib files + into subdir. (Pointed out by Steve Baker) + Sat Aug 4 01:04:08 2001 Tim Janik * glib/gscanner.c (g_scanner_unexp_token): fix INT and FLOAT warnings diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 0471ef76f..92b75971b 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,14 @@ +Sun Aug 12 10:09:00 2001 Owen Taylor + + * tests/iochannel-test.c (main): Find test case for + srcdir != builddir, miscellaneous cleanups. + + * tests/Makefile.am (EXTRA_DIST): Distribute casefold.txt, + casemap.txt iochannel-test-infile. + + * glib-2.0-uninstalled.pc.in: Fix for move of glib files + into subdir. (Pointed out by Steve Baker) + Sat Aug 4 01:04:08 2001 Tim Janik * glib/gscanner.c (g_scanner_unexp_token): fix INT and FLOAT warnings diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 0471ef76f..92b75971b 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,14 @@ +Sun Aug 12 10:09:00 2001 Owen Taylor + + * tests/iochannel-test.c (main): Find test case for + srcdir != builddir, miscellaneous cleanups. + + * tests/Makefile.am (EXTRA_DIST): Distribute casefold.txt, + casemap.txt iochannel-test-infile. + + * glib-2.0-uninstalled.pc.in: Fix for move of glib files + into subdir. (Pointed out by Steve Baker) + Sat Aug 4 01:04:08 2001 Tim Janik * glib/gscanner.c (g_scanner_unexp_token): fix INT and FLOAT warnings diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 0471ef76f..92b75971b 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,14 @@ +Sun Aug 12 10:09:00 2001 Owen Taylor + + * tests/iochannel-test.c (main): Find test case for + srcdir != builddir, miscellaneous cleanups. + + * tests/Makefile.am (EXTRA_DIST): Distribute casefold.txt, + casemap.txt iochannel-test-infile. + + * glib-2.0-uninstalled.pc.in: Fix for move of glib files + into subdir. (Pointed out by Steve Baker) + Sat Aug 4 01:04:08 2001 Tim Janik * glib/gscanner.c (g_scanner_unexp_token): fix INT and FLOAT warnings diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 0471ef76f..92b75971b 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,14 @@ +Sun Aug 12 10:09:00 2001 Owen Taylor + + * tests/iochannel-test.c (main): Find test case for + srcdir != builddir, miscellaneous cleanups. + + * tests/Makefile.am (EXTRA_DIST): Distribute casefold.txt, + casemap.txt iochannel-test-infile. + + * glib-2.0-uninstalled.pc.in: Fix for move of glib files + into subdir. (Pointed out by Steve Baker) + Sat Aug 4 01:04:08 2001 Tim Janik * glib/gscanner.c (g_scanner_unexp_token): fix INT and FLOAT warnings diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 0471ef76f..92b75971b 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,14 @@ +Sun Aug 12 10:09:00 2001 Owen Taylor + + * tests/iochannel-test.c (main): Find test case for + srcdir != builddir, miscellaneous cleanups. + + * tests/Makefile.am (EXTRA_DIST): Distribute casefold.txt, + casemap.txt iochannel-test-infile. + + * glib-2.0-uninstalled.pc.in: Fix for move of glib files + into subdir. (Pointed out by Steve Baker) + Sat Aug 4 01:04:08 2001 Tim Janik * glib/gscanner.c (g_scanner_unexp_token): fix INT and FLOAT warnings diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 0471ef76f..92b75971b 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,14 @@ +Sun Aug 12 10:09:00 2001 Owen Taylor + + * tests/iochannel-test.c (main): Find test case for + srcdir != builddir, miscellaneous cleanups. + + * tests/Makefile.am (EXTRA_DIST): Distribute casefold.txt, + casemap.txt iochannel-test-infile. + + * glib-2.0-uninstalled.pc.in: Fix for move of glib files + into subdir. (Pointed out by Steve Baker) + Sat Aug 4 01:04:08 2001 Tim Janik * glib/gscanner.c (g_scanner_unexp_token): fix INT and FLOAT warnings diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 0471ef76f..92b75971b 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,14 @@ +Sun Aug 12 10:09:00 2001 Owen Taylor + + * tests/iochannel-test.c (main): Find test case for + srcdir != builddir, miscellaneous cleanups. + + * tests/Makefile.am (EXTRA_DIST): Distribute casefold.txt, + casemap.txt iochannel-test-infile. + + * glib-2.0-uninstalled.pc.in: Fix for move of glib files + into subdir. (Pointed out by Steve Baker) + Sat Aug 4 01:04:08 2001 Tim Janik * glib/gscanner.c (g_scanner_unexp_token): fix INT and FLOAT warnings diff --git a/glib-2.0-uninstalled.pc.in b/glib-2.0-uninstalled.pc.in index f3c808f6f..e74011d48 100644 --- a/glib-2.0-uninstalled.pc.in +++ b/glib-2.0-uninstalled.pc.in @@ -5,5 +5,5 @@ glib_mkenums=${pc_top_builddir}/${pcfiledir}/@srcdir@/gobject/glib-mkenums Name: GLib Uninstalled Description: C Utility Library, Not Installed Version: @VERSION@ -Libs: ${pc_top_builddir}/${pcfiledir}/libglib-1.3.la @ICONV_LIBS@ @INTLLIBS@ -Cflags: -I${pc_top_builddir}/${pcfiledir} -I${pc_top_builddir}/${pcfiledir}/@srcdir@ +Libs: ${pc_top_builddir}/${pcfiledir}/glib/libglib-1.3.la @ICONV_LIBS@ @INTLLIBS@ +Cflags: -I${pc_top_builddir}/${pcfiledir} -I${pc_top_builddir}/${pcfiledir}/@srcdir@ -I${pc_top_builddir}/${pcfiledir}/@srcdir@/glib diff --git a/tests/Makefile.am b/tests/Makefile.am index c8fca8869..59e96e322 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -13,14 +13,19 @@ libadd_libglib = $(libglib) no_undefined = -no-undefined endif -EXTRA_DIST = \ - $(test_scripts) \ - makefile.msc.in \ - makefile.mingw.in \ +EXTRA_DIST = \ + $(test_scripts) \ + makefile.msc.in \ + makefile.mingw.in \ + casefold.txt \ + casemap.txt \ + gen-casefold-txt.pl \ + gen-casemap-txt.pl \ + iochannel-test-infile \ utf8.txt -BUILT_EXTRA_DIST = \ - makefile.mingw \ +BUILT_EXTRA_DIST = \ + makefile.mingw \ makefile.msc if HAVE_CXX diff --git a/tests/iochannel-test.c b/tests/iochannel-test.c index 8678f3163..f9119a8ce 100644 --- a/tests/iochannel-test.c +++ b/tests/iochannel-test.c @@ -13,37 +13,41 @@ gint main (gint argc, gchar * argv[]) GIOChannel *gio_r, *gio_w ; GError *gerr = NULL; GString *buffer; + char *filename; + char *srcdir = getenv ("srcdir"); gint rlength = 0, wlength = 0, length_out, line_term_len; gboolean block; const gchar encoding[] = "EUC-JP", line_term[] = "\n"; GIOStatus status; GIOFlags flags; + if (!srcdir) + srcdir = "."; + filename = g_strconcat (srcdir, G_DIR_SEPARATOR_S, "iochannel-test-infile", NULL); + setbuf(stdout, NULL); /* For debugging */ - gio_r = g_io_channel_new_file ("iochannel-test-infile", "r", &gerr); + gio_r = g_io_channel_new_file (filename, "r", &gerr); if (gerr) { - g_warning(gerr->message); - g_warning("Unable to open file %s", "iochannel-test-infile"); - g_free(gerr); - return 0; + g_warning("Unable to open file %s: %s", filename, gerr->message); + g_error_free(gerr); + return 1; } gio_w = g_io_channel_new_file( "iochannel-test-outfile", "w", &gerr); if (gerr) { - g_warning(gerr->message); - g_warning("Unable to open file %s", "iochannel-test-outfile"); - g_free(gerr); - return 0; + g_warning("Unable to open file %s: %s", "iochannel-test-outfile", gerr->message); + g_error_free(gerr); + return 1; } g_io_channel_set_encoding (gio_r, encoding, &gerr); if (gerr) { g_warning(gerr->message); - g_free(gerr); - return 0; + g_error_free(gerr); + return 1; } g_io_channel_set_buffer_size (gio_r, BUFFER_SIZE);