Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/tools/build/v2/test/check-arguments.jam @ 32

Last change on this file since 32 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 1.9 KB
Line 
1# Copyright 2001 Dave Abrahams
2# Distributed under the Boost Software License, Version 1.0.
3# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
4
5#
6# Jam code for testing the named-argument patch.
7#
8
9include recursive.jam ;
10
11# Prefixes for all of the jam code we're going to test
12local ECHO_ARGS = "include echo_args.jam ; echo_args "
13   ;
14
15local ECHO_VARARGS = "include echo_args.jam ; echo_varargs "
16   ;
17
18# Check that it will find missing arguments
19Jam-fail $(ECHO_ARGS)";"
20    : "missing argument a"
21    ;
22
23# Check that it will find if too many arguments are passed
24Jam-fail $(ECHO_ARGS)"1 2 : 3 : 4 : 5 ;"
25    : "extra argument 5"
26    ;
27
28# Check that it will find when an argument has too many elements
29Jam-fail $(ECHO_ARGS)"a b c1 c2 : d ;"
30    : "extra argument c2"
31    ;
32
33# Check modifier '?'
34Jam $(ECHO_ARGS)"1 2 3 : 4 ;"
35    : "a= 1 b= 2 c= 3 : d= 4 : e=" ;
36Jam $(ECHO_ARGS)"1 2 : 3 ;"
37    : "a= 1 b= 2 c= : d= 3 : e=" ;
38Jam $(ECHO_ARGS)"1 : 2 ;"
39    : "a= 1 b= c= : d= 2 : e=" ;
40
41# Check modifier '+'
42Jam-fail $(ECHO_ARGS)"1 ;"
43    : "missing argument d" ;
44Jam $(ECHO_ARGS)"1 : 2 3 ;"
45    : "a= 1 b= c= : d= 2 3 : e=" ;
46Jam $(ECHO_ARGS)"1 : 2 3 4 ;"
47    : "a= 1 b= c= : d= 2 3 4 : e=" ;
48
49# Check modifier '*'
50Jam $(ECHO_ARGS)"1 : 2 : 3 ;"
51    : "a= 1 b= c= : d= 2 : e= 3" ;
52Jam $(ECHO_ARGS)"1 : 2 : 3 4 ;"
53    : "a= 1 b= c= : d= 2 : e= 3 4" ;
54Jam $(ECHO_ARGS)"1 : 2 : 3 4 5 ;"
55    : "a= 1 b= c= : d= 2 : e= 3 4 5" ;
56
57#
58# Check varargs
59#
60Jam $(ECHO_VARARGS)"1 : 2 : 3 4 5 ;"
61    : "a= 1 b= c= : d= 2 : e= 3 4 5" ;
62Jam $(ECHO_VARARGS)"1 : 2 : 3 4 5 : 6 ;"
63    : "a= 1 b= c= : d= 2 : e= 3 4 5 : rest= 6" ;
64Jam $(ECHO_VARARGS)"1 : 2 : 3 4 5 : 6 7 ;"
65    : "a= 1 b= c= : d= 2 : e= 3 4 5 : rest= 6 7" ;
66Jam $(ECHO_VARARGS)"1 : 2 : 3 4 5 : 6 7 : 8 ;"
67    : "a= 1 b= c= : d= 2 : e= 3 4 5 : rest= 6 7 : 8" ;
68Jam $(ECHO_VARARGS)"1 : 2 : 3 4 5 : 6 7 : 8 : 9 ;"
69    : "a= 1 b= c= : d= 2 : e= 3 4 5 : rest= 6 7 : 8 : 9" ;
70
71
Note: See TracBrowser for help on using the repository browser.