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 7

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 5 kfleming
    if($_=~m/CVS/) {
8
        next;
9
    }
10 3 kfleming
   chomp($_);
11
 
12
  print $_;
13
  print "\n";
14
 
15
  &buildBits("./md6_encode","@ARGV[0]/$_");
16
  $pass = &runTest() && $pass;
17
 
18
  for($i=0; $i < 10; $i = $i +1) {
19
      &buildBits("./md6_random","@ARGV[0]/$_");
20
      $pass = &runTest() && $pass;
21
  }
22
 
23
}
24
 
25
if($pass) {
26
    print "PASS\n";
27
}
28
 
29
 
30
 
31
sub buildBits {
32
    my ($exec,$file) = @_;
33
    print "$exec $file md6Input.hex md6Result.hex inputSize.hex\n";
34
    `$exec $file md6Input.hex md6Result.hex inputSize.hex`;
35
}
36
 
37
sub runTest {
38
    system("./MD6TestBench | grep \"PASS\" > out.hex");
39
    $out = `cat out.hex`;
40
    if($out =~ "PASS") {
41
        print "Test $_ passes.\n";
42
        return 1;
43
    } else {
44
        print "Test $_ fails.\n";
45
        die "failed a test";
46
    }
47
}

powered by: WebSVN 2.1.0

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