summaryrefslogtreecommitdiffstats
path: root/clang/tools/c-index-test
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-09-12 18:09:31 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-09-12 18:09:31 +0000
commit3405baa3f049fcc07a5f3134289b0ce946166f46 (patch)
treeeaf11cea9441b2217905ce613ff5897e9e325c06 /clang/tools/c-index-test
parent993f3ab07b0d1a2831ca1826a1b8bfa30f0f8f0d (diff)
downloadbcm5719-llvm-3405baa3f049fcc07a5f3134289b0ce946166f46.tar.gz
bcm5719-llvm-3405baa3f049fcc07a5f3134289b0ce946166f46.zip
[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. llvm-svn: 139511
Diffstat (limited to 'clang/tools/c-index-test')
-rw-r--r--clang/tools/c-index-test/c-index-test.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/tools/c-index-test/c-index-test.c b/clang/tools/c-index-test/c-index-test.c
index a39d029b9ba..6b72413d76f 100644
--- a/clang/tools/c-index-test/c-index-test.c
+++ b/clang/tools/c-index-test/c-index-test.c
@@ -774,6 +774,8 @@ int perform_test_reparse_source(int argc, const char **argv, int trials,
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 @@ int perform_test_reparse_source(int argc, const char **argv, int trials,
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);
OpenPOWER on IntegriCloud