#!/usr/bin/perl use strict; use warnings; use File::Path; use Cwd; if ($ARGV[0]=~ 'all'){ mkdir 'logs'; chdir 'logs'; my $logwd = getcwd(); chdir '..'; my $basewd = getcwd(); chdir 'tests'; my @files = glob "*"; foreach my $file(@files){ my $outwd = $logwd.'/'.$file; if(-d $file){ mkdir "$logwd/$file"; chdir $file; if(`../run_tests.pl $outwd` =~ 0){ rmtree($outwd); } } } chdir $basewd; `make unchecked`; } elsif($ARGV[0]=~/clean/){ my @ofiles = glob "*.o"; foreach my $file(@ofiles){ print "cleaning $file\n"; unlink $file; } }