Skip to content

Commit 68a8192

Browse files
committed
Exclude large source directories from test cases
Signed-off-by: worksofliam <mrliamallan@live.co.uk>
1 parent 3c70833 commit 68a8192

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

tests/parserSetup.ts

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@ const TEST_INCLUDE_DIR = process.env.INCLUDE_DIR || path.join(__dirname, `..`, `
1313

1414
export default function setupParser(projectRoot = TEST_INCLUDE_DIR): Parser {
1515
const parser = new Parser();
16+
let ignore: string[] = [];
17+
18+
if (projectRoot === TEST_INCLUDE_DIR) {
19+
ignore.push("sources/**")
20+
}
21+
22+
let globSettings = {
23+
cwd: projectRoot,
24+
absolute: true,
25+
ignore,
26+
nocase: true,
27+
}
28+
29+
const globCache = glob.sync(`**/*.*rpg*`, globSettings);
1630

1731
parser.setIncludeFileFetch(async (baseFile: string, includeFile: string) => {
1832
if (includeFile.startsWith(`'`) && includeFile.endsWith(`'`)) {
@@ -23,12 +37,9 @@ export default function setupParser(projectRoot = TEST_INCLUDE_DIR): Parser {
2337
includeFile = includeFile.split(`,`).join(`/`) + `.*rpgl*`;
2438
}
2539

40+
2641
const globPath = path.join(`**`, includeFile);
27-
const files: string[] = glob.sync(globPath, {
28-
cwd: projectRoot,
29-
absolute: true,
30-
nocase: true,
31-
});
42+
const files: string[] = glob.sync(globPath, {cache: globCache, ...globSettings});
3243

3344
if (files.length >= 1) {
3445
const file = files.find(f => f.toLowerCase().endsWith(`rpgleinc`)) || files[0];

tests/rpgle/CBKOPTIMIZ.rpgle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
* Level optimisation FULL
2+
* The most efficient code is generated.
3+
* Translation time is the longest.
4+
H OPTIMIZE(*FULL)

0 commit comments

Comments
 (0)