Scanning checkpoint
This commit is contained in:
parent
a4e4c4a314
commit
9e9903429e
24
bin/iutils
24
bin/iutils
|
@ -3,8 +3,22 @@ use v6.d;
|
||||||
use IUtils;
|
use IUtils;
|
||||||
use IUtils::Comments;
|
use IUtils::Comments;
|
||||||
|
|
||||||
unit sub MAIN;
|
#| Execute the tests in an idris project
|
||||||
|
multi MAIN(
|
||||||
temp $*CWD = "/home/nathan/Projects/Idris/structures/".IO;
|
"test",
|
||||||
|
Str $project-path?, #= Base directory of the project, defaults to $*CWD
|
||||||
say scan-packages;
|
) {
|
||||||
|
# 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -28,6 +28,9 @@ sub scan-ipkg(IO::Path:D $ipkg --> PackageInfo:D) {
|
||||||
PackageInfo.new(ipkg => $ipkg, root => $ipkg.parent, sources => @sources)
|
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
|
#| Scan $*CWD to locate ipkgs and their associated sources
|
||||||
sub scan-packages(--> Array[PackageInfo:D]) is export {
|
sub scan-packages(--> Array[PackageInfo:D]) is export {
|
||||||
my PackageInfo:D @ipkgs =
|
my PackageInfo:D @ipkgs =
|
||||||
|
|
Loading…
Reference in a new issue