This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Build test .po files during test runs


This patch implements changes the V3 testsuite to build the test .mo
files used for testing locales at test-time.  I have verified that the
tests work correctly both in the build directory and in the installed
directory when using this patch.  I don't have a good way of verifying
that the problem Paolo mentioned is fixed -- but it definitely should
be fixed by this approach.  With this change, I am now able to run the
entire testsuite on an installed compiler, and get the same results
that you get when running in the build directory.

I've not attempted any other simplifications (like changing
testsuite_flags not to pass LOCALEDIR, or like changing po/Makefile.am
not to build the .mo files), as I didn't want to perturb the other
existing scripts yet.  Once they've been assimilated into DejaGNU,
then we could consider those cleanups.

OK to install?

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com

2005-03-24  Mark Mitchell  <mark@codesourcery.com>

	* testsuite/lib/libstdc++.exp (libstdc++_init): Define LOCALEDIR
	in $cxxflags.
	(v3-build_support): Build .mo files.

Index: libstdc++.exp
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/lib/libstdc++.exp,v
retrieving revision 1.34
diff -c -5 -p -r1.34 libstdc++.exp
*** libstdc++.exp	23 Mar 2005 21:46:05 -0000	1.34
--- libstdc++.exp	25 Mar 2005 01:28:00 -0000
*************** proc libstdc++_init { testfile } {
*** 184,193 ****
--- 184,203 ----
              set cxxflags "-g -O2 -D_GLIBCXX_ASSERT -fmessage-length=0" 
              set includes "-I${srcdir}"
          }
      }
  
+     # Tell locale tests where to find the generated .po files.
+     #
+     # ??? At present, testsuite_flags sets LOCALEDIR to a directory in the
+     # build directory.  So long as the check_compile and
+     # check_performance scripts it's not safe to modify
+     # testsuite_flags so as not to set LOCALEDIR.  So, we must
+     # undefine LOCALEDIR first, so as to avoid a warning from the
+     # compiler.
+     set cxxflags "$cxxflags -ULOCALEDIR -DLOCALEDIR=\".\""
+ 
      libstdc++_maybe_build_wrapper "${objdir}/testglue.o"
  }
  
  # Callback for cleanup routines.
  proc libstdc++_exit { } {
*************** proc v3-build_support {} {
*** 315,324 ****
--- 325,348 ----
  	    verbose -log "thread support detected"
  	    set v3-threads 1
  	}
      }
  
+     # Try to build the message files that are used by some of the locale
+     # tests.  If we can't build them, that's OK; it just means that those
+     # tests will fail.
+     foreach lang [list "fr" "de"] {
+ 	catch {
+ 	    set subdir "$lang/LC_MESSAGES"
+ 	    file mkdir "$subdir"
+ 	    set catalog "$subdir/libstdc++.mo"
+ 	    remote_exec "build" \
+ 		"msgfmt" "-o $catalog $srcdir/../po/$lang.po"
+ 	    remote_download "host" "$catalog" "$catalog"
+ 	}
+     }
+ 
      # Build the support objects.
      set source_files \
  	[list testsuite_abi.cc testsuite_allocator.cc testsuite_hooks.cc]
      foreach f $source_files {
  	set object_file [file rootname $f].o


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]