Sync with 5.4.0
[deliverable/titan.core.git] / regression_test / compileonly / mfgen-tpd / runner.pl
1 #!/usr/bin/perl -wl
2 ###############################################################################
3 # Copyright (c) 2000-2015 Ericsson Telecom AB
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Eclipse Public License v1.0
6 # which accompanies this distribution, and is available at
7 # http://www.eclipse.org/legal/epl-v10.html
8 ###############################################################################
9
10 use strict;
11 $"='';
12
13 use Config;
14
15
16 sub signame ($) {
17 my $signr = $_[0];
18 if ($Config{sig_name} && $Config{sig_num}) {
19 my @sig_name;
20 my %sig_num;
21 my @names = split ' ', $Config{sig_name};
22 @sig_num{@names} = split ' ', $Config{sig_num};
23 foreach (@names) {
24 $sig_name[$sig_num{$_}] ||= $_;
25 }
26
27 return $sig_name[$signr];
28 }
29 else {
30 return $signr;
31 }
32 }
33
34
35 #
36 # This script runs the makefilegen test repeatedly, with every possible combination
37 # of the makefilegen options below:
38 #
39 my @options = qw( a g m R s );
40 # -a use absolute pathnames
41 # -g Makefile for GNU make
42 # -m always use makedepend for deps, even for GNU make
43 # -R RT2
44 # -s single mode
45 #
46 # -l NO!!! dynamic linking: ruins the build
47
48 #use 5.010;
49 #sub mix {@_ ? map {my $x = $_; map "$x$_", mix(@_[1..$#_])} @{$_[0]} : ""}
50 #print for mix @options;
51
52 # Generate the power set of @options
53 # From http://rosettacode.org/wiki/Power_set#Perl
54 sub p{
55 @_
56 ? map { $_,[$_[0],@$_] } p (@_[1..$#_])
57 : []
58 }
59
60 my @powerset = p (@options);
61
62 #use Data::Dump qw(pp);
63 #use Data::Dumper;
64 #print Dumper \ @x;
65
66 #print @$_ for @x;
67 foreach (@powerset) {
68 my $rc = system("echo \\'@$_\\'; make clean all MFGEN_FLAGS=-d@$_ >make_@$_.out 2>&1 || echo FAIL");
69 # The -d option is there ------------------------------------^ to always have an option after the dash
70 # `makefilegen -` will cause an error otherwise
71 die "Child caught a SIG" . signame($rc & 127) if ($rc & 127);
72 }
This page took 0.070499 seconds and 5 git commands to generate.