view site_scons/site_tools/cpython/test/basic/sconstest-cflag-compile.py @ 16:927f2cf75357

Changed build system from SCons to WAF. * WAF is an old fork of SCons that is now for all intents and purposes a different build system. * Unlike SCons which requires a system install of the scons library to work, the entire WAF library is self-contained in a single 'waf' Python script provided with PARPG. * Build instructions are a little different from SCons - execute the local 'waf' script with the arguments 'configure install'. * To make a local install for testing, add the '--destdir=<directory>' option to make all files install under <directory> as a fake root (e.g. '--destdir=dev_install' would make WAF install all files under the 'dev_install' directory in the PARPG source). * Added a waf_paths.py WAF tool to set GNU-compatible installation path variables (i.e. PREFIX, EXEC_PREFIX, LIBDIR, etc.). These variables should be initialized to sane defaults on Windows, where GNU standards don't usually apply.
author M. George Hansen <technopolitica@gmail.com>
date Thu, 09 Jun 2011 21:35:19 -1000
parents 4706e0194af3
children
line wrap: on
line source

#!/usr/bin/env python
#
# Copyright (c) 2001-2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#


"""
Test compilation of Python modules to .pyc files.
"""

import TestSCons

test = TestSCons.TestSCons()
test.dir_fixture("image")
test.file_fixture('SConstruct-cflag','SConstruct')
test.file_fixture('../../__init__.py','site_scons/site_tools/cpython/__init__.py')
test.run(arguments = 'install')

test.must_exist(test.workpath('pybuilderdir/pyfiles/hello.pyc'))
test.must_exist(test.workpath('pybuilderdir/pyfiles/hello2.pyc'))
test.must_exist(test.workpath('pybuilderdir/pyfiles2/hello.pyc'))
test.must_exist(test.workpath('pybuilderdir/pyfiles2/hello2.pyc'))

test.pass_test()

# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=4 shiftwidth=4: