From 8d0f21007d61d4a682a93ce794f84e527b82e598 Mon Sep 17 00:00:00 2001 From: worksofliam Date: Thu, 12 Dec 2024 12:37:47 -0500 Subject: [PATCH] Some simple test logging Signed-off-by: worksofliam --- tests/suite/partial.test.ts | 7 ++++++- tests/suite/sources.test.ts | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/suite/partial.test.ts b/tests/suite/partial.test.ts index 1190e26c..0941f810 100644 --- a/tests/suite/partial.test.ts +++ b/tests/suite/partial.test.ts @@ -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); @@ -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)); } @@ -55,4 +58,6 @@ test("Parser partial tests", { timeout }, async () => { // console.log(``); } } + + console.log(`Parsed ${totalFiles} files, ${SPLIT_SIZE} each.`); }); \ No newline at end of file diff --git a/tests/suite/sources.test.ts b/tests/suite/sources.test.ts index 51477a58..d8f6f87b 100644 --- a/tests/suite/sources.test.ts +++ b/tests/suite/sources.test.ts @@ -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); @@ -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.`); }); \ No newline at end of file