Scanning checkpoint

This commit is contained in:
Nathan McCarty 2024-12-31 16:25:05 +00:00
parent a4e4c4a314
commit 9e9903429e
2 changed files with 22 additions and 5 deletions

View file

@ -3,8 +3,22 @@ use v6.d;
use IUtils;
use IUtils::Comments;
unit sub MAIN;
temp $*CWD = "/home/nathan/Projects/Idris/structures/".IO;
say scan-packages;
#| Execute the tests in an idris project
multi MAIN(
"test",
Str $project-path?, #= Base directory of the project, defaults to $*CWD
) {
# CD into the project path if needed
chdir($project-path.IO.resolve: :completely) if $project-path;
# Scan for our packages
my @packages = scan-packages;
# Collect tests
my @tests;
for @packages -> $package {
# FIXME
say 'Finding tests for ', $package.ipkg.relative;
for $package.sources -> $source {
say 'Scanning for tests in ', $source;
}
}
}

View file

@ -28,6 +28,9 @@ sub scan-ipkg(IO::Path:D $ipkg --> PackageInfo:D) {
PackageInfo.new(ipkg => $ipkg, root => $ipkg.parent, sources => @sources)
}
# TODO: Add some parsing of pack.toml to locate test packages and associate them
# with their source ipkg
#| Scan $*CWD to locate ipkgs and their associated sources
sub scan-packages(--> Array[PackageInfo:D]) is export {
my PackageInfo:D @ipkgs =