mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-25 19:25:39 +08:00
Merge branch 'GP-0_ryanmkurtz_PR-9058_Phasip_stale-script-errors'
(Closes #9057, Closes #9058)
This commit is contained in:
@@ -416,6 +416,9 @@ public class GhidraSourceBundle extends GhidraBundle {
|
||||
buildErrors.remove(newSourceFile);
|
||||
}
|
||||
}
|
||||
|
||||
// remove errors for missing source files
|
||||
buildErrors.keySet().removeIf(sourceFile -> !sourceFile.exists());
|
||||
}
|
||||
|
||||
private boolean stillHasErrors(ResourceFile newSourceFile) {
|
||||
|
||||
+45
-2
@@ -4,9 +4,9 @@
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@@ -238,6 +238,49 @@ public class BundleHostTest extends AbstractGhidraHeadlessIntegrationTest {
|
||||
getInstance("apackage.AClass").toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDeletedSourceRemovesStaleBuildError() throws Exception {
|
||||
|
||||
// @formatter:off
|
||||
addClass(
|
||||
"apackage.BClass",
|
||||
"@Override\n" +
|
||||
"public String toString() {\n" +
|
||||
" failing java goes here\n" +
|
||||
" return \"yupyup\";\n" +
|
||||
"}\n"
|
||||
);
|
||||
|
||||
buildWithExpectations(
|
||||
"BClass.java:7: error: ';' expected\n" +
|
||||
" failing java goes here\n" +
|
||||
" ^\n" +
|
||||
"BClass.java:7: error: ';' expected\n" +
|
||||
" failing java goes here\n" +
|
||||
" ^\n" +
|
||||
"skipping "+currentBundle.getFile().toString()+File.separator+"apackage"+File.separator+"BClass.java\n"
|
||||
,
|
||||
"1 source file with errors"
|
||||
);
|
||||
// @formatter:on
|
||||
|
||||
Path srcDir = currentBundle.getFile().getFile(false).toPath();
|
||||
Path bpath = srcDir.resolve("apackage").resolve("BClass.java");
|
||||
Files.delete(bpath);
|
||||
|
||||
// @formatter:off
|
||||
addClass(
|
||||
"apackage.AClass",
|
||||
"@Override\n" +
|
||||
"public String toString() {\n" +
|
||||
" return \"yupyup\";\n" +
|
||||
"}\n"
|
||||
);
|
||||
// @formatter:on
|
||||
|
||||
buildAndActivate();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLibraryInBundle() throws Exception {
|
||||
// @formatter:off
|
||||
|
||||
Reference in New Issue
Block a user