emacs/mps/test/test/script/headconv
Gareth Rees e1a70a73db Long delayed maintenance of test suite:
$HopeName$ -> $Id$
space -> arena
mps_arena_create now takes three arguments
/usr/local/perl -> /usr/bin/perl -w
Missing #include <stdio.h> in several tests
Bogus closedir(DIR); in script/clib

Copied from Perforce
 Change: 182199
 ServerID: perforce.ravenbrook.com
2013-05-25 10:33:30 +01:00

53 lines
771 B
Perl

#!/usr/bin/perl -w
# $Id$
#
# convert to new-style test header format
#
foreach $file (@ARGV) {
unless (open(IN, $file)) {die $file." not found";}
open(OUT, ">new/$file");
print $file." --> new/".$file."\n";
print OUT "/* TEST_HEADER\n";
$_ = <IN>;
s+/\*\s*test + summary = +;
print OUT $_;
$_ = <IN>;
s/\s*language\s*c/ language = c/;
print OUT $_;
$_ = <IN>;
if (m/\s*link /) {
s/\s*link / link = /;
print OUT $_;
$_ = <IN>;
}
if (m+\*/+) {
print OUT "END_HEADER\n";
print OUT "*/\n";
} else {
print OUT "OUTPUT_SPEC\n";
print OUT $_;
$_ = <IN>;
while (!m+\*/+) {
s/\s*/ /;
print OUT $_;
$_ = <IN>;
}
print OUT "END_HEADER\n";
print OUT "*/\n";
}
while (<IN>) {
print OUT $_;
}
close(OUT);
close(IN);
}