| 1 | $! Test_make.com
|
|---|
| 2 | $!
|
|---|
| 3 | $! This is a wrapper for the GNU make perl test programs on VMS.
|
|---|
| 4 | $!
|
|---|
| 5 | $! Parameter "-help" for description on how to use described below.
|
|---|
| 6 | $!
|
|---|
| 7 | $! Copyright (C) 2014-2016 Free Software Foundation, Inc.
|
|---|
| 8 | $! This file is part of GNU Make.
|
|---|
| 9 | $!
|
|---|
| 10 | $! GNU Make is free software; you can redistribute it and/or modify it under
|
|---|
| 11 | $! the terms of the GNU General Public License as published by the Free Software
|
|---|
| 12 | $! Foundation; either version 3 of the License, or (at your option) any later
|
|---|
| 13 | $! version.
|
|---|
| 14 | $!
|
|---|
| 15 | $! GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
|
|---|
| 16 | $! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|---|
| 17 | $! FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|---|
| 18 | $! details.
|
|---|
| 19 | $!
|
|---|
| 20 | $! You should have received a copy of the GNU General Public License along with
|
|---|
| 21 | $! this program. If not, see <http://www.gnu.org/licenses/>.
|
|---|
| 22 | $!
|
|---|
| 23 | $!
|
|---|
| 24 | $! Allow more than 8 paramters with using commas as a delimiter.
|
|---|
| 25 | $!
|
|---|
| 26 | $ params = "''p1',''p2',''p3',''p4',''p5',''p6',''p7',''p8'"
|
|---|
| 27 | $!
|
|---|
| 28 | $ test_flags = ",verbose,detail,keep,usage,help,debug,"
|
|---|
| 29 | $ test_flags_len = f$length(test_flags)
|
|---|
| 30 | $ verbose_flag = ""
|
|---|
| 31 | $ detail_flag = ""
|
|---|
| 32 | $ keep_flag = ""
|
|---|
| 33 | $ usage_flag = ""
|
|---|
| 34 | $ help_flag = ""
|
|---|
| 35 | $ debug_flag = ""
|
|---|
| 36 | $!
|
|---|
| 37 | $ ignored_options = "profile,make,srcdir,valgrind,memcheck,massif,"
|
|---|
| 38 | $ ignored_option_len = f$length(ignored_options)
|
|---|
| 39 | $!
|
|---|
| 40 | $ testname = ""
|
|---|
| 41 | $ make :== $bin:make.exe"
|
|---|
| 42 | $!
|
|---|
| 43 | $ i = 0
|
|---|
| 44 | $param_loop:
|
|---|
| 45 | $ param = f$element(i, ",", params)
|
|---|
| 46 | $ i = i + 1
|
|---|
| 47 | $ if param .eqs. "" then goto param_loop
|
|---|
| 48 | $ if param .eqs. "," then goto param_loop_end
|
|---|
| 49 | $ param_len = f$length(param)
|
|---|
| 50 | $ if f$locate("/", param) .lt. param_len
|
|---|
| 51 | $ then
|
|---|
| 52 | $ if testname .nes. ""
|
|---|
| 53 | $ then
|
|---|
| 54 | $ write sys$output "Only the last test name specified will be run!"
|
|---|
| 55 | $ endif
|
|---|
| 56 | $ testname = param
|
|---|
| 57 | $ goto param_loop
|
|---|
| 58 | $ endif
|
|---|
| 59 | $ lc_param = f$edit(param,"LOWERCASE") - "-"
|
|---|
| 60 | $ if f$locate(",''lc_param',", ignored_options) .lt. ignored_option_len
|
|---|
| 61 | $ then
|
|---|
| 62 | $ write sys$output "parameter ''param' is ignored on VMS for now."
|
|---|
| 63 | $ goto param_loop
|
|---|
| 64 | $ endif
|
|---|
| 65 | $ if f$locate(",''lc_param',", test_flags) .lt. test_flags_len
|
|---|
| 66 | $ then
|
|---|
| 67 | $ 'lc_param'_flag = "-" + lc_param
|
|---|
| 68 | $ goto param_loop
|
|---|
| 69 | $ endif
|
|---|
| 70 | $ write sys$output "parameter ''param' is not known to VMS."
|
|---|
| 71 | $ goto param_loop
|
|---|
| 72 | $!
|
|---|
| 73 | $param_loop_end:
|
|---|
| 74 | $!
|
|---|
| 75 | $no_gnv = 1
|
|---|
| 76 | $no_perl = 1
|
|---|
| 77 | $!
|
|---|
| 78 | $! Find GNV 2.1.3 + manditory updates
|
|---|
| 79 | $! If properly updated, the GNV$GNU logical name is present.
|
|---|
| 80 | $! Updated GNV utilities have a gnv$ prefix on them.
|
|---|
| 81 | $ gnv_root = f$trnlnm("GNV$GNU", "LNM$SYSTEM_TABLE")
|
|---|
| 82 | $ if gnv_root .nes. ""
|
|---|
| 83 | $ then
|
|---|
| 84 | $ no_gnv = 0
|
|---|
| 85 | $ ! Check for update ar utility.
|
|---|
| 86 | $ new_ar = "gnv$gnu:[usr.bin]gnv$ar.exe"
|
|---|
| 87 | $ if f$search(new_ar) .nes. ""
|
|---|
| 88 | $ then
|
|---|
| 89 | $ ! See if a new port of ar exists.
|
|---|
| 90 | $ ar :== $'new_ar'
|
|---|
| 91 | $ else
|
|---|
| 92 | $ ! Fall back to legacy GNV AR wrapper.
|
|---|
| 93 | $ old_ar = "gnv$gnu:[bin]ar.exe"
|
|---|
| 94 | $ if f$search(old_ar) .nes. ""
|
|---|
| 95 | $ then
|
|---|
| 96 | $ ar :== $'old_ar'
|
|---|
| 97 | $ else
|
|---|
| 98 | $ no_gnv = 1
|
|---|
| 99 | $ endif
|
|---|
| 100 | $ endif
|
|---|
| 101 | $ ! Check for updated bash
|
|---|
| 102 | $ if no_gnv .eq. 0
|
|---|
| 103 | $ then
|
|---|
| 104 | $ new_bash = "gnv$gnu:[bin]gnv$bash.exe"
|
|---|
| 105 | $ if f$search(new_bash) .nes. ""
|
|---|
| 106 | $ then
|
|---|
| 107 | $ bash :== $'new_bash'
|
|---|
| 108 | $ sh :== $'new_bash'
|
|---|
| 109 | $ else
|
|---|
| 110 | $ no_gnv = 1
|
|---|
| 111 | $ endif
|
|---|
| 112 | $ endif
|
|---|
| 113 | $ ! Check for updated coreutils
|
|---|
| 114 | $ if no_gnv .eq. 0
|
|---|
| 115 | $ then
|
|---|
| 116 | $ new_cat = "gnv$gnu:[bin]gnv$cat.exe"
|
|---|
| 117 | $ if f$search(new_cat) .nes. ""
|
|---|
| 118 | $ then
|
|---|
| 119 | $ cat :== $'new_cat'
|
|---|
| 120 | $ cp :== $gnv$gnu:[bin]gnv$cp.exe
|
|---|
| 121 | $ echo :== $gnv$gnu:[bin]gnv$echo.exe
|
|---|
| 122 | $ false :== $gnv$gnu:[bin]gnv$false.exe
|
|---|
| 123 | $ true :== $gnv$gnu:[bin]gnv$true.exe
|
|---|
| 124 | $ touch :== $gnv$gnu:[bin]gnv$touch.exe
|
|---|
| 125 | $ mkdir :== $gnv$gnu:[bin]gnv$mkdir.exe
|
|---|
| 126 | $ rm :== $gnv$gnu:[bin]gnv$rm.exe
|
|---|
| 127 | $ sleep :== $gnv$gnu:[bin]gnv$sleep.exe
|
|---|
| 128 | $ else
|
|---|
| 129 | $ no_gnv = 1
|
|---|
| 130 | $ endif
|
|---|
| 131 | $ endif
|
|---|
| 132 | $ ! Check for updated diff utility.
|
|---|
| 133 | $ if no_gnv .eq. 0
|
|---|
| 134 | $ then
|
|---|
| 135 | $ new_diff = "gnv$gnu:[usr.bin]gnv$diff.exe"
|
|---|
| 136 | $ if f$search(new_diff) .nes. ""
|
|---|
| 137 | $ then
|
|---|
| 138 | $ ! See if a new port of diff exists.
|
|---|
| 139 | $ diff :== $'new_diff'
|
|---|
| 140 | $ else
|
|---|
| 141 | $ ! Fall back to legacy GNV diff
|
|---|
| 142 | $ old_diff = "gnv$gnu:[bin]diff.exe"
|
|---|
| 143 | $ if f$search(old_diff) .nes. ""
|
|---|
| 144 | $ then
|
|---|
| 145 | $ diff :== $'old_diff'
|
|---|
| 146 | $ else
|
|---|
| 147 | $ no_gnv = 1
|
|---|
| 148 | $ endif
|
|---|
| 149 | $ endif
|
|---|
| 150 | $ endif
|
|---|
| 151 | $ endif
|
|---|
| 152 | $!
|
|---|
| 153 | $if no_gnv
|
|---|
| 154 | $then
|
|---|
| 155 | $ write sys$output "Could not find an up to date GNV installed!"
|
|---|
| 156 | $ help_flag = 1
|
|---|
| 157 | $endif
|
|---|
| 158 | $!
|
|---|
| 159 | $! Find perl 5.18.1 or later.
|
|---|
| 160 | $!
|
|---|
| 161 | $! look in perl_root:[000000]perl_setup.com
|
|---|
| 162 | $ perl_root = f$trnlnm("perl_root")
|
|---|
| 163 | $ ! This works with known perl installed from PCSI kits.
|
|---|
| 164 | $ if perl_root .nes. ""
|
|---|
| 165 | $ then
|
|---|
| 166 | $ perl_ver = f$element(1, ".", perl_root)
|
|---|
| 167 | $ if f$locate("-", perl_ver) .lt. f$length(perl_ver)
|
|---|
| 168 | $ then
|
|---|
| 169 | $ no_perl = 0
|
|---|
| 170 | $ endif
|
|---|
| 171 | $ endif
|
|---|
| 172 | $ if no_perl
|
|---|
| 173 | $ then
|
|---|
| 174 | $! look for sys$common:[perl-*]perl_setup.com
|
|---|
| 175 | $ perl_setup = f$search("sys$common:[perl-*]perl_setup.com")
|
|---|
| 176 | $ if perl_setup .eqs. ""
|
|---|
| 177 | $ then
|
|---|
| 178 | $ if gnv_root .nes. ""
|
|---|
| 179 | $ then
|
|---|
| 180 | $ gnv_device = f$parse(gnv_root,,,"DEVICE")
|
|---|
| 181 | $ perl_templ = "[vms$common.perl-*]perl_setup.com"
|
|---|
| 182 | $ perl_search = f$parse(perl_templ, gnv_device)
|
|---|
| 183 | $ perl_setup = f$search(perl_search)
|
|---|
| 184 | $ endif
|
|---|
| 185 | $ endif
|
|---|
| 186 | $ if perl_setup .nes. ""
|
|---|
| 187 | $ then
|
|---|
| 188 | $ @'perl_setup'
|
|---|
| 189 | $ no_perl = 0
|
|---|
| 190 | $ endif
|
|---|
| 191 | $ endif
|
|---|
| 192 | $!
|
|---|
| 193 | $ if no_perl
|
|---|
| 194 | $ then
|
|---|
| 195 | $ write sys$output "Could not find an up to date Perl installed!"
|
|---|
| 196 | $ help_flag = "-help"
|
|---|
| 197 | $ endif
|
|---|
| 198 | $!
|
|---|
| 199 | $!
|
|---|
| 200 | $ if help_flag .nes. ""
|
|---|
| 201 | $ then
|
|---|
| 202 | $ type sys$input
|
|---|
| 203 | $DECK
|
|---|
| 204 | This is a test script wrapper for the run_make_tests.pl script.
|
|---|
| 205 |
|
|---|
| 206 | This wrapper makes sure that the DCL symbols and logical names needed to
|
|---|
| 207 | run the perl script are in place.
|
|---|
| 208 |
|
|---|
| 209 | The test wrapper currently requires that the DCL symbols be global symbols.
|
|---|
| 210 | Those symbols will be left behind after the procedure is run.
|
|---|
| 211 |
|
|---|
| 212 | The PERL_ROOT will be set to a compatible perl if such a perl is found and
|
|---|
| 213 | is not the default PERL_ROOT:. This setting will persist after the test.
|
|---|
| 214 |
|
|---|
| 215 | This wrapper should be run with the default set to the base directory
|
|---|
| 216 | of the make source.
|
|---|
| 217 |
|
|---|
| 218 | The HELP parameter will bring up this text and then run the help script
|
|---|
| 219 | for the Perl wrapper. Not all options for the perl script have been
|
|---|
| 220 | implemented, such as valgrind or specifying the make path or source path.
|
|---|
| 221 |
|
|---|
| 222 | Running the wrapper script requires:
|
|---|
| 223 | Perl 5.18 or later.
|
|---|
| 224 | PCSI kits available from http://sourceforge.net/projects/vmsperlkit/files/
|
|---|
| 225 |
|
|---|
| 226 | GNV 2.1.3 or later. GNV 3.0.1 has not tested with this script.
|
|---|
| 227 | Bash 4.2.47 or later.
|
|---|
| 228 | Coreutils 8.21 or later.
|
|---|
| 229 | http://sourceforge.net/projects/gnv/files/
|
|---|
| 230 | Read before installing:
|
|---|
| 231 | http://sourceforge.net/p/gnv/wiki/InstallingGNVPackages/
|
|---|
| 232 | As updates for other GNV components get posted, those updates should
|
|---|
| 233 | be used.
|
|---|
| 234 |
|
|---|
| 235 | $EOD
|
|---|
| 236 | $ endif
|
|---|
| 237 | $!
|
|---|
| 238 | $ if no_gnv .or. no_perl then exit 44
|
|---|
| 239 | $!
|
|---|
| 240 | $!
|
|---|
| 241 | $ default = f$environment("DEFAULT")
|
|---|
| 242 | $ default_dev = f$element(0, ":", default) + ":"
|
|---|
| 243 | $ this = f$environment("PROCEDURE")
|
|---|
| 244 | $ on error then goto all_error
|
|---|
| 245 | $ set default 'default_dev''f$parse(this,,,"DIRECTORY")'
|
|---|
| 246 | $!
|
|---|
| 247 | $! Need to make sure that the config-flags.pm exists.
|
|---|
| 248 | $ if f$search("config-flags.pm") .eqs. ""
|
|---|
| 249 | $ then
|
|---|
| 250 | $ @config_flags_pm.com
|
|---|
| 251 | $ endif
|
|---|
| 252 | $ define/user bin 'default_dev'[-],gnv$gnu:[bin]
|
|---|
| 253 | $ define/user decc$filename_unix_noversion enable
|
|---|
| 254 | $ define/user decc$filename_unix_report enable
|
|---|
| 255 | $ define/user decc$readdir_dropdotnotype enable
|
|---|
| 256 | $ flags = ""
|
|---|
| 257 | $ if verbose_flag .nes. "" then flags = verbose_flag
|
|---|
| 258 | $ if detail_flag .nes. "" then flags = flags + " " + detail_flag
|
|---|
| 259 | $ if keep_flag .nes. "" then flags = flags + " " + keep_flag
|
|---|
| 260 | $ if usage_flag .nes. "" then flags = flags + " " + usage_flag
|
|---|
| 261 | $ if help_flag .nes. "" then flags = flags + " " + help_flag
|
|---|
| 262 | $ if debug_flag .nes. "" then flags = flags + " " + debug_flag
|
|---|
| 263 | $ flags = f$edit(flags, "TRIM, COMPRESS")
|
|---|
| 264 | $ if testname .nes. ""
|
|---|
| 265 | $ then
|
|---|
| 266 | $ perl run_make_tests.pl "''testname'" 'flags'
|
|---|
| 267 | $ else
|
|---|
| 268 | $ perl run_make_tests.pl 'flags'
|
|---|
| 269 | $ endif
|
|---|
| 270 | $all_error:
|
|---|
| 271 | $ set default 'default'
|
|---|
| 272 | $!
|
|---|