diff --git a/new/stage.jam b/new/stage.jam index c1f17dbe5..ed6192b56 100644 --- a/new/stage.jam +++ b/new/stage.jam @@ -88,6 +88,7 @@ rule stage-target-class ( name-and-dir : project : sources * : requirements * : i2 = [ new file-target $(n:D=) : [ $(i).type ] : $(self.project) ] ; local a = [ new action $(i2) : $(i) : common.copy ] ; + $(i2).suffix [ $(i).suffix ] ; $(i2).action $(a) ; } diff --git a/test/suffix.py b/test/suffix.py new file mode 100644 index 000000000..ec6c44473 --- /dev/null +++ b/test/suffix.py @@ -0,0 +1,29 @@ +#!/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. + +# Regression test: when staging V2 used to change suffixes on targets +# corresponding to real files. + +from BoostBuild import Tester, List + +t = Tester() + +t.write("Jamfile", """ +import type : register ; +register A : a1 a2 a3 ; + +stage a : a.a3 ; +""") + +t.write("project-root.jam", "") +t.write("a.a3", "") + +t.run_build_system() +t.expect_addition("a/a.a3"); + +t.cleanup() + diff --git a/test/test_all.py b/test/test_all.py index 7f398c90a..9e61a78f9 100644 --- a/test/test_all.py +++ b/test/test_all.py @@ -103,6 +103,7 @@ tests = [ "project_test1", "loop", "conditionals3", "tag", + "suffix", ] if os.name == 'posix': diff --git a/v2/test/suffix.py b/v2/test/suffix.py new file mode 100644 index 000000000..ec6c44473 --- /dev/null +++ b/v2/test/suffix.py @@ -0,0 +1,29 @@ +#!/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. + +# Regression test: when staging V2 used to change suffixes on targets +# corresponding to real files. + +from BoostBuild import Tester, List + +t = Tester() + +t.write("Jamfile", """ +import type : register ; +register A : a1 a2 a3 ; + +stage a : a.a3 ; +""") + +t.write("project-root.jam", "") +t.write("a.a3", "") + +t.run_build_system() +t.expect_addition("a/a.a3"); + +t.cleanup() + diff --git a/v2/test/test_all.py b/v2/test/test_all.py index 7f398c90a..9e61a78f9 100644 --- a/v2/test/test_all.py +++ b/v2/test/test_all.py @@ -103,6 +103,7 @@ tests = [ "project_test1", "loop", "conditionals3", "tag", + "suffix", ] if os.name == 'posix': diff --git a/v2/tools/stage.jam b/v2/tools/stage.jam index c1f17dbe5..ed6192b56 100644 --- a/v2/tools/stage.jam +++ b/v2/tools/stage.jam @@ -88,6 +88,7 @@ rule stage-target-class ( name-and-dir : project : sources * : requirements * : i2 = [ new file-target $(n:D=) : [ $(i).type ] : $(self.project) ] ; local a = [ new action $(i2) : $(i) : common.copy ] ; + $(i2).suffix [ $(i).suffix ] ; $(i2).action $(a) ; }