BIND 10 #1277: src/lib/datasrc/tests unittest failure due to missing testdata
BIND 10 Development
do-not-reply at isc.org
Thu Oct 6 12:16:37 UTC 2011
#1277: src/lib/datasrc/tests unittest failure due to missing testdata
-------------------------------------+-------------------------------------
Reporter: jreed | Owner:
Type: defect | Status: new
Priority: minor | Milestone: New
Component: Unclassified | Tasks
Sensitive: 0 | Keywords:
Sub-Project: DNS | Defect Severity: N/A
Estimated Difficulty: 0 | Feature Depending on Ticket:
Total Hours: 0 | Add Hours to Ticket: 0
| Internal?: 0
-------------------------------------+-------------------------------------
In src/lib/datasrc/tests, if I run: 1) "make clean; make ; make check" it
works. 2) "make clean ; make check" always fails.
The error is:
{{{
[----------] 43 tests from DatabaseClientTest/1, where TypeParam =
(anonymous namespace)::TestSQLite3Accessor
[ RUN ] DatabaseClientTest/1.zoneNotFound
terminate called after throwing an instance of
'isc::datasrc::DataSourceError'
what(): adding record to SQLite3 data source without transaction
[1] Abort trap (core dumped) ${dir}${tst}
}}}
The only difference between a success and failure is the
rwtest.sqlite3.copied file.
A diff of the output between the two tests (until the failure) is only:
{{{
-Making all in testdata
-../../../../../install-sh -m 644 ./rwtest.sqlite3 rwtest.sqlite3.copied
-make all-am
-Making check in .
}}}
My fix is to make sure it descends into testdata directory first and use a
check-local target:
{{{
diff --git a/src/lib/datasrc/tests/Makefile.am
b/src/lib/datasrc/tests/Makefile.am
index 10e1add..92a5978 100644
--- a/src/lib/datasrc/tests/Makefile.am
+++ b/src/lib/datasrc/tests/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = . testdata
+SUBDIRS = testdata
AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
AM_CPPFLAGS += -I$(top_builddir)/src/lib/dns -I$(top_srcdir)/src/lib/dns
diff --git a/src/lib/datasrc/tests/testdata/Makefile.am
b/src/lib/datasrc/tests/testdata/Makefile.am
index 64ae955..8d382f3 100644
--- a/src/lib/datasrc/tests/testdata/Makefile.am
+++ b/src/lib/datasrc/tests/testdata/Makefile.am
@@ -1,6 +1,7 @@
CLEANFILES = *.copied
-BUILT_SOURCES = rwtest.sqlite3.copied
+EXTRA_DIST = rwtest.sqlite3.copied
# We use install-sh with the -m option to make sure it's writable
-rwtest.sqlite3.copied: $(srcdir)/rwtest.sqlite3
- $(top_srcdir)/install-sh -m 644 $(srcdir)/rwtest.sqlite3 $@
+check-local:
+ $(top_srcdir)/install-sh -m 644 $(srcdir)/rwtest.sqlite3 \
+ rwtest.sqlite3.copied
}}}
Note that the second patch is not needed. The only change needed it to
descend into testdata before doing checks in current directory.
May I push this to master?
By the way, why do we have other Makefile.am files with SUBDIRS with
period at end of list or only item of list? These all seem superfluous.
--
Ticket URL: <http://bind10.isc.org/ticket/1277>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list