mirror of
https://github.com/boostorg/build.git
synced 2026-02-03 09:02:11 +00:00
The used 'CALLER_MODULE' to determine the project where the main target is to be declared, which did not work if the rule is called from another module. Thanks to Zbynek Winkler for the bug report. * build/project.jam (current): New rule * test/wrapper.py: New test * other files: Use 'project.current'. [SVN r22569]
48 lines
954 B
Python
48 lines
954 B
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.
|
|
|
|
# Test that the user can define his own rule that will call builtin main
|
|
# target rule and that this will work.
|
|
|
|
from BoostBuild import Tester, List
|
|
|
|
t = Tester()
|
|
|
|
t.write("Jamfile", """ my-test : test.cpp ;
|
|
|
|
|
|
""")
|
|
|
|
t.write("test.cpp", """
|
|
int main()
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
""")
|
|
|
|
t.write("project-root.jam", """ using testing ;
|
|
|
|
rule my-test ( name ? : sources + )
|
|
{
|
|
{
|
|
name ?= test ;
|
|
unit-test $(name) : $(sources) ; # /site-config//cppunit /util//testMain ;
|
|
}
|
|
}
|
|
|
|
IMPORT $(__name__) : my-test : : my-test ;
|
|
|
|
|
|
""")
|
|
|
|
t.run_build_system()
|
|
t.expect_addition("bin/$toolset/debug/test.passed")
|
|
|
|
t.cleanup()
|
|
|