2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-02 08:42:13 +00:00
Files
build/test/project_root_constants.py
2003-10-08 05:40:16 +00:00

44 lines
1.1 KiB
Python

#!/usr/bin/python
# Copyright (C) Vladimir Prus 2003. Permission to copy, use, modify, sell and
# distribute this software is granted provided this copyright notice appears in
# all copies. This software is provided "as is" without express or implied
# warranty, and with no claim as to its suitability for any purpose.
from BoostBuild import Tester, List
from string import find
# Create a temporary working directory
t = Tester()
# Create the needed files
t.write("project-root.jam", """
constant FOO : foobar ;
ECHO $(FOO) ;
""")
t.write("Jamfile", """
""")
t.run_build_system()
t.fail_test(find(t.stdout(), "foobar") == -1)
# Regression test: when absolute paths were passed to path-constant rule,
# Boost.Build failed to recognize path as absolute and prepended current dir.
t.write("project-root.jam", """
import path ;
local here = [ path.native [ path.pwd ] ] ;
path-constant HERE : $(here) ;
if $(HERE) != $(here)
{
ECHO "PWD =" $(here) ;
ECHO "path constant =" $(HERE) ;
EXIT ;
}
""")
t.write("Jamfile", "")
t.run_build_system()
t.cleanup()