diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-11-13 22:08:33 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-11-13 22:08:33 +0000 |
commit | bda536df1f5ccd71256eeeab4adbd2cf3769d89e (patch) | |
tree | 0c56f44901d2eb643a0da26c99a786515344b019 /tools/c-index-test | |
parent | 4fc04da71ed46d63dc991dbea4fd52341e56c0a1 (diff) |
[libclang] for c-index-test, check for CINDEXTEST_FAILONERROR when doing -test-load-source-reparse
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144509 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/c-index-test')
-rw-r--r-- | tools/c-index-test/c-index-test.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c index ac2ab4fdd9..8ab7f9410d 100644 --- a/tools/c-index-test/c-index-test.c +++ b/tools/c-index-test/c-index-test.c @@ -45,6 +45,8 @@ static unsigned getDefaultParsingOptions() { return options; } +static int checkForErrors(CXTranslationUnit TU); + static void PrintExtent(FILE *out, unsigned begin_line, unsigned begin_column, unsigned end_line, unsigned end_column) { fprintf(out, "[%d:%d - %d:%d]", begin_line, begin_column, @@ -802,6 +804,9 @@ int perform_test_reparse_source(int argc, const char **argv, int trials, return 1; } + if (checkForErrors(TU) != 0) + return -1; + if (getenv("CINDEXTEST_REMAP_AFTER_TRIAL")) { remap_after_trial = strtol(getenv("CINDEXTEST_REMAP_AFTER_TRIAL"), &endptr, 10); @@ -818,9 +823,16 @@ int perform_test_reparse_source(int argc, const char **argv, int trials, clang_disposeIndex(Idx); return -1; } + + if (checkForErrors(TU) != 0) + return -1; } result = perform_test_load(Idx, TU, filter, NULL, Visitor, PV); + + if (checkForErrors(TU) != 0) + return -1; + free_remapped_files(unsaved_files, num_unsaved_files); clang_disposeIndex(Idx); return result; |