[LLVMdev] Unit test patch, updated
Talin
viridia at gmail.com
Wed Dec 31 16:29:41 PST 2008
Chris Lattner wrote:
> On Dec 30, 2008, at 2:54 PM, Talin wrote:
>> OK changes made and new patch attached.
>
> Nice
>
> +++ utils/unittest/Makefile (revision 0)
>
> ...
> +# This has to come after Makefile.common, since it doesn't allow us to
> +# override the VPATH value unless we set PROJECT_NAME, which we don't
> want
> +# to do.
> +VPATH = $(LLVM_SRC_ROOT)/utils/unittest/googletest/src/
>
>
> Why play with VPATH here? What is this doing? Can this be handled a
> different way? Similarly in makefile.unittest.
This may be the result of my inability to completely figure out how to
do certain things within the LLVM makefile framework. Specifically, I
was trying to leave the googletest directory untouched, and since
there's already a Makefile in that dir (which won't work for our
purposes), I needed to build the gtest library using the makefile two
directory levels up (in llvm/utils/unittest). Similarly, in the case of
the Makefile.unittest, I was trying to include TestMain.cpp in the
builds for all the subdirs.
In order to work with SRCDIR != OBJDIR, the files in SOURCES need to
have relative paths so that the .o and .d files go in the right places
in OBJDIR; But in order to find the sources, we have to give $wildcard
an absolute path to SRCDIR. I see that in some places in LLVM, this is
accomplished by stripping off the directory portion entirely from the
output of $wildcard, however that only works for source files that are
in the same directory as the makefile.
So messing with VPATH allowed me to use relative paths everywhere. I
couldn't figure out how to do it without VPATH.
>
> +++ unittests/ADT/DenseMapTest.cpp (revision 0)
> +namespace {
> +
> +using namespace llvm;
>
>
> Please put the 'using' right after the #includes.
>
> Otherwise, the patch looks good to me. Please verify that it works
> with both a SRCDIR=OBJDIR and SRCDIR!=OBJDIR build.
>
> -Chris
> ------------------------------------------------------------------------
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
More information about the llvm-dev
mailing list