code: def test_choose():
      t = BoostBuild.Tester(use_test_config=0)
      t.write(
          "Jamroot",
          """
  import configure ;
  obj pass : pass.cpp ;
  obj fail : fail.cpp ;
  explicit pass fail ;
  obj foo : foo.cpp :
    [ configure.choose "which one?" : fail <define>FAIL : pass <define>PASS ] ;
  """,
      )
      t.write("pass.cpp", "void f() {}\n")
      t.write("fail.cpp", "#error fail.cpp\n")
      t.write(
          "foo.cpp",
          """
  #ifndef PASS
  #error PASS not defined
  #endif
  #ifdef FAIL
  #error FAIL is defined
  #endif
  """,
      )
      t.run_build_system()
      t.expect_output_lines(["    - which one?               : pass"])
      t.expect_addition("bin/$toolset/debug*/pass.obj")
      t.expect_addition("bin/$toolset/debug*/foo.obj")
      t.expect_nothing_more()
  
      # An up-to-date build should use the cache
      t.run_build_system()
      t.expect_output_lines(
          ["    - which one?               : pass (cached)"]
      )
      t.expect_nothing_more()
  
      # -a should re-run everything, including configuration checks
      t.run_build_system(["-a"])
      t.expect_output_lines(["    - which one?               : pass"])
      t.expect_touch("bin/$toolset/debug*/pass.obj")
      t.expect_touch("bin/$toolset/debug*/foo.obj")
      t.expect_nothing_more()
  
      # --reconfigure should re-run configuration checks only
      t.run_build_system(["--reconfigure"])
      t.expect_output_lines(["    - which one?               : pass"])
      t.expect_touch("bin/$toolset/debug*/pass.obj")
      t.expect_nothing_more()
  
      # -a -n should not rebuild configuration checks
      t.run_build_system(["-a", "-n"])
      t.expect_output_lines(
          ["    - which one?               : pass (cached)"]
      )
      t.expect_nothing_more()
  
      # --clean-all should clear all configuration checks
      t.run_build_system(["--clean-all"])
      t.expect_output_lines(
          ["    - which one?               : pass (cached)"]
      )
      t.expect_removal("bin/$toolset/debug*/pass.obj")
      t.expect_removal("bin/$toolset/debug*/foo.obj")
      t.expect_nothing_more()
  
      # If configuration checks are absent, then --clean-all
      # should create them and then delete them again.  This
      # currently fails because clean cannot remove targets
      # that were created in the same build.
      # t.run_build_system(["--clean-all"])
      # t.expect_output_lines([
      #    "    - which one?               : pass"])
      # t.expect_nothing_more()
  
      # Just verify that we're actually in the initial
      # state here.
      t.run_build_system()
      t.expect_output_lines(["    - which one?               : pass"])
      t.expect_addition("bin/$toolset/debug*/pass.obj")
      t.expect_addition("bin/$toolset/debug*/foo.obj")
      t.expect_nothing_more()
  
      t.cleanup()
  
imports: import BoostBuild
label_desc: Use image node_id 2 for calling a global function with example usage: test_choose() without return types