Skip to content

Commit

Permalink
Make it possible to run the tests from a separate build tree.
Browse files Browse the repository at this point in the history
Make it possible to run the `clang_delta` tests from within a build tree
that is separate from the source tree.  Mostly, this means using `$<`
when referring prerequisites.

Note that for `make check-clang-delta` to work, you *still* need to copy
`llvm-lit` and `FileCheck` from your LLVM build tree into your LLVM
install tree.  This commit dosn't change that.
  • Loading branch information
eeide committed Apr 23, 2019
1 parent 10e7aa4 commit 8bbe27e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions clang_delta/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@ git_version.cpp: git_version.cpp.in git_version.txt
# we have to manually copy llvm-lit from LLVM's build dir. This is also the
# reason that I didn't create a check-local rule for running clang_delta tests.
# It would fail everywhere else llvm-lit does exist, e.g. travis?
check-clang-delta: tests/lit.site.cfg remove_lit_checks clang_delta
check-clang-delta: tests/lit.site.cfg tests/remove_lit_checks clang_delta
@ echo "--- Running tests for clang_delta ---"
@ $(LLVM_BINDIR)/llvm-lit -sv tests

tests/lit.site.cfg: tests/lit.site.cfg.in
@ echo s=@abs_builddir[@]=$(abs_builddir)=g > lit.site.cfg.tmp
@ echo s=@LLVM_BINDIR[@]=$(LLVM_BINDIR)=g >> lit.site.cfg.tmp
@ echo s=@clang_delta_srcdir@=$(abs_srcdir)=g >> lit.site.cfg.tmp
@ sed -f lit.site.cfg.tmp tests/lit.site.cfg.in > $@
@ sed -f lit.site.cfg.tmp $< > $@
@ rm -f lit.site.cfg.tmp

remove_lit_checks: tests/remove_lit_checks.in
tests/remove_lit_checks: tests/remove_lit_checks.in
@ echo s=@PERL_EXECUTABLE[@]=$(PERL)=g > remove_lit_checks.tmp
@ sed -f remove_lit_checks.tmp tests/remove_lit_checks.in > tests/$@
@ chmod +x tests/$@
@ sed -f remove_lit_checks.tmp $< > $@
@ chmod +x $@
@ rm -f remove_lit_checks.tmp

# When setting `LLVMCXXFLAGS', we weed out command-line options that might be
Expand Down
10 changes: 5 additions & 5 deletions clang_delta/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -2383,21 +2383,21 @@ git_version.cpp: git_version.cpp.in git_version.txt
# we have to manually copy llvm-lit from LLVM's build dir. This is also the
# reason that I didn't create a check-local rule for running clang_delta tests.
# It would fail everywhere else llvm-lit does exist, e.g. travis?
check-clang-delta: tests/lit.site.cfg remove_lit_checks clang_delta
check-clang-delta: tests/lit.site.cfg tests/remove_lit_checks clang_delta
@ echo "--- Running tests for clang_delta ---"
@ $(LLVM_BINDIR)/llvm-lit -sv tests

tests/lit.site.cfg: tests/lit.site.cfg.in
@ echo s=@abs_builddir[@]=$(abs_builddir)=g > lit.site.cfg.tmp
@ echo s=@LLVM_BINDIR[@]=$(LLVM_BINDIR)=g >> lit.site.cfg.tmp
@ echo s=@clang_delta_srcdir@=$(abs_srcdir)=g >> lit.site.cfg.tmp
@ sed -f lit.site.cfg.tmp tests/lit.site.cfg.in > $@
@ sed -f lit.site.cfg.tmp $< > $@
@ rm -f lit.site.cfg.tmp

remove_lit_checks: tests/remove_lit_checks.in
tests/remove_lit_checks: tests/remove_lit_checks.in
@ echo s=@PERL_EXECUTABLE[@]=$(PERL)=g > remove_lit_checks.tmp
@ sed -f remove_lit_checks.tmp tests/remove_lit_checks.in > tests/$@
@ chmod +x tests/$@
@ sed -f remove_lit_checks.tmp $< > $@
@ chmod +x $@
@ rm -f remove_lit_checks.tmp

clean-local:
Expand Down

0 comments on commit 8bbe27e

Please sign in to comment.