| 1 |
#!/usr/bin/perl |
| 2 |
use strict; |
| 3 |
use warnings; |
| 4 |
use Cwd qw(realpath); |
| 5 |
|
| 6 |
my ($bindir, $sep) = $0 =~ /^(.*)(\\|\/).*/; |
| 7 |
$bindir = realpath $bindir; |
| 8 |
chdir $bindir or die("Error: Could not change directory to $bindir !"); |
| 9 |
|
| 10 |
my $binary_mwesplit = $ARGV[0]; |
| 11 |
$binary_mwesplit =~ s@/vislcg3([^/]*)$@/cg-mwesplit$1@; |
| 12 |
if (!$binary_mwesplit || $binary_mwesplit eq '' || !(-x $binary_mwesplit)) { |
| 13 |
die("Error: $binary_mwesplit is not executable!"); |
| 14 |
} |
| 15 |
|
| 16 |
my $bad = 0; |
| 17 |
|
| 18 |
`"$binary_mwesplit" < input.txt > output.txt 2>>stderr.txt`; |
| 19 |
`diff -ZB expected.txt output.txt >diff.txt`; |
| 20 |
|
| 21 |
if (-s "diff.txt") { |
| 22 |
print STDERR "Fail\n"; |
| 23 |
$bad = 1; |
| 24 |
} else { |
| 25 |
print STDERR "Success Success\n"; |
| 26 |
} |
| 27 |
|
| 28 |
exit($bad); |