[cfe-dev] Run tests after building with CMake and Xcode?

Ryan Gerleve aikavanak at gmail.com
Sun Sep 19 02:25:04 PDT 2010


Thank you for the quick & informative reply, Óscar.

> tools/clang/tests/CMakeLists.txt configures the paths for lit. The key
> variable is LLVM_TOOLS_DIR.

This variable is defined in terms of LLVM_TOOLS_BINARY_DIR,
and I haven't been able to figure out where that one gets set, either.
Even so, I suspect LLVM_TOOLS_DIR is correct, based on the
output I'm getting (see below).

> [snip]
>
> If you can't figure out the problem please show the piece of output that
> makes you think that the test scripts are looking at the wrong directory
> for executing clang, plus version numbers, etc.

Here's the output from running the tests, through the first failure:
(Note: /Users/Ryan/llvm-xcode is where CMake put its output,
and /Users/Ryan/llvm is the unmodified SVN checkout folder.)


Running Clang regression tests
/usr/bin/python2.6 /Users/Ryan/llvm/utils/lit/lit.py --param
clang_site_config=/Users/Ryan/llvm-xcode/tools/clang/test/lit.site.cfg
--param build_config=Debug -sv --no-progress-bar
/Users/Ryan/llvm-xcode/tools/clang/test
lit.py: lit.cfg:129: note: using clang: '/Users/Ryan/llvm-xcode/bin/Debug/clang'
-- Testing: 2552 tests, 2 threads --
FAIL: Clang :: Index/code-complete-errors.c (1155 of 2552)
******************** TEST 'Clang :: Index/code-complete-errors.c'
FAILED ********************
Script:
--
c-index-test -code-completion-at=/Users/Ryan/llvm/tools/clang/test/Index/code-complete-errors.c:13:12
-pedantic /Users/Ryan/llvm/tools/clang/test/Index/code-complete-errors.c
2> /Users/Ryan/llvm-xcode/tools/clang/test/Index/Output/code-complete-errors.c.tmp
FileCheck -check-prefix=CHECK
/Users/Ryan/llvm/tools/clang/test/Index/code-complete-errors.c <
/Users/Ryan/llvm-xcode/tools/clang/test/Index/Output/code-complete-errors.c.tmp
--
Exit Code: 1
Command Output (stderr):
--
/Users/Ryan/llvm/tools/clang/test/Index/code-complete-errors.c:1:24:
error: expected string not found in input
_Complex cd; // CHECK: code-complete-errors.c:1:1: warning: plain
'_Complex' requires a type specifier; assuming '_Complex double'
                       ^
<stdin>:1:1: note: scanning from here
fatal error: error invoking
/Users/Ryan/llvm-xcode/lib/Debug/../bin/clang -ccc-clang-cxx
-fsyntax-only -Xclang -code-completion-at -Xclang
/Users/Ryan/llvm/tools/clang/test/Index/code-complete-errors.c:13:12
-Xclang -no-code-completion-debug-printer -Xclang
-code-completion-macros -fdiagnostics-binary
/Users/Ryan/llvm/tools/clang/test/Index/code-complete-errors.c
-pedantic : /Users/Ryan/llvm-xcode/lib/Debug/../bin/clang is not
executable
^
--


It's the "error invoking /Users/Ryan/llvm-xcode/lib/Debug/../bin/clang"
part that led me to believe the path was set up incorrectly. Notice that
the "note: using clang ..." in the beginning of the output has the
correct path.

There are 34 more failures like this, most with the same error. A few fail
with just "expected string not found in input," and no "error invoking ..."

I'm using r114308 of LLVM & Clang, CMake 2.8-2, and Xcode 3.2.4.
I used the default configuration in CMake when generating the
project files.




More information about the cfe-dev mailing list