From 9c7e1dae1defdc95b3e333caa884e995879b3365 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Mon, 2 Jul 2012 18:59:11 +0000 Subject: [PATCH] Updated Boost Build test_rc.py test to make its internal dummy-RC toolset always use the .obj suffix when generating OBJ targets. This is another attempt at correcting failures for this test on non-Windows platforms. [SVN r79231] --- v2/test/test_rc.py | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/v2/test/test_rc.py b/v2/test/test_rc.py index 197ae8f3d..d2c1d51e9 100755 --- a/v2/test/test_rc.py +++ b/v2/test/test_rc.py @@ -28,22 +28,22 @@ def included_resource_newer_than_rc_script(): # have been). # # --ignore-site-config --user-config= - # Disable reading any external Boost Build configuration. This avoids - # being adversly affected by other initialized toolset's global Boost - # Build configuration settings. For example, if the gcc toolset is - # initialized it may, depending on the platform, change the file - # extension Boost Build uses for its OBJ targets to '.o' even though we - # are using our own custom toolset in this test. + # Disable reading any external Boost Build configuration. This test is + # self sufficient so these options protect it from being adversly + # affected by any local (mis)configuration.. t = BoostBuild.Tester("-d4 --debug-configuration --ignore-site-config " "--user-config= toolset=%s" % toolsetName, pass_d0=False, pass_toolset=False, use_test_config=False, translate_suffixes=False) # Prepare a dummy toolset so we do not get errors in case the default one # is not found and that we can test rc.jam functionality without having to - # depend on the externally specified toolset actually supporting it. + # depend on the externally specified toolset actually supporting it exactly + # the way it is required for this test, e.g. gcc toolset, under some + # circumstances, uses a quiet action for generating its null RC targets. t.write(toolsetName + ".jam", """\ import feature ; import rc ; +import type ; local toolset-name = "%s" ; feature.extend toolset : $(toolset-name) ; rule init ( ) { } @@ -57,6 +57,18 @@ module rc } actions compile.resource.dummy { $(.TOUCH) "$(<)" } } +# Make OBJ files generated by our toolset use the "obj" suffix on all +# platforms. We need to do this explicitly for windows & cygwin to +# override the default OBJ type configuration (otherwise we would get +# 'ambiguous key' errors on those platforms). +local rule set-generated-obj-suffix ( target-os ? ) +{ + type.set-generated-target-suffix OBJ : $(toolset-name) + $(target-os) : obj ; +} +set-generated-obj-suffix ; +set-generated-obj-suffix windows ; +set-generated-obj-suffix cygwin ; """ % toolsetName) # Prepare project source files. @@ -73,9 +85,10 @@ obj xxx : xxx.rc ; params += " -n -sNOEXEC=NOEXEC" t.run_build_system(params) t.expect_output_line("*NOEXEC*", noexec) - t.expect_output_line("compile.resource.dummy *xxx_res.obj", expect) + obj_file = "xxx_res.obj" + t.expect_output_line("compile.resource.dummy *%s" % obj_file, expect) if expect and not noexec: - expect("bin/%s/debug/xxx_res.obj" % toolsetName) + expect("bin/%s/debug/%s" % (toolsetName, obj_file)) t.expect_nothing_more() def test(n, expect):