[ovs-dev,ovn] tests: Fix check-valgrind and check-lcov.
diff mbox series

Message ID 1571699850-88433-1-git-send-email-hzhou@ovn.org
State New
Headers show
Series
  • [ovs-dev,ovn] tests: Fix check-valgrind and check-lcov.
Related show

Commit Message

Han Zhou Oct. 21, 2019, 11:17 p.m. UTC
After split from OVS, make check-valgrind and check-lcov are not
working any more, because the $ovs_srcdir are missing for these tests.

Signed-off-by: Han Zhou <hzhou@ovn.org>
---
 tests/automake.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Ben Pfaff Oct. 21, 2019, 9:40 p.m. UTC | #1
On Mon, Oct 21, 2019 at 04:17:30PM -0700, Han Zhou wrote:
> After split from OVS, make check-valgrind and check-lcov are not
> working any more, because the $ovs_srcdir are missing for these tests.
> 
> Signed-off-by: Han Zhou <hzhou@ovn.org>

Seems reasonable.

Another possibility could be to add "export ovs_srcdir" to automake.mk
or Makefile.am somewhere.
Han Zhou Oct. 22, 2019, 1:39 a.m. UTC | #2
On Mon, Oct 21, 2019 at 4:29 PM Ben Pfaff <blp@ovn.org> wrote:
>
> On Mon, Oct 21, 2019 at 04:17:30PM -0700, Han Zhou wrote:
> > After split from OVS, make check-valgrind and check-lcov are not
> > working any more, because the $ovs_srcdir are missing for these tests.
> >
> > Signed-off-by: Han Zhou <hzhou@ovn.org>
>
> Seems reasonable.
>
> Another possibility could be to add "export ovs_srcdir" to automake.mk
> or Makefile.am somewhere.

Thank Ben. That's a better idea. I just sent v2:
https://patchwork.ozlabs.org/patch/1180961/

Patch
diff mbox series

diff --git a/tests/automake.mk b/tests/automake.mk
index 013e592..c0f05c9 100644
--- a/tests/automake.mk
+++ b/tests/automake.mk
@@ -83,7 +83,7 @@  LCOV_OPTS = -b $(abs_top_builddir) -d $(abs_top_builddir) -q -c --rc lcov_branch
 GENHTML_OPTS = -q --branch-coverage --num-spaces 4
 check-lcov: all $(check_DATA) clean-lcov
 	find . -name '*.gcda' | xargs -n1 rm -f
-	-set $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH); \
+	-set $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) ovs_srcdir=$(ovs_srcdir); \
 	"$$@" $(TESTSUITEFLAGS) || (test X'$(RECHECK)' = Xyes && "$$@" --recheck)
 	$(MKDIR_P) tests/lcov
 	lcov $(LCOV_OPTS) -o tests/lcov/coverage.info
@@ -127,7 +127,7 @@  HELGRIND = valgrind --log-file=helgrind.%p --tool=helgrind \
 	--suppressions=$(abs_top_srcdir)/tests/openssl.supp --num-callers=20
 EXTRA_DIST += tests/glibc.supp tests/openssl.supp
 check-valgrind: all $(valgrind_wrappers) $(check_DATA)
-	$(SHELL) '$(TESTSUITE)' -C tests CHECK_VALGRIND=true VALGRIND='$(VALGRIND)' AUTOTEST_PATH='tests/valgrind:$(AUTOTEST_PATH)' -d $(TESTSUITEFLAGS)
+	$(SHELL) '$(TESTSUITE)' -C tests CHECK_VALGRIND=true VALGRIND='$(VALGRIND)' AUTOTEST_PATH='tests/valgrind:$(AUTOTEST_PATH)' ovs_srcdir=$(ovs_srcdir) -d $(TESTSUITEFLAGS)
 	@echo
 	@echo '----------------------------------------------------------------------'
 	@echo 'Valgrind output can be found in tests/testsuite.dir/*/valgrind.*'