Skip to content

Commit

Permalink
Some simple test logging
Browse files Browse the repository at this point in the history
Signed-off-by: worksofliam <[email protected]>
  • Loading branch information
worksofliam committed Dec 12, 2024
1 parent 68a8192 commit 8d0f210
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/suite/partial.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ const parser = setupParser();
test("Parser partial tests", { timeout }, async () => {
const projects = getTestProjectsDir();

const SPLIT_SIZE = 10;
let totalFiles = 0;

for (const projectPath of projects) {
const parser = setupParser(projectPath);
const list = await getSourcesList(projectPath);
Expand All @@ -28,7 +31,7 @@ test("Parser partial tests", { timeout }, async () => {

let baseContentSplitUpIntoPieces = [];

const pieceSize = Math.ceil(baseContent.length / 10);
const pieceSize = Math.ceil(baseContent.length / SPLIT_SIZE);
for (let i = 0; i < baseContent.length; i += pieceSize) {
baseContentSplitUpIntoPieces.push(baseContent.substring(i, i + pieceSize));
}
Expand All @@ -55,4 +58,6 @@ test("Parser partial tests", { timeout }, async () => {
// console.log(``);
}
}

console.log(`Parsed ${totalFiles} files, ${SPLIT_SIZE} each.`);
});
6 changes: 6 additions & 0 deletions tests/suite/sources.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ const timeout = 1000 * 60 * 10; // 10 minutes
test("Generic reference tests", { timeout }, async () => {
const projects = getTestProjectsDir();

let totalFiles = 0;

for (const projectPath of projects) {
const parser = setupParser(projectPath);
const list = await getSourcesList(projectPath);

totalFiles += list.length;

for (let i = 0; i < list.length; i++) {
const relativePath = list[i];
const basename = path.basename(relativePath);
Expand Down Expand Up @@ -94,4 +98,6 @@ test("Generic reference tests", { timeout }, async () => {
// console.log(`Parsed ${basename} in ${pe - ps}ms. Validated in ${se-ss} (${i+1}/${list.length}). Found ${referencesCollected} references.`);
}
}

console.log(`Parsed ${totalFiles} files.`);
});

0 comments on commit 8d0f210

Please sign in to comment.