Skip to content

Commit 8d0f210

Browse files
committed
Some simple test logging
Signed-off-by: worksofliam <mrliamallan@live.co.uk>
1 parent 68a8192 commit 8d0f210

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

tests/suite/partial.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ const parser = setupParser();
1010
test("Parser partial tests", { timeout }, async () => {
1111
const projects = getTestProjectsDir();
1212

13+
const SPLIT_SIZE = 10;
14+
let totalFiles = 0;
15+
1316
for (const projectPath of projects) {
1417
const parser = setupParser(projectPath);
1518
const list = await getSourcesList(projectPath);
@@ -28,7 +31,7 @@ test("Parser partial tests", { timeout }, async () => {
2831

2932
let baseContentSplitUpIntoPieces = [];
3033

31-
const pieceSize = Math.ceil(baseContent.length / 10);
34+
const pieceSize = Math.ceil(baseContent.length / SPLIT_SIZE);
3235
for (let i = 0; i < baseContent.length; i += pieceSize) {
3336
baseContentSplitUpIntoPieces.push(baseContent.substring(i, i + pieceSize));
3437
}
@@ -55,4 +58,6 @@ test("Parser partial tests", { timeout }, async () => {
5558
// console.log(``);
5659
}
5760
}
61+
62+
console.log(`Parsed ${totalFiles} files, ${SPLIT_SIZE} each.`);
5863
});

tests/suite/sources.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,14 @@ const timeout = 1000 * 60 * 10; // 10 minutes
1313
test("Generic reference tests", { timeout }, async () => {
1414
const projects = getTestProjectsDir();
1515

16+
let totalFiles = 0;
17+
1618
for (const projectPath of projects) {
1719
const parser = setupParser(projectPath);
1820
const list = await getSourcesList(projectPath);
1921

22+
totalFiles += list.length;
23+
2024
for (let i = 0; i < list.length; i++) {
2125
const relativePath = list[i];
2226
const basename = path.basename(relativePath);
@@ -94,4 +98,6 @@ test("Generic reference tests", { timeout }, async () => {
9498
// console.log(`Parsed ${basename} in ${pe - ps}ms. Validated in ${se-ss} (${i+1}/${list.length}). Found ${referencesCollected} references.`);
9599
}
96100
}
101+
102+
console.log(`Parsed ${totalFiles} files.`);
97103
});

0 commit comments

Comments
 (0)