Skip to content

Commit 287346c

Browse files
Fix countIncludePaths test
This test was failing on lcgstack builds due to additional include paths provided by the ROOT_INCLUDE_PATH environment variable. These additional paths are now excluded when verifying the expected count.
1 parent efecf17 commit 287346c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

roottest/root/meta/countIncludePaths.C

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,14 @@ int countIncludePaths()
1717
// Exclude from the test the builds with R as external package
1818
if (std::string::npos != includePath.find("RInside/include")) return 0;
1919

20+
// count paths coming from the ROOT_INCLUDE_PATH environment variable
21+
// and exclude them
22+
std::string envVar(std::getenv("ROOT_INCLUDE_PATH"));
23+
auto nEnvVarPaths = countSubstring(envVar, ":") + 1 - (envVar.back() == ':') - (envVar.front() == ':') ;
24+
2025
// At most 10
2126
auto nPaths = countSubstring(includePath, "-I");
22-
if (nPaths > 10){
27+
if ((nPaths - nEnvVarPaths) > 10){
2328
std::cerr << "The number of include paths is too high (>9) " << nPaths
2429
<< ". The number of \"-I\"s has been counted in the include path of ROOT (gSystem->GetIncludePath()=" << includePath << ")." << std::endl;
2530
return nPaths;

0 commit comments

Comments
 (0)