Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/tools/jam/test/builtin_shell.jam @ 29

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

updated boost from 1_33_1 to 1_34_1

File size: 1.4 KB
Line 
1#~ Copyright 2006 Rene Rivera.
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
5ECHO --- Testing SHELL builtin... ;
6
7local result = 0 ;
8local rule error ( message * )
9{
10    local b = [ BACKTRACE ] ;
11    ECHO "$(b[9]):$(b[10]): error:" $(message) ;
12}
13local rule assert ( expected + : test ? : obtained + )
14{
15    test ?= "(==)" ;
16    local r = 0 ;
17    if $(test) = "(==)" && $(expected) != $(obtained)
18    {
19        error [FAILED] '$(expected)' $(test) '$(obtained)' ;
20        r = 1 ;
21    }
22    else if $(test) = "(!=)" && $(expected) = $(obtained)
23    {
24        error [FAILED] '$(expected)' $(test) '$(obtained)' ;
25        r = 1 ;
26    }
27    result = [ CALC $(result) + $(r) ] ;
28}
29
30#~ ---------------------------------------------------------------------
31
32local c = "date" ;
33if $(NT) { c = "PATH" ; }
34
35assert ""       : (!=) : [ SHELL $(c) ] ;
36assert ""       : (==) : [ SHELL $(c) : no-output ] ;
37assert "" 0     : (!=) : [ SHELL $(c) : exit-status ] ;
38assert "" 0     : (==) : [ SHELL $(c) : no-output : exit-status ] ;
39assert ""       : (!=) : [ COMMAND $(c) ] ;
40assert ""       : (==) : [ COMMAND $(c) : no-output ] ;
41assert "" 0     : (!=) : [ COMMAND $(c) : exit-status ] ;
42assert "" 0     : (==) : [ COMMAND $(c) : no-output : exit-status ] ;
43
44#~ ---------------------------------------------------------------------
45
46EXIT --- Complete : $(result) ;
Note: See TracBrowser for help on using the repository browser.