OpenCores
URL https://opencores.org/ocsvn/bluespec_md6/bluespec_md6/trunk

Subversion Repositories bluespec_md6

[/] [bluespec_md6/] [trunk/] [MD6Control/] [test/] [runtest.pl] - Blame information for rev 3

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 kfleming
# I expect ARGV[0] to be the test dir
2
chomp(@ARGV[0]);
3
@md6files = `ls @ARGV[0]`;
4
$pass = 1;
5
foreach(@md6files)
6
{
7
   chomp($_);
8
 
9
  print $_;
10
  print "\n";
11
 
12
  &buildBits("./md6_encode","@ARGV[0]/$_");
13
  $pass = &runTest() && $pass;
14
 
15
  for($i=0; $i < 10; $i = $i +1) {
16
      &buildBits("./md6_random","@ARGV[0]/$_");
17
      $pass = &runTest() && $pass;
18
  }
19
 
20
}
21
 
22
if($pass) {
23
    print "PASS\n";
24
}
25
 
26
 
27
 
28
sub buildBits {
29
    my ($exec,$file) = @_;
30
    print "$exec $file md6Input.hex md6Result.hex inputSize.hex\n";
31
    `$exec $file md6Input.hex md6Result.hex inputSize.hex`;
32
}
33
 
34
sub runTest {
35
    system("./MD6TestBench | grep \"PASS\" > out.hex");
36
    $out = `cat out.hex`;
37
    if($out =~ "PASS") {
38
        print "Test $_ passes.\n";
39
        return 1;
40
    } else {
41
        print "Test $_ fails.\n";
42
        die "failed a test";
43
    }
44
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.