| 1 | #!/usr/bin/perl | ||
| 2 | # This program builds the files in t/cleanok/ and t/cleanvok/ | ||
| 3 | # used to test the behavior of eyapp when executed with option '-c' | ||
| 4 | use warnings; | ||
| 5 | use strict; | ||
| 6 | use File::Basename; | ||
| 7 | |||
| 8 | sub get_grammars { | ||
| 9 | open my $f, 'MANIFEST' || exit(0); | ||
| 10 | my @grammar = grep { m{examples/.*yp$} } <$f>; | ||
| 11 | close($f); | ||
| 12 | chomp(@grammar); | ||
| 13 | exit(0) unless @grammar; | ||
| 14 | return @grammar; | ||
| 15 | } | ||
| 16 | |||
| 17 | |||
| 18 | print "Generating test files for 'eyapp -c'\n"; | ||
| 19 | |||
| 20 | my @grammar = get_grammars(); | ||
| 21 | for (@grammar) { | ||
| 22 | my ($name,$path,$suffix) = fileparse($_); | ||
| 23 | $path =~ s{/}{_}g; | ||
| 24 | my $cleanok = " t/cleanok/${path}_$name"; | ||
| 25 | print "vim -O $cleanok $_\n"; | ||
| 26 | system("./eyapp -c $_ > t/cleanok/${path}_$name"); | ||
| 27 | my $cleanvok = " t/cleanvok/${path}_$name"; | ||
| 28 | print "vim -O $cleanvok $_\n"; | ||
| 29 | system("./eyapp -vc $_ > t/cleanvok/${path}_$name"); | ||
| 30 | } |