Hello devs, I am currently facing a minor issue when writing tests, which I'm not able to overcome. I've written my test cases using the DEFINE_TESTCASE macro and there are no errors while running a make check. But when I run a make check, it shows me these warnings: In file included from apitest.h:26:0, from api_cluster.cc:7: api_cluster.cc: In function ?bool test_euclidian_distance1()?: ./harness/testsuite.h:285:38: warning: no previous declaration for ?bool test_euclidian_distance1()? [-Wmissing-declarations] #define DEFINE_TESTCASE(S,COND) bool test_##S() ^ api_cluster.cc:16:1: note: in expansion of macro ?DEFINE_TESTCASE? DEFINE_TESTCASE(euclidian_distance1, backend) { ^ api_cluster.cc: In function ?bool test_euclidian_distance2()?: ./harness/testsuite.h:285:38: warning: no previous declaration for ?bool test_euclidian_distance2()? [-Wmissing-declarations] #define DEFINE_TESTCASE(S,COND) bool test_##S() ^ api_cluster.cc:43:1: note: in expansion of macro ?DEFINE_TESTCASE? DEFINE_TESTCASE(euclidian_distance2, backend) { ^ api_cluster.cc: In function ?bool test_round_robin1()?: ./harness/testsuite.h:285:38: warning: no previous declaration for ?bool test_round_robin1()? [-Wmissing-declarations] #define DEFINE_TESTCASE(S,COND) bool test_##S() ^ api_cluster.cc:69:1: note: in expansion of macro ?DEFINE_TESTCASE? DEFINE_TESTCASE(round_robin1, backend) ^ If I'm not wrong, the collate-test perl script specified in makefile.am is supposed to expand the macro and add it to the header file, api_all.h and api_collated.h. But that doesn't seem to happen in my case. Could I know how to get around this? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xapian.org/pipermail/xapian-devel/attachments/20160618/0ac3fe3f/attachment.html>
On Sat, Jun 18, 2016 at 10:50:04AM +0530, Richhiey Thomas wrote:> api_cluster.cc: In function ?bool test_round_robin1()?: > ./harness/testsuite.h:285:38: warning: no previous declaration for ?bool > test_round_robin1()? [-Wmissing-declarations] > #define DEFINE_TESTCASE(S,COND) bool test_##S() > ^ > api_cluster.cc:69:1: note: in expansion of macro ?DEFINE_TESTCASE? > DEFINE_TESTCASE(round_robin1, backend) > ^ > > If I'm not wrong, the collate-test perl script specified in makefile.am is > supposed to expand the macro and add it to the header file, api_all.h and > api_collated.h. But that doesn't seem to happen in my case.That's about right (the perl script just searches for uses of the macro - it doesn't expand it). Is your tree configured in maintainer mode? If you use the top-level configure, this is automatic. If you use the xapian-core-level configure, then it won't be. You can pass --enable-maintainer-mode by hand, but don't do this unless you have a very good reason to - use the top-level configure, as it also hooks up omega and the bindings to build against the in-tree xapian-core, and installs the same versions of some key tools as we use to bootstrap snapshots and releases, which can avoid some frustrating problems. If not that, have you added the new api_cluster.cc file to the collated_apitest_sources list in tests/Makefile.am? Cheers, Olly
Hey Olly, Yes I was using the xapian-core level configure all this while. It seemed to work for the API's but weirdly gave me problems for the tests. So as you suggested, I used the top level configure and collate-test worked as expected. Im still not completely sure how configuring the tree in maintainer mode helps remove these problems. Thanks for the help :D -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xapian.org/pipermail/xapian-devel/attachments/20160618/574a9cf0/attachment.html>