mirror of
https://github.com/boostorg/build.git
synced 2026-02-17 01:32:12 +00:00
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]
This commit is contained in:
@@ -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 <target-os> 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>$(toolset-name)
|
||||
<target-os>$(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):
|
||||
|
||||
Reference in New Issue
Block a user