code: def test_assigning_project_ids():
      t = BoostBuild.Tester(pass_toolset=False)
      t.write(
          "jamroot.jam",
          """\
  import assert ;
  import modules ;
  import notfile ;
  import project ;
  
  rule assert-project-id ( id ? : module-name ? )
  {
      module-name ?= [ CALLER_MODULE ] ;
      assert.result $(id) : project.attribute $(module-name) id ;
  }
  
  # Project rule modifies the main project id.
  assert-project-id ;  # Initial project id is empty
  project foo  ; assert-project-id /foo ;
  project      ; assert-project-id /foo ;
  project foo  ; assert-project-id /foo ;
  project bar  ; assert-project-id /bar ;
  project /foo ; assert-project-id /foo ;
  project ""   ; assert-project-id /foo ;
  
  # Calling the use-project rule does not modify the project's main id.
  use-project id1 : a ;
  # We need to load the 'a' Jamfile module manually as the use-project rule will
  # only schedule the load to be done after the current module load finishes.
  a-module = [ project.load a ] ;
  assert-project-id : $(a-module) ;
  use-project id2 : a ;
  assert-project-id : $(a-module) ;
  modules.call-in $(a-module) : project baz ;
  assert-project-id /baz : $(a-module) ;
  use-project id3 : a ;
  assert-project-id /baz : $(a-module) ;
  
  # Make sure the project id still holds after all the scheduled use-project loads
  # complete. We do this by scheduling the assert for the Jam action scheduling
  # phase.
  notfile x : @assert-a-rule ;
  rule assert-a-rule ( target : : properties * )
  {
      assert-project-id /baz : $(a-module) ;
  }
  """,
      )
      t.write(
          "a/jamfile.jam",
          """\
  # Initial project id for this module is empty.
  assert-project-id ;
  """,
      )
      t.run_build_system()
      t.cleanup()
  
imports: import BoostBuild
  import sys
label_desc: Use image node_id 1 for calling a global function with example usage: test_assigning_project_ids() without return types