[cfe-commits] r139511 - /cfe/trunk/tools/c-index-test/c-index-test.c
Argyrios Kyrtzidis
akyrtzi at gmail.com
Mon Sep 12 11:09:32 PDT 2011
Author: akirtzidis
Date: Mon Sep 12 13:09:31 2011
New Revision: 139511
URL: http://llvm.org/viewvc/llvm-project?rev=139511&view=rev
Log:
[libclang] Make c-index-test check CINDEXTEST_REMAP_AFTER_TRIAL environment variable,
which when set it determines the trial number after which the remapping of files should
take effect.
Modified:
cfe/trunk/tools/c-index-test/c-index-test.c
Modified: cfe/trunk/tools/c-index-test/c-index-test.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/c-index-test/c-index-test.c?rev=139511&r1=139510&r2=139511&view=diff
==============================================================================
--- cfe/trunk/tools/c-index-test/c-index-test.c (original)
+++ cfe/trunk/tools/c-index-test/c-index-test.c Mon Sep 12 13:09:31 2011
@@ -774,6 +774,8 @@
int num_unsaved_files = 0;
int result;
int trial;
+ int remap_after_trial = 0;
+ char *endptr = 0;
Idx = clang_createIndex(/* excludeDeclsFromPCH */
!strcmp(filter, "local") ? 1 : 0,
@@ -797,8 +799,15 @@
return 1;
}
+ if (getenv("CINDEXTEST_REMAP_AFTER_TRIAL")) {
+ remap_after_trial =
+ strtol(getenv("CINDEXTEST_REMAP_AFTER_TRIAL"), &endptr, 10);
+ }
+
for (trial = 0; trial < trials; ++trial) {
- if (clang_reparseTranslationUnit(TU, num_unsaved_files, unsaved_files,
+ if (clang_reparseTranslationUnit(TU,
+ trial >= remap_after_trial ? num_unsaved_files : 0,
+ trial >= remap_after_trial ? unsaved_files : 0,
clang_defaultReparseOptions(TU))) {
fprintf(stderr, "Unable to reparse translation unit!\n");
clang_disposeTranslationUnit(TU);
More information about the cfe-commits
mailing list