code: def test_conditions_on_default_toolset():
      """Test that toolset and toolset subfeature conditioned properties get
      applied correctly when the toolset is selected by default. Implicitly tests
      that we can use the set-default-toolset rule to set the default toolset to
      be used by Boost Build.
      """
  
      t = BoostBuild.Tester(
          "--user-config= --ignore-site-config",
          pass_toolset=False,
          use_test_config=False,
      )
  
      toolset_name = "myCustomTestToolset"
      toolset_version = "v"
      toolset_version_unused = "v_unused"
      message_loaded = "Toolset '%s' loaded." % toolset_name
      message_initialized = "Toolset '%s' initialized." % toolset_name
  
      # Custom toolset.
      t.write(
          toolset_name + ".jam",
          """
  import feature ;
  ECHO "%(message_loaded)s" ;
  feature.extend toolset : %(toolset_name)s ;
  feature.subfeature toolset %(toolset_name)s : version : %(toolset_version)s %(toolset_version_unused)s ;
  rule init ( version ) { ECHO "%(message_initialized)s" ; }
  """
          % {
              "message_loaded": message_loaded,
              "message_initialized": message_initialized,
              "toolset_name": toolset_name,
              "toolset_version": toolset_version,
              "toolset_version_unused": toolset_version_unused,
          },
      )
  
      # Main Boost Build project script.
      t.write(
          "jamroot.jam",
          """
  import build-system ;
  import errors ;
  import feature ;
  import notfile ;
  
  build-system.set-default-toolset %(toolset_name)s : %(toolset_version)s ;
  
  feature.feature description : : free incidental ;
  
  # We use a rule instead of an action to avoid problems with action output not
  # getting piped to stdout by the testing system.
  rule buildRule ( names : targets ? : properties * )
  {
      local descriptions = [ feature.get-values description : $(properties) ] ;
      ECHO "descriptions:" /$(descriptions)/ ;
      local toolset = [ feature.get-values toolset : $(properties) ] ;
      ECHO "toolset:" /$(toolset)/ ;
      local toolset-version = [ feature.get-values "toolset-$(toolset):version" : $(properties) ] ;
      ECHO "toolset-version:" /$(toolset-version)/ ;
  }
  
  notfile testTarget
      : @buildRule
      :
      :
      <description>stand-alone
      <toolset>%(toolset_name)s:<description>toolset
      <toolset>%(toolset_name)s-%(toolset_version)s:<description>toolset-version
      <toolset>%(toolset_name)s-%(toolset_version_unused)s:<description>toolset-version-unused ;
  """
          % {
              "toolset_name": toolset_name,
              "toolset_version": toolset_version,
              "toolset_version_unused": toolset_version_unused,
          },
      )
  
      t.run_build_system()
      t.expect_output_lines(
          configuring_default_toolset_message % toolset_name
      )
      t.expect_output_lines(message_loaded)
      t.expect_output_lines(message_initialized)
      t.expect_output_lines(
          "descriptions: /stand-alone/ /toolset/ " "/toolset-version/"
      )
      t.expect_output_lines("toolset: /%s/" % toolset_name)
      t.expect_output_lines("toolset-version: /%s/" % toolset_version)
  
      t.cleanup()
  
imports: import BoostBuild
label_desc: Use image node_id 1 for calling a global function with example usage: test_conditions_on_default_toolset() without return types