VirtualBox

Ignore:
Timestamp:
May 16, 2005 4:54:08 PM (19 years ago)
Author:
bird
Message:

Current make snaphot, 2005-05-16.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/gmake/tests/scripts/functions/substitution

    r53 r284  
    1 $description = "The following test creates a makefile to ...";
     1#                                                                    -*-perl-*-
     2
     3$description = "Test the subst and patsubst functions";
    24
    35$details = "";
    46
    5 open(MAKEFILE,"> $makefile");
     7# Generic patsubst test: test both the function and variable form.
    68
    7 # The Contents of the MAKEFILE ...
     9run_make_test('
     10foo := a.o b.o c.o
     11bar := $(foo:.o=.c)
     12bar2:= $(foo:%.o=%.c)
     13bar3:= $(patsubst %.c,%.o,x.c.c bar.c)
     14all:;@echo $(bar); echo $(bar2); echo $(bar3)',
     15'',
     16'a.c b.c c.c
     17a.c b.c c.c
     18x.c.o bar.o');
    819
    9 print MAKEFILE "foo := a.o b.o c.o\n"
    10               ."bar := \$(foo:.o=.c)\n"
    11               ."bar2:= \$(foo:%.o=%.c)\n"
    12               ."bar3:= \$(patsubst %.c,%.o,x.c.c bar.c)\n"
    13               ."all:\n"
    14               ."\t\@echo \$(bar)\n"
    15               ."\t\@echo \$(bar2)\n"
    16               ."\t\@echo \$(bar3)\n";
     20# Patsubst without '%'--shouldn't match because the whole word has to match
     21# in patsubst.  Based on a bug report by Markus Mauhart <qwe123@chello.at>
    1722
    18 # END of Contents of MAKEFILE
     23run_make_test('all:;@echo $(patsubst Foo,Repl,FooFoo)', '', 'FooFoo');
    1924
    20 close(MAKEFILE);
     25# Variable subst where a pattern matches multiple times in a single word.
     26# Based on a bug report by Markus Mauhart <qwe123@chello.at>
    2127
    22 &run_make_with_options($makefile,"",&get_logfile);
    23 
    24 # Create the answer to what should be produced by this Makefile
    25 $answer = "a.c b.c c.c\n"
    26          ."a.c b.c c.c\n"
    27          ."x.c.o bar.o\n";
    28 
    29 &compare_output($answer,&get_logfile(1));
     28run_make_test('
     29A := fooBARfooBARfoo
     30all:;@echo $(A:fooBARfoo=REPL)', '', 'fooBARREPL');
    3031
    31321;
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