BIND 10 #1895: regression fix: set B10_FROM_BUILD for auth config tests

BIND 10 Development do-not-reply at isc.org
Tue Apr 17 09:09:53 UTC 2012


#1895: regression fix: set B10_FROM_BUILD for auth config tests
-------------------------------------+-------------------------------------
                   Reporter:         |                 Owner:  jinmei
  jinmei                             |                Status:  reviewing
                       Type:         |             Milestone:
  defect                             |  Sprint-20120417
                   Priority:  very   |            Resolution:
  high                               |             Sensitive:  0
                  Component:  build  |           Sub-Project:  DNS
  system                             |  Estimated Difficulty:  0
                   Keywords:         |           Total Hours:  0
            Defect Severity:  N/A    |
Feature Depending on Ticket:         |
        Add Hours to Ticket:  0      |
                  Internal?:  0      |
-------------------------------------+-------------------------------------
Changes (by jelte):

 * owner:  jelte => jinmei


Comment:

 Why not set environment variable for tests directly, like we do for a
 number of other tests?

 e.g. put run_unittests into check-local instead of TESTS and set
 B10_FROM_BUILD there

 {{{
 diff --git a/src/bin/auth/tests/Makefile.am
 b/src/bin/auth/tests/Makefile.am
 index b33c7af..682c88e 100644
 --- a/src/bin/auth/tests/Makefile.am
 +++ b/src/bin/auth/tests/Makefile.am
 @@ -19,10 +19,11 @@ endif

  CLEANFILES = *.gcno *.gcda

 +# Do not define global tests, use check-local so
 +# environment can be set (needed for dynamic loading)
  TESTS =
  if HAVE_GTEST

 -TESTS += run_unittests
  run_unittests_SOURCES = $(top_srcdir)/src/lib/dns/tests/unittest_util.h
  run_unittests_SOURCES += $(top_srcdir)/src/lib/dns/tests/unittest_util.cc
  run_unittests_SOURCES += ../auth_srv.h ../auth_srv.cc
 @@ -70,6 +71,8 @@ run_unittests_LDADD +=
 $(top_builddir)/src/lib/server_common/l
  run_unittests_LDADD += $(top_builddir)/src/lib/nsas/libnsas.la
  run_unittests_LDADD +=
 $(top_builddir)/src/lib/util/unittests/libutil_unittests
  run_unittests_LDADD +=
 $(top_builddir)/src/lib/statistics/libstatistics.la
 +
 +check-local: run_unittests
 +       B10_FROM_BUILD=${abs_top_builddir} ./run_unittests
  endif

 -noinst_PROGRAMS = $(TESTS)
 +noinst_PROGRAMS = run_unittests
 }}}


 If there is a legit reason to do this from within the test code itself, a
 few small comments:

 - since followup may be borked, EXPECT_EQ should probably be ASSERT_EQ in
 TearDown (though it won't matter in practice, since it is already done, it
 would be slightly more indicative of the seriousness :)

 "Couldn't restore environment, results of other tests" and "are
 uncertain"; need a space at the end of the first or the start of the
 second string

-- 
Ticket URL: <http://bind10.isc.org/ticket/1895#comment:3>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list