Skip to content

Commit

Permalink
Fix XFAIL tests
Browse files Browse the repository at this point in the history
In commit edf0e78 I made `run-tests.sh` expect XFAIL tests to *fail*,
because I misunderstood the reason they were failing.

The tests `test_db_find_entry*` now do actually pass so they are no
longer XFAIL. It seems that clang's
`CompilationDatabase.getCompileCommands` has been fixed, as of 3.8 (at
least).
  • Loading branch information
drothlis committed Feb 15, 2017
1 parent dd823a8 commit e786cc7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
2 changes: 1 addition & 1 deletion test/args.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ test_compiler_command_line_linking_multiple_source_files_XFAIL() {
# assembler, and linker). It means we can't generate tags for several
# source files in a single clang-ctags invocation (except by using
# --compile-comands).
! clang-ctags -e -- -shared class.cpp overload.cpp
clang-ctags -e -- -shared class.cpp overload.cpp
}

test_all_headers() {
Expand Down
19 changes: 6 additions & 13 deletions test/compile_commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,14 @@ test_db_with_multiple_source_files() {
assert_vim 0 'b' b.h:1
}

test_db_find_entry_with_relative_path_XFAIL() {
# The lookup done by clang's CompilationDatabase.getCompileCommands (C
# function clang_CompilationDatabase_getCompileCommands) doesn't seem to do
# anything smart with the filenames, just plain string matches.
test_db_find_entry_with_relative_path() {
clang-ctags -e --compile-commands=compile_commands.json subdir/c.cpp
! ( assert_tag c )
assert_tag c
}

test_db_find_entry_with_relative_path_given_absolute_path_XFAIL() {
test_db_find_entry_with_relative_path_given_absolute_path() {
clang-ctags -e --compile-commands=compile_commands.json "$PWD/subdir/c.cpp"
! ( assert_tag c )
assert_tag c
}

test_db_find_entry_with_absolute_path_given_relative_path() {
Expand All @@ -41,13 +38,9 @@ test_db_find_entry_with_canonical_path_given_uncanonical_path() {
assert_tag a
}

test_db_find_entry_relative_to_directory_XFAIL() {
# According to http://clang.llvm.org/docs/JSONCompilationDatabase.html
# the entry in compile_commands.json should be:
# { "directory": "subdir", "file": "e.cpp" }
# i.e. with `file` relative to `directory`.
test_db_find_entry_relative_to_directory() {
clang-ctags -e --compile-commands=compile_commands.json subdir/e.cpp
! ( assert_tag e )
assert_tag e
}

test_db_compile_command_from_different_directory() {
Expand Down

0 comments on commit e786cc7

Please sign in to comment.