VirtualBox

Ignore:
Timestamp:
Mar 12, 2018 7:32:29 PM (7 years ago)
Author:
bird
Message:

Imported make 4.2.1 (2e55f5e4abdc0e38c1d64be703b446695e70b3b6) from https://git.savannah.gnu.org/git/make.git.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/gnumake/current/tests/scripts/functions/foreach

    r2596 r3138  
    11#                                                                    -*-perl-*-
    2 # $Id: foreach,v 1.5 2006/03/10 02:20:46 psmith Exp $
     2# $Id$
    33
    44$description = "Test the foreach function.";
     
    5454              'FOREACH');
    5555
     56# Allow variable names with trailing space
     57run_make_test(q!
     58$(foreach \
     59  a \
     60, b c d \
     61, $(info $a))
     62all:;@:
     63!,
     64              "", "b\nc\nd\n");
    5665
    57 # TEST 2: Check some error conditions.
     66# Allow empty variable names.  We still expand the body.
     67
     68run_make_test('
     69x = $(foreach ,1 2 3,a)
     70y := $x
     71
     72all: ; @echo $y',
     73              '', "a a a\n");
     74
     75# Check some error conditions.
    5876
    5977run_make_test('
     
    6381all: ; @echo $y',
    6482              '',
    65               "#MAKEFILE#:2: *** insufficient number of arguments (1) to function `foreach'.  Stop.",
     83              "#MAKEFILE#:2: *** insufficient number of arguments (1) to function 'foreach'.  Stop.",
    6684              512);
    6785
    6886run_make_test('
    69 x = $(foreach )
     87x = $(foreach x,y)
    7088y := $x
    7189
    7290all: ; @echo $y',
    7391              '',
    74               "#MAKEFILE#:2: *** insufficient number of arguments (1) to function `foreach'.  Stop.",
     92              "#MAKEFILE#:2: *** insufficient number of arguments (2) to function 'foreach'.  Stop.",
    7593              512);
    7694
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette