@@ -401,23 +401,22 @@ proc compileExample(r: var TResults, pattern, options: string, cat: Category) =
401
401
test.spec.action = actionCompile
402
402
testSpec r, test
403
403
404
- proc testStdlib(r: var TResults, pattern, options: string , cat: Category) =
404
+ type IsValidProc = proc (file: string ): bool
405
+
406
+ proc testLibGeneric(r: var TResults, pattern, options: string , cat: Category, isValid: IsValidProc) =
405
407
var files: seq [string ]
406
408
407
- proc isValid (file: string ): bool =
409
+ proc isValidGeneric (file: string ): bool =
408
410
for dir in parentDirs(file, inclusive = false ):
409
411
if dir.lastPathPart in [" includes" , " nimcache" ]:
410
412
# eg: lib/pure/includes/osenv.nim gives: Error: This is an include file for os.nim!
411
413
return false
412
414
let name = extractFilename(file)
413
415
if name.splitFile.ext != " .nim" : return false
414
- for namei in disabledFiles:
415
- # because of `LockFreeHash.nim` which has case
416
- if namei.cmpPaths(name) == 0 : return false
417
416
return true
418
417
419
418
for testFile in os.walkDirRec(pattern):
420
- if isValid(testFile):
419
+ if isValidGeneric(testFile) and isValid(testFile):
421
420
files.add testFile
422
421
423
422
files.sort # reproducible order
@@ -436,6 +435,19 @@ proc testStdlib(r: var TResults, pattern, options: string, cat: Category) =
436
435
testObj.spec.action = actionCompile
437
436
testSpec r, testObj
438
437
438
+ proc testCompilerlib(r: var TResults, pattern, options: string , cat: Category) =
439
+ proc isValid(file: string ): bool = true
440
+ testLibGeneric(r, pattern, options, cat, isValid)
441
+
442
+ proc testStdlib(r: var TResults, pattern, options: string , cat: Category) =
443
+ proc isValid(file: string ): bool =
444
+ let name = extractFilename(file)
445
+ for namei in disabledFiles:
446
+ # because of `LockFreeHash.nim` which has case
447
+ if namei.cmpPaths(name) == 0 : return false
448
+ return true
449
+ testLibGeneric(r, pattern, options, cat, isValid)
450
+
439
451
# ----------------------------- nimble ----------------------------------------
440
452
type
441
453
PackageFilter = enum
@@ -688,6 +700,8 @@ proc processCategory(r: var TResults, cat: Category, options, testsDir: string,
688
700
of " lib" :
689
701
testStdlib(r, " lib/pure/" , options, cat)
690
702
testStdlib(r, " lib/packages/docutils/" , options, cat)
703
+ of " compilerlib" :
704
+ testCompilerlib(r, " compiler/" , options, cat)
691
705
of " examples" :
692
706
compileExample(r, " examples/*.nim" , options, cat)
693
707
compileExample(r, " examples/gtk/*.nim" , options, cat)
0 commit comments