-
Notifications
You must be signed in to change notification settings - Fork 91
/
batch_test.pl
executable file
·77 lines (62 loc) · 2 KB
/
batch_test.pl
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
#!/usr/bin/perl -w
# DESCRIPTION: Run batch tests, as part of "make test"
#
# Copyright 2008-2024 by Michael McNamara and Wilson Snyder. This package
# is free software; you can redistribute it and/or modify it under the
# terms of either the GNU Lesser General Public License or the Perl
# Artistic License.
my $tmpdir = "e";
my @tests = map { s!^.*/!!; $_;} glob("tests_batch_ok/*");
my @tests_args;
foreach my $test (@tests) {
run("/bin/cp tests/$test e/b/$test");
push @tests_args, "e/b/$test";
}
my $Emacs = $ENV{EMACS} || "emacs";
run("$Emacs --version"
);
run("$Emacs --batch --no-site-file -l $tmpdir/verilog-mode.elc"
." -l ./batch_test.el"
." ".join(' ',@tests_args)
." -f verilog-batch-delete-auto"
);
run("$Emacs --batch --no-site-file -l $tmpdir/verilog-mode.elc"
." -l ./batch_test.el"
." ".join(' ',@tests_args)
." -f verilog-batch-auto"
);
run("$Emacs --batch --no-site-file -l $tmpdir/verilog-mode.elc"
." -l ./batch_test.el"
." e/b/autoinst_lopaz.v"
." -f verilog-batch-diff-auto"
);
run("$Emacs --batch --no-site-file -l $tmpdir/verilog-mode.elc"
." -l ./batch_test.el"
." e/b/autoinst_star.v"
." -f verilog-batch-diff-auto"
);
run("$Emacs --batch --no-site-file -l $tmpdir/verilog-mode.elc"
." -l ./batch_test.el"
." ".join(' ',@tests_args)
." -f verilog-batch-indent"
);
foreach my $test (@tests) {
run("diff tests_batch_ok/$test e/b/$test");
}
run("$Emacs --batch --no-site-file -l $tmpdir/verilog-mode.elc"
." -l ./batch_test.el"
." ".join(' ',@tests_args)
." -f verilog-batch-delete-trailing-whitespace"
);
run("$Emacs --batch --no-site-file -l $tmpdir/verilog-mode.elc"
." -l ./batch_prof.el"
);
#######################################################################
sub run {
# Run a system command, check errors
my $command = shift;
print "\t$command\n";
system "$command";
my $status = $?;
($status == 0) or die "%Error: Command Failed $command, stopped";
}