Skip to content

Commit

Permalink
convert to p6; make it easy to retest
Browse files Browse the repository at this point in the history
add overview
  • Loading branch information
coke committed Jul 8, 2018
1 parent 59f0d5c commit 14797d5
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -27,3 +27,4 @@ highlights/atom-language-perl6/
.DS_store
highlights/package-lock.json
.pod-cache
retest
42 changes: 42 additions & 0 deletions util/update-and-test
@@ -0,0 +1,42 @@
#!/usr/bin/env perl6

=begin overview
Not everyone runs the extended test suite; this gives developers the ability
to test as they go; it updates the repository, runs xtest only on those
files that have changed in that update, and leaves a local 'retest' script
that can be rerun against those changes until xtest is clean.
=end overview

# Get the old and new commit IDs

sub get-rev {
run(<git rev-parse HEAD>, :out).out.slurp(:close).chomp;
}

my $old-rev = get-rev;
run(<git pull --rebase>);
my $new-rev = get-rev;

if $old-rev eq $new-rev {
say "No chages to test.";
} else {
my $revs = $old-rev ~ ".." ~ $new-rev;
my $files = run('git', 'diff', '--name-only', $revs, :out).out.slurp(:close).chomp.split("\n").sort.join(" ");
my $outfile = "./retest";

my $of = $outfile.IO.open(:w);

$of.say: "#!/usr/bin/env perl6";
$of.say: "\%*ENV<TEST_FILES>='$files';";
$of.say: "say \%*ENV<TEST_FILES>;";
$of.say: "run(<make xtest>).so";

$of.close;

run('chmod', 'a+x', $outfile);

run($outfile).so;
say "Test same set of files again with $outfile";
}
14 changes: 0 additions & 14 deletions util/update-and-test.sh

This file was deleted.

0 comments on commit 14797d5

Please sign in to comment.