t_bats_zlib.pl
1 #!/usr/bin/perl -w 2 # BATS entry point for zlib tests 3 4 use File::Basename; 5 6 # Get our location 7 my $scripts_dir = dirname(__FILE__); 8 9 # Figure out which code to run 10 my $uname = `uname -m -p`; 11 my $bindir = 'osx'; 12 $bindir = 'ios' if ( $uname =~ /arm/ ); 13 $bindir = 'wos' if ( $uname =~ /Watch/ ); 14 $bindir = $scripts_dir.'/../bin/'.$bindir; 15 my $datadir = $scripts_dir.'/../data'; 16 17 if ( not -d $bindir ) { 18 print STDERR "ERROR: binary directory not found: $bindir\n"; 19 exit(1); 20 } 21 if ( not -d $datadir ) { 22 print STDERR "ERROR: binary directory not found: $datadir\n"; 23 exit(1); 24 } 25 26 my $cmd = "$scripts_dir/t_zlib_all.pl -d \"$datadir\" -b $bindir/t_zlib"; 27 system($cmd); 28 29 exit(1) if ( $? != 0 ); # failed 30 exit(0); #OK