BIND 10 #122: location of testdata files

BIND 10 Development do-not-reply at isc.org
Tue Apr 13 16:37:40 UTC 2010


#122: location of testdata files
--------------------------+-------------------------------------------------
 Reporter:  jreed         |        Owner:     
     Type:  defect        |       Status:  new
 Priority:  minor         |    Milestone:     
Component:  Unclassified  |   Resolution:     
 Keywords:                |    Sensitive:  0  
--------------------------+-------------------------------------------------

Comment(by jreed):

 Something like this. But not tested using distcheck yet.
 {{{

 Index: src/lib/dns/tests/unittest_util.cc
 ===================================================================
 --- src/lib/dns/tests/unittest_util.cc  (revision 1705)
 +++ src/lib/dns/tests/unittest_util.cc  (working copy)
 @@ -38,7 +38,14 @@
                             vector<unsigned char>& data)
  {
      ifstream ifs;
 -
 +    string datafile_with_path;
 +
 +#ifndef SRCDIR
 +#define SRCDIR .
 +#endif
 +    datafile_with_path.append("SRCDIR/");
 +    datafile_with_path.append(datafile);
 +
      ifs.open(datafile, ios_base::in);
      if ((ifs.rdstate() & istream::failbit) != 0) {
          throw runtime_error("failed to open data file: " +
 Index: src/lib/dns/tests/Makefile.am
 ===================================================================
 --- src/lib/dns/tests/Makefile.am       (revision 1705)
 +++ src/lib/dns/tests/Makefile.am       (working copy)
 @@ -1,5 +1,6 @@
  AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
  AM_CPPFLAGS += -I$(top_srcdir)/src/lib/dns -I$(top_builddir)/src/lib/dns
 +AM_CPPFLAGS += -DSRCDIR=${srcdir}

  CLEANFILES = *.gcno *.gcda

 }}}

-- 
Ticket URL: <https://bind10.isc.org/ticket/122#comment:1>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list