mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
bug 292005: JUnit failure: managedbuilder BuildSystem40Tests.test40 does not check benchmarks properly
Added heuristics to handle absolute workspace path
This commit is contained in:
parent
5b9ed737e6
commit
bf9d9817ed
8 changed files with 41 additions and 8 deletions
|
@ -20,14 +20,14 @@ CPP_DEPS += \
|
|||
d1/d2/e.o: ../d1/d2/e.cpp
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: Test 4.0 ToolName.compiler.gnu.cpp'
|
||||
g++ -Id2_ecpp_rel/path -I../d2_ecpp_proj/rel/path -I/d2_ecpp_abs/path -Ic:/d2_ecpp_abs/path -Id2_rel/path -I../d2_proj/rel/path -I/d2_abs/path -Ic:/d2_abs/path -Id1_rel/path -I../d1_proj/rel/path -I/d1_abs/path -Ic:/d1_abs/path -Irel/path -I../proj/rel/path -I/abs/path -Ic:/abs/path -Iv_rel/path -I/v_abs/path -Ic:/v_abs/path -I"D:\docs\incs" -I"D:\d1_docs\incs" -I"D:\d2_docs\incs" -I"D:\d2_ecpp_docs\incs" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"d1/d2/e.d" -o"$@" "$<"
|
||||
g++ -Id2_ecpp_rel/path -I../d2_ecpp_proj/rel/path -I/d2_ecpp_abs/path -Ic:/d2_ecpp_abs/path -Id2_rel/path -I../d2_proj/rel/path -I/d2_abs/path -Ic:/d2_abs/path -Id1_rel/path -I../d1_proj/rel/path -I/d1_abs/path -Ic:/d1_abs/path -Irel/path -I../proj/rel/path -I/abs/path -Ic:/abs/path -I"${WorkspaceDirPath}/test_40/dir1/dir2/dir3" -I"${WorkspaceDirPath}/test_40" -I"D:\docs\incs" -I"D:\d1_docs\incs" -I"D:\d2_docs\incs" -I"D:\d2_ecpp_docs\incs" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"d1/d2/e.d" -o"$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
d1/d2/%.o: ../d1/d2/%.cpp
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: Test 4.0 ToolName.compiler.gnu.cpp'
|
||||
g++ -Id2_rel/path -I../d2_proj/rel/path -I/d2_abs/path -Ic:/d2_abs/path -Id1_rel/path -I../d1_proj/rel/path -I/d1_abs/path -Ic:/d1_abs/path -Irel/path -I../proj/rel/path -I/abs/path -Ic:/abs/path -Iv_rel/path -I/v_abs/path -Ic:/v_abs/path -I"D:\docs\incs" -I"D:\d1_docs\incs" -I"D:\d2_docs\incs" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
|
||||
g++ -Id2_rel/path -I../d2_proj/rel/path -I/d2_abs/path -Ic:/d2_abs/path -Id1_rel/path -I../d1_proj/rel/path -I/d1_abs/path -Ic:/d1_abs/path -Irel/path -I../proj/rel/path -I/abs/path -Ic:/abs/path -I"${WorkspaceDirPath}/test_40/dir1/dir2/dir3" -I"${WorkspaceDirPath}/test_40" -I"D:\docs\incs" -I"D:\d1_docs\incs" -I"D:\d2_docs\incs" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ CPP_DEPS += \
|
|||
d1/%.o: ../d1/%.cpp
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: Test 4.0 ToolName.compiler.gnu.cpp'
|
||||
g++ -Id1_rel/path -I../d1_proj/rel/path -I/d1_abs/path -Ic:/d1_abs/path -Irel/path -I../proj/rel/path -I/abs/path -Ic:/abs/path -Iv_rel/path -I/v_abs/path -Ic:/v_abs/path -I"D:\docs\incs" -I"D:\d1_docs\incs" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
|
||||
g++ -Id1_rel/path -I../d1_proj/rel/path -I/d1_abs/path -Ic:/d1_abs/path -Irel/path -I../proj/rel/path -I/abs/path -Ic:/abs/path -I"${WorkspaceDirPath}/test_40/dir1/dir2/dir3" -I"${WorkspaceDirPath}/test_40" -I"D:\docs\incs" -I"D:\d1_docs\incs" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ CPP_DEPS += \
|
|||
d1_1/d2_1/%.o: ../d1_1/d2_1/%.cpp
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: Test 4.0 ToolName.compiler.gnu.cpp'
|
||||
g++ -Id2_1_rel/path -I/d2_1_abs/path -Ic:/d2_1_abs/path -Id1_1_rel/path -I/d1_1_abs/path -Ic:/d1_1_abs/path -Irel/path -I../proj/rel/path -I/abs/path -Ic:/abs/path -Iv_rel/path -I/v_abs/path -Ic:/v_abs/path -I"D:\docs\incs" -I"D:\d1_1_docs\incs" -I"D:\d2_1_docs\incs" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
|
||||
g++ -Id2_1_rel/path -I/d2_1_abs/path -Ic:/d2_1_abs/path -Id1_1_rel/path -I/d1_1_abs/path -Ic:/d1_1_abs/path -Irel/path -I../proj/rel/path -I/abs/path -Ic:/abs/path -I"${WorkspaceDirPath}/test_40/dir1/dir2/dir3" -I"${WorkspaceDirPath}/test_40" -I"D:\docs\incs" -I"D:\d1_1_docs\incs" -I"D:\d2_1_docs\incs" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ CPP_DEPS += \
|
|||
d1_1/%.o: ../d1_1/%.cpp
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: Test 4.0 ToolName.compiler.gnu.cpp'
|
||||
g++ -Id1_1_rel/path -I/d1_1_abs/path -Ic:/d1_1_abs/path -Irel/path -I../proj/rel/path -I/abs/path -Ic:/abs/path -Iv_rel/path -I/v_abs/path -Ic:/v_abs/path -I"D:\docs\incs" -I"D:\d1_1_docs\incs" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
|
||||
g++ -Id1_1_rel/path -I/d1_1_abs/path -Ic:/d1_1_abs/path -Irel/path -I../proj/rel/path -I/abs/path -Ic:/abs/path -I"${WorkspaceDirPath}/test_40/dir1/dir2/dir3" -I"${WorkspaceDirPath}/test_40" -I"D:\docs\incs" -I"D:\d1_1_docs\incs" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ CPP_DEPS += \
|
|||
dir1/dd/excluded_c/asd/%.o: ../dir1/dd/excluded_c/asd/%.cpp
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: Test 4.0 ToolName.compiler.gnu.cpp'
|
||||
g++ -Irel/path -I../proj/rel/path -I/abs/path -Ic:/abs/path -Iv_rel/path -I/v_abs/path -Ic:/v_abs/path -I"D:\docs\incs" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
|
||||
g++ -Irel/path -I../proj/rel/path -I/abs/path -Ic:/abs/path -I"${WorkspaceDirPath}/test_40/dir1/dir2/dir3" -I"${WorkspaceDirPath}/test_40" -I"D:\docs\incs" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ CPP_DEPS += \
|
|||
dir1/dd/excluded_c/%.o: ../dir1/dd/excluded_c/%.cpp
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: Test 4.0 ToolName.compiler.gnu.cpp'
|
||||
g++ -Irel/path -I../proj/rel/path -I/abs/path -Ic:/abs/path -Iv_rel/path -I/v_abs/path -Ic:/v_abs/path -I"D:\docs\incs" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
|
||||
g++ -Irel/path -I../proj/rel/path -I/abs/path -Ic:/abs/path -I"${WorkspaceDirPath}/test_40/dir1/dir2/dir3" -I"${WorkspaceDirPath}/test_40" -I"D:\docs\incs" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ dir1/dd/ff/%.o: ../dir1/dd/ff/%.c
|
|||
dir1/dd/ff/%.o: ../dir1/dd/ff/%.cpp
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: Test 4.0 ToolName.compiler.gnu.cpp'
|
||||
g++ -Irel/path -I../proj/rel/path -I/abs/path -Ic:/abs/path -Iv_rel/path -I/v_abs/path -Ic:/v_abs/path -I"D:\docs\incs" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
|
||||
g++ -Irel/path -I../proj/rel/path -I/abs/path -Ic:/abs/path -I"${WorkspaceDirPath}/test_40/dir1/dir2/dir3" -I"${WorkspaceDirPath}/test_40" -I"D:\docs\incs" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
|
|
|
@ -488,6 +488,7 @@ public class ManagedBuildTestHelper {
|
|||
final String INCLUDE_PATTERN = "-include \\$\\(.*\\)";
|
||||
final String MACRO_PATTERN = "\\S* [:+]=.*";
|
||||
final String EMPTY_MACRO_PATTERN = "\\S* :=";
|
||||
final String WORKSPACE_DIR_STR = "${WorkspaceDirPath}";
|
||||
ArrayList<String> testArray = mergeContinuationLines(getContents(testFile));
|
||||
ArrayList<String> benchmarkArray = mergeContinuationLines(getContents(benchmarkFile));
|
||||
|
||||
|
@ -541,6 +542,38 @@ public class ManagedBuildTestHelper {
|
|||
// accommodate for variable order of macros
|
||||
testNotMatchingLines.add(testLine);
|
||||
benchNotMatchingLines.add(benchmarkLine);
|
||||
} else if (benchmarkLine.contains(WORKSPACE_DIR_STR)) {
|
||||
String[] benchmarkSubstrings = benchmarkLine.split(" ");
|
||||
String[] testSubstrings = testLine.split(" ");
|
||||
if (testSubstrings.length!=benchmarkSubstrings.length) {
|
||||
System.out.println("Following lines do not match ("+testFile.lastSegment()+"):");
|
||||
System.out.println("actual : ["+testLine+"], file "+testFile);
|
||||
System.out.println("expected: ["+benchmarkLine+"], file "+benchmarkFile);
|
||||
return false;
|
||||
}
|
||||
|
||||
final IWorkspace workspace = ResourcesPlugin.getWorkspace();
|
||||
final IWorkspaceRoot root = workspace.getRoot();
|
||||
final String workspaceLocation = root.getLocation().toOSString();
|
||||
final String platformFileSeparator = System.getProperty("file.separator", Character.toString(IPath.SEPARATOR)); //$NON-NLS-1$
|
||||
|
||||
for (int j=0;j<testSubstrings.length;j++) {
|
||||
String testSubstring = testSubstrings[j];
|
||||
String benchmarkSubstring = benchmarkSubstrings[j];
|
||||
if (benchmarkSubstring.contains(WORKSPACE_DIR_STR)) {
|
||||
benchmarkSubstring = benchmarkSubstring
|
||||
.replace("/", platformFileSeparator)
|
||||
.replace(WORKSPACE_DIR_STR,workspaceLocation);
|
||||
}
|
||||
if (!testSubstring.equals(benchmarkSubstring)) {
|
||||
System.out.println("Following lines do not match ("+testFile.lastSegment()+"):");
|
||||
System.out.println("actual : ["+testLine+"], file "+testFile);
|
||||
System.out.println("expected: ["+benchmarkLine+"], file "+benchmarkFile);
|
||||
System.out.println("substring actual : ["+testSubstring+"], file "+testFile);
|
||||
System.out.println("substring expected: ["+benchmarkSubstring+"], file "+benchmarkFile);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
System.out.println("Following lines do not match ("+testFile.lastSegment()+"):");
|
||||
System.out.println("actual : ["+testLine+"], file "+testFile);
|
||||
|
|
Loading…
Add table
Reference in a new issue