File: 50_vrename.t

package info (click to toggle)
libverilog-perl 3.482-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,728 kB
  • sloc: perl: 8,685; yacc: 3,387; cpp: 2,266; lex: 1,502; makefile: 8; fortran: 3
file content (46 lines) | stat: -rwxr-xr-x 1,458 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
#!/usr/bin/perl -w
# DESCRIPTION: Perl ExtUtils: Type 'make test' to test this package
#
# Copyright 2000-2024 by Wilson Snyder.  This program is free software;
# you can redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License Version 2.0.

use strict;
use Test::More;

BEGIN { plan tests => 6 }
BEGIN { require "./t/test_utils.pl"; }

print "Checking vrename...\n";
{
    # -List
    my $changefile = "test_dir/signals.vrename";
    unlink $changefile;
    my $cmd = "${PERL} ./vrename -changefile=$changefile -list -xref verilog/test.v";
    run_system ($cmd);
    ok(1, "vrename list");
    ok(files_identical($changefile, "t/50_vrename.out"), "diff");
    unlink $changefile;
}
{
    # Try renaming
    mkdir 'test_dir/verilog', 0777;
    my $cmd = ("${PERL} ./vrename -change --changefile verilog/test.vrename"
	       ." -o test_dir verilog/test.v");
    run_system ($cmd);
    ok(1, "vrename change");
    ok(-r 'test_dir/verilog/test.v', "diff");
}

{
    # Crypt
    my $changefile = "test_dir/signals.vrename";
    my $cmd = ("${PERL} ./vrename -changefile=$changefile -list --crypt"
	       ." -o test_dir verilog/test.v");
    run_system ($cmd);
    $cmd = ("${PERL} ./vrename -changefile=$changefile -change --crypt"
	    ." -o test_dir verilog/test.v");
    run_system ($cmd);
    ok(1, "vrename crypt");
    ok(-r 'test_dir/verilog/test.v', "output exists");
}