fix tests

This commit is contained in:
erik-krogh
2022-11-29 14:08:21 +01:00
parent 136b6db2ad
commit 63a5f8965e
2 changed files with 15 additions and 2 deletions

View File

@@ -434,19 +434,27 @@ public class AutoBuild {
return true;
}
/**
* Returns whether the autobuilder has seen code.
* This is overridden in tests.
*/
protected boolean hasSeenCode() {
return seenCode;
}
/** Perform extraction. */
public int run() throws IOException {
startThreadPool();
try {
extractSource();
extractXml();
if (seenCode) { // don't bother with the externs if no code was seen
if (hasSeenCode()) { // don't bother with the externs if no code was seen
extractExterns();
}
} finally {
shutdownThreadPool();
}
if (!seenCode) {
if (!hasSeenCode()) {
if (seenFiles) {
warn("Only found JavaScript or TypeScript files that were empty or contained syntax errors.");
} else {

View File

@@ -119,6 +119,11 @@ public class AutoBuildTests {
return CompletableFuture.completedFuture(null);
}
@Override
protected boolean hasSeenCode() {
return true;
}
@Override
public void verifyTypeScriptInstallation(ExtractorState state) {}