From: Argyrios Kyrtzidis Date: Mon, 12 Sep 2011 18:09:31 +0000 (+0000) Subject: [libclang] Make c-index-test check CINDEXTEST_REMAP_AFTER_TRIAL environment variable, X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=40098e8cd7268535ba581b50af0304b7ecacbef5;p=clang [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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139511 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c index a39d029b9b..6b72413d76 100644 --- a/tools/c-index-test/c-index-test.c +++ b/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);