File: checkit.pl

package info (click to toggle)
eclipse-titan 6.1.0-1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 79,084 kB
  • ctags: 29,092
  • sloc: cpp: 210,764; ansic: 44,862; yacc: 21,034; sh: 12,594; makefile: 12,225; lex: 8,972; xml: 5,348; java: 4,849; perl: 3,780; python: 2,834; php: 175
file content (110 lines) | stat: -rwxr-xr-x 2,466 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/usr/bin/perl -w
###############################################################################
# Copyright (c) 2000-2016 Ericsson Telecom AB
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
#   Balasko, Jeno
#   Baranyi, Botond
#   Raduly, Csaba
#
###############################################################################


use strict;

if ($] < 5.006) {
  # ancient perl, we must be on Solaris :(
  my @perlloc = qw( /proj/TTCN/Tools/perl-5.10.1/bin/perl /mnt/TTCN/Tools/perl-5.10.1/bin/perl );
  foreach (@perlloc) {
    if (-x $_) {
      warn "Let's try with $_ instead";
      exec( $_, $0, @ARGV ) or die "That didn't work either: $!";
    }
  }
}
else {
  require Test::More;
  Test::More->import('no_plan');
}

#use re qw(debug);

my %versions = (
'converter'    => '',
'UTF8'         => '',
'Txerasntypes' => 'R8A',
'Txerboolean'  => 'R8B',
'Txerenum'     => 'R8E',
'Txerfloat'    => 'R8F',
'Txerint'      => 'R8J',
'Txernested'   => 'R8N',
'Txerobjclass' => '',
'Txersets'     => '',
'Txerstring'   => 'R8Z',
'Txerbinstr'   => 'R99999A',
'Asntypes'     => '',
'AsnValues'    => '',
'EmptyUnion'   => '',
'ObjectClass'  => '',
'ObjectClassWithSyntax' => '',
'Sets'      => '',
'SetValues' => '',
'junk' => '',
# built-in modules for the logger
'TitanLoggerApi' => '',
'TitanLoggerControl' => '',
'PreGenRecordOf' => '',
);



while ( <> ) {
  chomp;

  if ( my ($mod, $type, $md5, $rev) =
    m/^
    (\w+) # module name
    \s+
    (TTCN-3|ASN\.1) # type
    \s+
    (?: # dodge the compilation date
    # Hopefully not affected by i18n: this is American style mm dd yyyy
    [A-Z][a-z][a-z] # month
    \s
    [\s\d]\d # day of the month
    \s
    \d{4} # year
    \s
    \d\d # hour
    :
    \d\d # min
    :
    \d\d # sec
    \s+
    )?
    ([0-9a-fA-F]{32})?
    \s*
    (R\d+\w?)?/x ) {
    $md5 ||= '';
    $rev ||= '';
    #print "$mod\t, $type\t, $md5, $rev";
    if (ok(exists $versions{$mod}, " \tKnown module $mod")) {
      #    got, exp, name
      is ($rev, $versions{$mod}, " \tVersion for  $mod");
      delete $versions{$mod};
    }
    else {
      #die "Unknown module name $mod";
      SKIP: {
      skip( " \tversion check for unknown module $mod", 1 );
      }
    }
  }
  #else {warn $_;}
}

#done_testing();