1#!/usr/local/bin/perl 2######################################################################### 3 4 #************************************************************** 5# 6# Licensed to the Apache Software Foundation (ASF) under one 7# or more contributor license agreements. See the NOTICE file 8# distributed with this work for additional information 9# regarding copyright ownership. The ASF licenses this file 10# to you under the Apache License, Version 2.0 (the 11# "License"); you may not use this file except in compliance 12# with the License. You may obtain a copy of the License at 13# 14# http://www.apache.org/licenses/LICENSE-2.0 15# 16# Unless required by applicable law or agreed to in writing, 17# software distributed under the License is distributed on an 18# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 19# KIND, either express or implied. See the License for the 20# specific language governing permissions and limitations 21# under the License. 22# 23#************************************************************** 24 25 26 27open(TESTFILE, $ARGV[0]); 28 29while (<TESTFILE>) 30{ 31 if ($_[1] eq "-q") 32 { 33 chomp $_; 34 @args = split('\|', $_); 35 @filestuff = split('\.', @args[0]); 36 $filename = @filestuff[0] . ".infile"; 37 open (TESTCASE, ">$filename") || die "Error opening $filename"; 38 print TESTCASE "# @args[1]\n# @args[2]\n"; 39 print TESTCASE "TEST|@args[1]|QUICKWORD|@filestuff[0]\n" ; 40 close TESTCASE; 41 } 42 if ($_[1] eq "-m") 43 { 44 chomp $_; 45 @args = split('\|', $_); 46 @filestuff = split('\.', @args[0]); 47 $filename = @filestuff[0] . ".infile"; 48 open (TESTCASE, ">$filename") || die "Error opening $filename"; 49 print TESTCASE "# @args[1]\n# @args[2]\n"; 50 print TESTCASE "TEST|@args[1]|MINICALC|@filestuff[0]\n" ; 51 close TESTCASE; 52 } 53 54} 55