You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
waf_old/tests/utils/wscript

40 lines
764 B
Python

#! /usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2012 (ita)
VERSION='0.0.1'
APPNAME='preproc_test'
top = '.'
out = 'build'
from waflib import Utils
from waflib.Logs import pprint
def configure(conf):
pass
def build(bld):
bld.failure = 0
def disp(color, result):
pprint(color, result)
if color == 'RED':
bld.failure=1
def stop_status(bld):
if bld.failure:
bld.fatal('One or several test failed, check the outputs above')
bld.add_post_fun(stop_status)
def test_shell(inp, expected):
ret = Utils.shell_escape(inp)
if ret == expected:
color = "GREEN"
else:
color = "RED"
disp(color, "%r -> %r\t\texpected: %r" % (inp, ret, expected))
test_shell("ls -l", "ls -l")
test_shell(['ls', '-l', 'a space'], "ls -l 'a space'")