Skip to content

Commit 63a5f89

Browse files
committed
fix tests
1 parent 136b6db commit 63a5f89

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,19 +434,27 @@ private boolean addPathPattern(Set<Path> patterns, Path base, String pattern) {
434434
return true;
435435
}
436436

437+
/**
438+
* Returns whether the autobuilder has seen code.
439+
* This is overridden in tests.
440+
*/
441+
protected boolean hasSeenCode() {
442+
return seenCode;
443+
}
444+
437445
/** Perform extraction. */
438446
public int run() throws IOException {
439447
startThreadPool();
440448
try {
441449
extractSource();
442450
extractXml();
443-
if (seenCode) { // don't bother with the externs if no code was seen
451+
if (hasSeenCode()) { // don't bother with the externs if no code was seen
444452
extractExterns();
445453
}
446454
} finally {
447455
shutdownThreadPool();
448456
}
449-
if (!seenCode) {
457+
if (!hasSeenCode()) {
450458
if (seenFiles) {
451459
warn("Only found JavaScript or TypeScript files that were empty or contained syntax errors.");
452460
} else {

javascript/extractor/src/com/semmle/js/extractor/test/AutoBuildTests.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ protected CompletableFuture<?> extract(FileExtractor extractor, Path file, boole
119119
return CompletableFuture.completedFuture(null);
120120
}
121121

122+
@Override
123+
protected boolean hasSeenCode() {
124+
return true;
125+
}
126+
122127
@Override
123128
public void verifyTypeScriptInstallation(ExtractorState state) {}
124129

0 commit comments

Comments
 (0)