]>
git.saurik.com Git - apple/ld64.git/blob - unit-tests/bin/make-recursive-newtest.pl
10 $ENV{'LD_NO_CLASSSIC_LINKER'} = '1';
11 $ENV{'LD_NO_CLASSSIC_LINKER_STATIC'} = '1';
17 'makefile.newtest' => undef,
18 'Makefile.newtest' => undef,
23 'wanted' => \
&find_callback
,
37 my $max_keyword_len = 0;
38 foreach $keyword (keys %$keywords)
39 { if($max_keyword_len < length($keyword)) { $max_keyword_len = length($keyword); } }
41 $max_keyword_len += length($delim) + length(' ');
43 my $last_keyword = '';
47 my ($keyword, $val) = @_;
49 if(!exists($$keywords{$keyword}))
51 print STDERR
"error: keyword $keyword not in \$keywords set\n";
57 if($keyword ne $last_keyword)
59 print("$keyword"); print($delim);
60 $keyword_len = length($keyword) + length($delim);
62 if($max_keyword_len > $keyword_len)
64 my $num_spaces = $max_keyword_len - $keyword_len;
65 print(' ' x
$num_spaces);
70 $last_keyword = $keyword;
75 $root = &realpath
($root);
76 print_line
("root", "$root\n");
78 find
($find_opts, $root);
82 if(exists($$makefiles{$_}))
85 my $reldir = $File::Find
::dir
;
86 $reldir =~ s
|^$root/||;
88 &print_line
("cwd", "\$root/$reldir\n");
92 push @$cmd, $makefile;
93 my $arg; foreach $arg (@ARGV) { push @$cmd, $arg; } # better way to do this?
94 &print_line
("cmd", "@$cmd\n");
96 open(SAVEOUT
, ">&STDOUT") || die("$!");
97 open(SAVEERR
, ">&STDERR") || die("$!");
98 open(STDOUT
, ">/tmp/unit-tests-stdout") || die("$!");
99 open(STDERR
, ">/tmp/unit-tests-stderr") || die("$!");
101 $ENV{UNIT_TEST_NAME
} = $reldir;
102 my $exit = system(@$cmd);
104 close(STDOUT
) || die("$!");
105 close(STDERR
) || die("$!");
106 open(STDOUT
, ">&SAVEOUT") || die("$!");
107 open(STDERR
, ">&SAVEERR") || die("$!");
109 &print_line
("exit", "$exit\n");
111 open(OUT
, "</tmp/unit-tests-stdout") || die("$!");
114 &print_line
("stdout", "$_");
116 close(OUT
) || die("$!");
117 unlink("/tmp/unit-tests-stdout");
119 open(ERR
, "</tmp/unit-tests-stderr") || die("$!");
122 &print_line
("stderr", "$_");
124 close(ERR
) || die("$!");
126 unlink("/tmp/unit-tests-stderr");