(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:NO_SIGNAL_OVERRIDE) op:Equal rhs:{(1)} spids:[52])]
      spids: [52]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:CURRENT_DIR)
          op: Equal
          rhs: 
            {
              (DQ 
                (CommandSubPart
                  command_list: 
                    (CommandList
                      children: [
                        (AndOr
                          children: [
                            (C {(cd)} 
                              {
                                (DQ 
                                  (CommandSubPart
                                    command_list: 
                                      (CommandList
                                        children: [
                                          (C {(dirname)} 
                                            {
                                              (DQ 
                                                (BracedVarSub
                                                  token: <VSub_Name BASH_SOURCE>
                                                  bracket_op: 
                                                    (ArrayIndex
                                                      expr: (ArithWord w:{(Lit_Digits 0)})
                                                    )
                                                  spids: [68 73]
                                                )
                                              )
                                            }
                                          )
                                        ]
                                      )
                                    left_token: <Left_CommandSub "$(">
                                    spids: [64 75]
                                  )
                                )
                              }
                            )
                            (C {(pwd)})
                          ]
                          op_id: Op_DAmp
                        )
                      ]
                    )
                  left_token: <Left_CommandSub "$(">
                  spids: [60 81]
                )
              )
            }
          spids: [58]
        )
      ]
      spids: [58]
    )
    (AndOr
      children: [
        (C {(source)} {(DQ (${ VSub_Name CURRENT_DIR) (/../integration_test_setup.sh))})
        (BraceGroup
          children: [
            (Sentence
              child: 
                (SimpleCommand
                  words: [{(echo)} {(DQ ("integration_test_setup.sh not found!"))}]
                  redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[105])]
                )
              terminator: <Op_Semi ";">
            )
            (Sentence child:(C {(exit)} {(1)}) terminator:<Op_Semi ";">)
          ]
          spids: [97]
        )
      ]
      op_id: Op_DPipe
    )
    (C {(add_to_bazelrc)} {(DQ ("test --notest_loasd"))})
    (FuncDef
      name: write_py_files
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [(C {(mkdir)} {(-p)} {(py)}) (C {(fail)} {(DQ ("mkdir py failed"))})]
              op_id: Op_DPipe
            )
            (SimpleCommand
              words: [{(echo)} {(DQ ("py_binary(name = 'binary', srcs = ['binary.py'])"))}]
              redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(py/BUILD)} spids:[159])]
            )
            (SimpleCommand
              words: [{(echo)} {(DQ ("py_test(name = 'test', srcs = ['test.py'])"))}]
              redirects: [(Redir op_id:Redir_DGreat fd:-1 arg_word:{(py/BUILD)} spids:[170])]
            )
            (SimpleCommand
              words: [{(echo)} {(DQ ("print 'Hello, Python World!'"))}]
              redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(py/py.py)} spids:[182])]
            )
            (C {(chmod)} {(Lit_Other "+") (x)} {(py/py.py)})
            (C {(ln)} {(-sf)} {(py.py)} {(py/binary.py)})
            (C {(ln)} {(-sf)} {(py.py)} {(py/test.py)})
          ]
          spids: [134]
        )
      spids: [128 133]
    )
    (FuncDef
      name: write_cc_source_files
      body: 
        (BraceGroup
          children: [
            (C {(mkdir)} {(-p)} {(cc)})
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir op_id:Redir_Great fd:-1 arg_word:{(cc/kitty.cc)} spids:[233])
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("#include <stdio.h>\n") ("\n") ("int main(void) {\n") ("  FILE* f;\n") 
                        ("  char buf[256];\n") ("\n") ("  f = fopen(") (Right_DoubleQuote "\"") (cc/hello_kitty.txt) (Right_DoubleQuote "\"") (", ") 
                        (Right_DoubleQuote "\"") (r) (Right_DoubleQuote "\"") (");\n") ("  if (f == NULL) {\n") ("    f = fopen(") (Right_DoubleQuote "\"") 
                        (cc/pussycat.txt) (Right_DoubleQuote "\"") (", ") (Right_DoubleQuote "\"") (r) (Right_DoubleQuote "\"") (");\n") ("  }\n") 
                        ("  if (f == NULL) {\n") ("    return 1;\n") ("  }\n") ("\n") ("  fgets(buf, 255, f);\n") ("  fclose(f);\n") ("  printf(") 
                        (Right_DoubleQuote "\"") ("%s") (Right_DoubleQuote "\"") (", buf);\n") ("  return 0;\n") ("}\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [237]
                )
              ]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir op_id:Redir_Great fd:-1 arg_word:{(cc/BUILD)} spids:[283])
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("cc_binary(name='kitty',\n") ("          srcs=['kitty.cc'],\n") 
                        ("          data=glob(['*.txt']))\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [287]
                )
              ]
            )
          ]
          spids: [221]
        )
      spids: [215 220]
    )
    (FuncDef
      name: test_run_py_binary
      body: 
        (BraceGroup
          children: [
            (C {(write_py_files)})
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(bazel)} {(run)} {(//py) (Lit_Other ":") (binary)}]
                  redirects: [
                    (Redir
                      op_id: Redir_GreatAnd
                      fd: -1
                      arg_word: {($ VSub_Name "$TEST_log")}
                      spids: [320]
                    )
                  ]
                )
                (C {(fail)} {(DQ ("Expected success"))})
              ]
              op_id: Op_DPipe
            )
            (C {(expect_log_once)} {(SQ <"Hello, Python World">)})
          ]
          spids: [306]
        )
      spids: [300 305]
    )
    (FuncDef
      name: test_run_py_test
      body: 
        (BraceGroup
          children: [
            (C {(write_py_files)})
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(bazel)} {(run)} {(//py) (Lit_Other ":") (test)}]
                  redirects: [
                    (Redir
                      op_id: Redir_GreatAnd
                      fd: -1
                      arg_word: {($ VSub_Name "$TEST_log")}
                      spids: [362]
                    )
                  ]
                )
                (C {(fail)} {(DQ ("Expected success"))})
              ]
              op_id: Op_DPipe
            )
            (C {(expect_log_once)} {(SQ <"Hello, Python World">)})
          ]
          spids: [348]
        )
      spids: [342 347]
    )
    (FuncDef
      name: test_runfiles_present_cc_binary
      body: 
        (BraceGroup
          children: [
            (C {(write_cc_source_files)})
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {(cc/hello_kitty.txt)}
                  spids: [411]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: {(DQ ("Hello, kitty.\n"))}
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [415]
                )
              ]
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(bazel)} {(run)} {(--nobuild_runfile_links)} {(//cc) (Lit_Other ":") (kitty)}]
                  redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(output)} spids:[431])]
                )
                (C {(fail)} {(DQ (${ VSub_Name PRODUCT_NAME) (" run failed."))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (C {(assert_contains)} {(DQ ("Hello, kitty"))} {(output)})
                (C {(fail)} {(DQ ("Output is not OK."))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(bazel)} {(run)} {(--nobuild_runfile_links)} {(//cc) (Lit_Other ":") (kitty)}]
                  redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(output2)} spids:[477])]
                )
                (C {(fail)} {(DQ ("Second ") (${ VSub_Name PRODUCT_NAME) (" run failed."))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (C {(assert_contains)} {(DQ ("Hello, kitty"))} {(output2)})
                (C {(fail)} {(DQ ("Output is not OK."))})
              ]
              op_id: Op_DPipe
            )
          ]
          spids: [390]
        )
      spids: [384 389]
    )
    (FuncDef
      name: test_runfiles_updated_correctly_with_nobuild_runfile_links
      body: 
        (BraceGroup
          children: [
            (C {(write_cc_source_files)})
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {(cc/hello_kitty.txt)}
                  spids: [528]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: {(DQ ("Hello, kitty.\n"))}
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [532]
                )
              ]
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(bazel)} {(run)} {(--nobuild_runfile_links)} {(//cc) (Lit_Other ":") (kitty)}]
                  redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(output)} spids:[548])]
                )
                (C {(fail)} {(DQ (${ VSub_Name PRODUCT_NAME) (" run failed."))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (C {(assert_contains)} {(DQ ("Hello, kitty"))} {(output)})
                (C {(fail)} {(DQ ("Output is not OK."))})
              ]
              op_id: Op_DPipe
            )
            (C {(rm)} {(cc/hello_kitty.txt)})
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {(cc/pussycat.txt)}
                  spids: [591]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: {(DQ ("A pussycat.\n"))}
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [595]
                )
              ]
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(bazel)} {(run)} {(--nobuild_runfile_links)} {(//cc) (Lit_Other ":") (kitty)}]
                  redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(output)} spids:[611])]
                )
                (C {(fail)} {(DQ (${ VSub_Name PRODUCT_NAME) (" run failed."))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (C {(assert_contains)} {(DQ (pussycat))} {(output)})
                (C {(fail)} {(DQ ("Output is not OK."))})
              ]
              op_id: Op_DPipe
            )
          ]
          spids: [519]
        )
      spids: [515 518]
    )
    (FuncDef
      name: test_script_file_generation
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [(C {(mkdir)} {(-p)} {(fubar)}) (C {(fail)} {(DQ ("mkdir fubar failed"))})]
              op_id: Op_DPipe
            )
            (SimpleCommand
              words: [{(echo)} {(SQ <"sh_binary(name = \"fubar\", srcs = [\"fubar.sh\"])">)}]
              redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(fubar/BUILD)} spids:[676])]
            )
            (SimpleCommand
              words: [{(echo)} {(SQ <"for t in \"$@\"; do echo \"arg: $t\"; done">)}]
              redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(fubar/fubar.sh)} spids:[687])]
            )
            (C {(chmod)} {(Lit_Other "+") (x)} {(fubar/fubar.sh)})
            (AndOr
              children: [
                (C {(bazel)} {(run)} 
                  {(--script_path) (Lit_Other "=") 
                    (CommandSubPart
                      command_list: (CommandList children:[(C {(pwd)})])
                      left_token: <Left_CommandSub "$(">
                      spids: [707 709]
                    ) (/fubar/output.sh)
                  } {(//fubar)}
                )
                (C {(fail)} {(DQ (${ VSub_Name PRODUCT_NAME) (" run failed (--script_path)."))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (C {(grep)} 
                  {
                    (DQ ("fubar ") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) 
                      (EscapedLiteralPart token:<Lit_EscapedChar "\\$">) (EscapedLiteralPart token:<Lit_EscapedChar "\\@">) (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">)
                    )
                  } {(./fubar/output.sh)}
                )
                (C {(fail)} 
                  {(DQ (${ VSub_Name PRODUCT_NAME) (" run --script_path output was incorrect."))}
                )
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [
                    {
                      (CommandSubPart
                        command_list: (CommandList children:[(C {(pwd)})])
                        left_token: <Left_CommandSub "$(">
                        spids: [755 757]
                      ) (/fubar/output.sh)
                    }
                    {(a)}
                    {(DQ ("b c"))}
                    {(d)}
                  ]
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: -1
                      arg_word: {(./fubar/fubar.output)}
                      spids: [768]
                    )
                  ]
                )
                (C {(fail)} {(DQ ("Generated script exited with an error."))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (C {(grep)} {(DQ ("arg: b c"))} {(./fubar/fubar.output)})
                (C {(fail)} {(DQ ("Generated script did not handle arguments correctly."))})
              ]
              op_id: Op_DPipe
            )
          ]
          spids: [652]
        )
      spids: [648 651]
    )
    (FuncDef
      name: test_consistent_command_line_encoding
      body: 
        (BraceGroup
          children: [
            (ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})
            (AndOr
              children: [
                (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$PLATFORM"))} {(KW_Bang "!") (Lit_Other "=")} 
                  {(DQ (darwin))} {(Lit_Other "]")}
                )
                (C {(warn)} {(DQ ("test disabled on darwin, see Github issue 1766"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$PLATFORM"))} {(KW_Bang "!") (Lit_Other "=")} 
                  {(DQ (darwin))} {(Lit_Other "]")}
                )
                (ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})
              ]
              op_id: Op_DPipe
            )
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:arg)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (C {(echo)} {(-e)} 
                                {
                                  (SQ 
                                    <
"\\xC3\\xA4\\xC3\\xB6\\xC3\\xBC\\xC3\\x84\\xC3\\x96\\xC3\\x9C\\xC3\\x9F"
                                    >
                                  )
                                }
                              )
                            ]
                          )
                        left_token: <Left_CommandSub "$(">
                        spids: [883 891]
                      )
                    }
                  spids: [882]
                )
              ]
              spids: [880]
            )
            (AndOr
              children: [(C {(mkdir)} {(-p)} {(foo)}) (C {(fail)} {(DQ ("mkdir foo failed"))})]
              op_id: Op_DPipe
            )
            (SimpleCommand
              words: [{(echo)} {(SQ <"sh_binary(name = \"foo\", srcs = [\"foo.sh\"])">)}]
              redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(foo/BUILD)} spids:[916])]
            )
            (SimpleCommand
              words: [{(echo)} {(SQ <"sh_test(name = \"foo_test\", srcs = [\"foo.sh\"])">)}]
              redirects: [(Redir op_id:Redir_DGreat fd:-1 arg_word:{(foo/BUILD)} spids:[927])]
            )
            (SimpleCommand
              words: [{(echo)} {(SQ <"test \"$1\" = \"">) (DQ ($ VSub_Name "$arg")) (SQ <"\"">)}]
              redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(foo/foo.sh)} spids:[944])]
            )
            (C {(chmod)} {(Lit_Other "+") (x)} {(foo/foo.sh)})
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(bazel)} {(run)} {(//foo)} {(--)} {(DQ ($ VSub_Name "$arg"))}]
                  redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(output)} spids:[970])]
                )
                (C {(fail)} {(DQ (${ VSub_Name PRODUCT_NAME) (" run failed."))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (C {(bazel)} {(test)} {(//foo) (Lit_Other ":") (foo_test)} 
                  {(--test_arg) (Lit_Other "=") (DQ ($ VSub_Name "$arg"))}
                )
                (C {(fail)} {(DQ (${ VSub_Name PRODUCT_NAME) (" test failed"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(bazel)} {(--batch)} {(run)} {(//foo)} {(--)} {(DQ ($ VSub_Name "$arg"))}]
                  redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(output)} spids:[1032])]
                )
                (C {(fail)} {(DQ (${ VSub_Name PRODUCT_NAME) (" run failed (--batch)."))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (C {(bazel)} {(--batch)} {(test)} {(//foo) (Lit_Other ":") (foo_test)} 
                  {(--test_arg) (Lit_Other "=") (DQ ($ VSub_Name "$arg"))}
                )
                (C {(fail)} {(DQ (${ VSub_Name PRODUCT_NAME) (" test failed (--batch)"))})
              ]
              op_id: Op_DPipe
            )
          ]
          spids: [808]
        )
      spids: [804 807]
    )
    (FuncDef
      name: test_interrupt_kills_child
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [(C {(mkdir)} {(-p)} {(foo)}) (C {(fail)} {(DQ ("mkdir foo failed"))})]
              op_id: Op_DPipe
            )
            (C {(rm)} {(-f)} {(/tmp/sleep-minute-pipe)})
            (AndOr
              children: [
                (C {(mkfifo)} {(/tmp/sleep-minute-pipe)})
                (C {(fail)} {(DQ ("make pipe failed"))})
              ]
              op_id: Op_DPipe
            )
            (SimpleCommand
              words: [
                {(echo)}
                {(SQ <"sh_binary(name = \"sleep-minute\", srcs = [\"sleep-minute.sh\"])">)}
              ]
              redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(foo/BUILD)} spids:[1132])]
            )
            (SimpleCommand
              words: [
                {(echo)}
                {(-e)}
                {(DQ ("#!/bin/bash") (EscapedLiteralPart token:<Lit_EscapedChar "\\n">)) 
                  (SQ <"echo $$ >/tmp/sleep-minute-pipe">) (DQ (EscapedLiteralPart token:<Lit_EscapedChar "\\n">)) (SQ <"sleep 60">)
                }
              ]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {(foo/sleep-minute.sh)}
                  spids: [1155]
                )
              ]
            )
            (C {(chmod)} {(Lit_Other "+") (x)} {(foo/sleep-minute.sh)})
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:serverpid)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: (CommandList children:[(C {(bazel)} {(info)} {(server_pid)})])
                        left_token: <Left_CommandSub "$(">
                        spids: [1179 1185]
                      )
                    }
                  spids: [1178]
                )
              ]
              spids: [1176]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(Lit_Other "[")} {(-z)} {($ VSub_Name "$serverpid")} {(Lit_Other "]")})
                      terminator: <Op_Semi ";">
                    )
                  ]
                  action: [
                    (C {(fail)} {(DQ ("Couldn't get ") (${ VSub_Name PRODUCT_NAME) (" server PID"))})
                  ]
                  spids: [-1 1199]
                )
              ]
              spids: [-1 1213]
            )
            (Sentence
              child: 
                (Subshell
                  child: 
                    (AndOr
                      children: [
                        (C {(bazel)} {(run)} {(//foo) (Lit_Other ":") (sleep-minute)})
                        (C {(true)})
                      ]
                      op_id: Op_DPipe
                    )
                  spids: [1216 1228]
                )
              terminator: <Op_Amp "&">
            )
            (Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(LhsName name:sleeppid) op:Equal spids:[1235])]
              spids: [1233]
            )
            (SimpleCommand
              words: [{(read)} {(sleeppid)}]
              redirects: [
                (Redir
                  op_id: Redir_Less
                  fd: -1
                  arg_word: {(/tmp/sleep-minute-pipe)}
                  spids: [1242]
                )
              ]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: (C {(Lit_Other "[")} {(-z)} {($ VSub_Name "$sleeppid")} {(Lit_Other "]")})
                      terminator: <Op_Semi ";">
                    )
                  ]
                  action: [
                    (C {(fail)} {(DQ (${ VSub_Name PRODUCT_NAME) (" run did not invoke shell script"))})
                  ]
                  spids: [-1 1257]
                )
              ]
              spids: [-1 1270]
            )
            (C {(kill)} {(-SIGINT)} {($ VSub_Name "$serverpid")})
            (ForEach
              iter_name: i
              iter_words: [{(0.25)} {(0.5)} {(1)} {(2)}]
              do_arg_iter: False
              body: 
                (DoGroup
                  children: [
                    (C {(sleep)} {($ VSub_Name "$i")})
                    (AndOr
                      children: [
                        (SimpleCommand
                          words: [{(kill)} {(-0)} {($ VSub_Name "$sleeppid")}]
                          redirects: [
                            (Redir
                              op_id: Redir_Great
                              fd: 2
                              arg_word: {(/dev/null)}
                              spids: [1318]
                            )
                          ]
                        )
                        (ControlFlow
                          token: <ControlFlow_Return return>
                          arg_word: {(0)}
                        )
                      ]
                      op_id: Op_DPipe
                    )
                  ]
                  spids: [1304 1329]
                )
              spids: [1294 1302]
            )
            (C {(fail)} {(DQ ("Shell script still running after SIGINT sent to server"))})
          ]
          spids: [1088]
        )
      spids: [1082 1087]
    )
    (FuncDef
      name: test_no_color_on_failed_run
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [(C {(mkdir)} {(-p)} {(x)}) (C {(fail)} {(DQ ("mkdir failed"))})]
              op_id: Op_DPipe
            )
            (SimpleCommand
              words: [{(echo)} {(DQ ("cc_binary(name = 'x', srcs = ['x.cc'])"))}]
              redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(x/BUILD)} spids:[1374])]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir op_id:Redir_Great fd:-1 arg_word:{(x/x.cc)} spids:[1381])
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("int main(int, char**) {\n") ("  // Missing semicolon\n") ("  return 0\n") 
                        ("}\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [1385]
                )
              ]
            )
            (Sentence
              child: (C {(bazel)} {(run)} {(//x) (Lit_Other ":") (x)})
              terminator: <Op_Amp "&">
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(--color) (Lit_Other "=") (no)}]
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: -1
                      arg_word: {($ VSub_Name "$TEST_log")}
                      spids: [1403]
                    )
                  ]
                )
                (C {(fail)} {(DQ ("expected failure"))})
              ]
              op_id: Op_DAmp
            )
            (C {(cat)} {($ VSub_Name "$TEST_log")})
            (C {(expect_log)} {(DQ ("expected ';'"))})
            (AndOr
              children: [
                (C {(grep)} 
                  {
                    (CommandSubPart
                      command_list: (CommandList children:[(C {(echo)} {(-e)} {(SQ <"\\x1b">)})])
                      left_token: <Left_CommandSub "$(">
                      spids: [1441 1449]
                    )
                  } {($ VSub_Name "$TEST_log")}
                )
                (C {(fail)} {(DQ ("Expected colorless output"))})
              ]
              op_id: Op_DAmp
            )
            (C {(true)})
          ]
          spids: [1350]
        )
      spids: [1344 1349]
    )
    (FuncDef
      name: test_no_ansi_stripping_in_stdout_or_stderr
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [(C {(mkdir)} {(-p)} {(x)}) (C {(fail)} {(DQ ("mkdir failed"))})]
              op_id: Op_DPipe
            )
            (SimpleCommand
              words: [{(echo)} {(DQ ("cc_binary(name = 'x', srcs = ['x.cc'])"))}]
              redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(x/BUILD)} spids:[1498])]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir op_id:Redir_Great fd:-1 arg_word:{(x/x.cc)} spids:[1505])
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("#include <unistd.h>\n") ("int main(int, char**) {\n") 
                        (
"  const char out[] = {'<', 0x1B, '[', 'a', ',', 0x1B, '[', '1', '>', 0x0A};\n"
                        ) ("  const char err[] = {'<', 0x1B, '[', 'b', ',', 0x1B, '[', '2', '>', 0x0A};\n") 
                        ("  write(1, out, 10);\n") ("  write(2, err, 10);\n") ("  return 0;\n") ("}\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [1509]
                )
              ]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:out1color)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: (CommandList children:[(C {(mktemp)} {(x/XXXXXX)})])
                        left_token: <Left_CommandSub "$(">
                        spids: [1522 1526]
                      )
                    }
                  spids: [1521]
                )
              ]
              spids: [1521]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:out1nocolor)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: (CommandList children:[(C {(mktemp)} {(x/XXXXXX)})])
                        left_token: <Left_CommandSub "$(">
                        spids: [1530 1534]
                      )
                    }
                  spids: [1529]
                )
              ]
              spids: [1529]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:out2)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: (CommandList children:[(C {(mktemp)} {(x/XXXXXX)})])
                        left_token: <Left_CommandSub "$(">
                        spids: [1538 1542]
                      )
                    }
                  spids: [1537]
                )
              ]
              spids: [1537]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:err1raw_color)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: (CommandList children:[(C {(mktemp)} {(x/XXXXXX)})])
                        left_token: <Left_CommandSub "$(">
                        spids: [1546 1550]
                      )
                    }
                  spids: [1545]
                )
              ]
              spids: [1545]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:err1raw_nocolor)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: (CommandList children:[(C {(mktemp)} {(x/XXXXXX)})])
                        left_token: <Left_CommandSub "$(">
                        spids: [1554 1558]
                      )
                    }
                  spids: [1553]
                )
              ]
              spids: [1553]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:err1color)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: (CommandList children:[(C {(mktemp)} {(x/XXXXXX)})])
                        left_token: <Left_CommandSub "$(">
                        spids: [1562 1566]
                      )
                    }
                  spids: [1561]
                )
              ]
              spids: [1561]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:err1nocolor)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: (CommandList children:[(C {(mktemp)} {(x/XXXXXX)})])
                        left_token: <Left_CommandSub "$(">
                        spids: [1570 1574]
                      )
                    }
                  spids: [1569]
                )
              ]
              spids: [1569]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:err2)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: (CommandList children:[(C {(mktemp)} {(x/XXXXXX)})])
                        left_token: <Left_CommandSub "$(">
                        spids: [1578 1582]
                      )
                    }
                  spids: [1577]
                )
              ]
              spids: [1577]
            )
            (C {(add_to_bazelrc)} {(common)} {(--show_progress_rate_limit) (Lit_Other "=") (0.03)})
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(bazel)} {(run)} {(//x) (Lit_Other ":") (x)} {(--color) (Lit_Other "=") (yes)}]
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: -1
                      arg_word: {($ VSub_Name "$out1color")}
                      spids: [1611]
                    )
                    (Redir
                      op_id: Redir_Great
                      fd: 2
                      arg_word: {($ VSub_Name "$err1raw_color")}
                      spids: [1614]
                    )
                  ]
                )
                (C {(fail)} {(DQ ("expected success"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(bazel)} {(run)} {(//x) (Lit_Other ":") (x)} {(--color) (Lit_Other "=") (no)}]
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: -1
                      arg_word: {($ VSub_Name "$out1nocolor")}
                      spids: [1638]
                    )
                    (Redir
                      op_id: Redir_Great
                      fd: 2
                      arg_word: {($ VSub_Name "$err1raw_nocolor")}
                      spids: [1641]
                    )
                  ]
                )
                (C {(fail)} {(DQ ("expected success"))})
              ]
              op_id: Op_DPipe
            )
            (SimpleCommand
              words: [{(${ VSub_Name PRODUCT_NAME) (-bin/x/x)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$out2")}
                  spids: [1659]
                )
                (Redir
                  op_id: Redir_Great
                  fd: 2
                  arg_word: {($ VSub_Name "$err2")}
                  spids: [1662]
                )
              ]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:bazel_stderr_line_count_color)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (Pipeline
                                children: [
                                  (C {(cat)} {($ VSub_Name "$err1raw_color")})
                                  (C {(grep)} {(-n)} {(DQ ("Running command line: .*/x/x"))})
                                  (C {(awk)} {(-F)} {(SQ <":">)} {(SQ <"{print $1}">)})
                                ]
                                negated: False
                              )
                            ]
                          )
                        left_token: <Left_CommandSub "$(">
                        spids: [1676 1708]
                      )
                    }
                  spids: [1675]
                )
              ]
              spids: [1675]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:start)
                  op: Equal
                  rhs: 
                    {
                      (ArithSubPart
                        anode: 
                          (ArithBinary
                            op_id: Arith_Plus
                            left: (ArithWord w:{($ VSub_Name "$bazel_stderr_line_count_color")})
                            right: (ArithWord w:{(Lit_Digits 1)})
                          )
                        spids: [1712 1717]
                      )
                    }
                  spids: [1711]
                )
              ]
              spids: [1711]
            )
            (Pipeline
              children: [
                (C {(tail)} {(-n)} {(Lit_Other "+") ($ VSub_Name "$start")} 
                  {($ VSub_Name "$err1raw_color")}
                )
                (SimpleCommand
                  words: [{(sed)} {(-e)} {(SQ <"s/.\\[0m$//">)}]
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: -1
                      arg_word: {($ VSub_Name "$err1color")}
                      spids: [1739]
                    )
                  ]
                )
              ]
              negated: False
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:bazel_stderr_line_count_nocolor)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (Pipeline
                                children: [
                                  (C {(cat)} {($ VSub_Name "$err1raw_nocolor")})
                                  (C {(grep)} {(-n)} {(DQ ("Running command line: .*/x/x"))})
                                  (C {(awk)} {(-F)} {(SQ <":">)} {(SQ <"{print $1}">)})
                                ]
                                negated: False
                              )
                            ]
                          )
                        left_token: <Left_CommandSub "$(">
                        spids: [1745 1777]
                      )
                    }
                  spids: [1744]
                )
              ]
              spids: [1744]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:start)
                  op: Equal
                  rhs: 
                    {
                      (ArithSubPart
                        anode: 
                          (ArithBinary
                            op_id: Arith_Plus
                            left: (ArithWord w:{($ VSub_Name "$bazel_stderr_line_count_nocolor")})
                            right: (ArithWord w:{(Lit_Digits 1)})
                          )
                        spids: [1781 1786]
                      )
                    }
                  spids: [1780]
                )
              ]
              spids: [1780]
            )
            (SimpleCommand
              words: [
                {(tail)}
                {(-n)}
                {(Lit_Other "+") ($ VSub_Name "$start")}
                {($ VSub_Name "$err1raw_nocolor")}
              ]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {($ VSub_Name "$err1nocolor")}
                  spids: [1798]
                )
              ]
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(diff)} {($ VSub_Name "$out1color")} {($ VSub_Name "$out2")}]
                  redirects: [
                    (Redir
                      op_id: Redir_GreatAnd
                      fd: -1
                      arg_word: {($ VSub_Name "$TEST_log")}
                      spids: [1809]
                    )
                  ]
                )
                (C {(fail)} {(DQ ("stdout with --color=yes differs"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(diff)} {($ VSub_Name "$out1nocolor")} {($ VSub_Name "$out2")}]
                  redirects: [
                    (Redir
                      op_id: Redir_GreatAnd
                      fd: -1
                      arg_word: {($ VSub_Name "$TEST_log")}
                      spids: [1827]
                    )
                  ]
                )
                (C {(fail)} {(DQ ("stdout with --color=no differs"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(diff)} {($ VSub_Name "$err1color")} {($ VSub_Name "$err2")}]
                  redirects: [
                    (Redir
                      op_id: Redir_GreatAnd
                      fd: -1
                      arg_word: {($ VSub_Name "$TEST_log")}
                      spids: [1845]
                    )
                  ]
                )
                (C {(fail)} {(DQ ("stderr with --color=yes differs"))})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(diff)} {($ VSub_Name "$err1nocolor")} {($ VSub_Name "$err2")}]
                  redirects: [
                    (Redir
                      op_id: Redir_GreatAnd
                      fd: -1
                      arg_word: {($ VSub_Name "$TEST_log")}
                      spids: [1863]
                    )
                  ]
                )
                (C {(fail)} {(DQ ("stderr with --color=no differs"))})
              ]
              op_id: Op_DPipe
            )
            (C {(rm)} {(-rf)} {(x)})
          ]
          spids: [1474]
        )
      spids: [1468 1473]
    )
    (FuncDef
      name: test_location_in_args
      body: 
        (BraceGroup
          children: [
            (C {(mkdir)} {(-p)} {(some/testing)})
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {(some/testing/BUILD)}
                  spids: [1906]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {("genrule(\n") ("    name = \"generated\",\n") ("    cmd = \"echo 2 > $@\",\n") 
                      ("    outs = [\"generated.txt\"],\n") (")\n") ("\n") ("sh_binary(\n") ("    name = \"testing\",\n") ("    srcs = [\"test.sh\"],\n") 
                      ("    data = [\"data\", \":generated\"],\n") ("    args = [\"$(location :data)\", \"$(location :generated)\"],\n") (")\n")
                    }
                  do_expansion: False
                  here_end: EOF
                  was_filled: True
                  spids: [1910]
                )
              ]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir
                  op_id: Redir_Great
                  fd: -1
                  arg_word: {(some/testing/test.sh)}
                  spids: [1919]
                )
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {("#!/bin/bash\n") ("set -ex\n") ("echo \"Got $@\"\n") ("i=1\n") 
                      ("for arg in $@; do\n") ("  [[ $((i++)) = $(cat $arg) ]]\n") ("done\n")
                    }
                  do_expansion: False
                  here_end: EOF
                  was_filled: True
                  spids: [1923]
                )
              ]
            )
            (C {(chmod)} {(Lit_Other "+") (x)} {(some/testing/test.sh)})
            (SimpleCommand
              words: [{(echo)} {(DQ (1))}]
              redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(some/testing/data)} spids:[1944])]
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(bazel)} {(run)} {(//some/testing)}]
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: -1
                      arg_word: {($ VSub_Name "$TEST_log")}
                      spids: [1963]
                    )
                  ]
                )
                (C {(fail)} {(DQ ("Expected success"))})
              ]
              op_id: Op_DPipe
            )
            (C {(expect_log)} {(DQ ("Got .*some/testing/data.*some/testing/generated.txt"))})
          ]
          spids: [1894]
        )
      spids: [1888 1893]
    )
    (FuncDef
      name: test_run_for_alias
      body: 
        (BraceGroup
          children: [
            (C {(mkdir)} {(-p)} {(a)})
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir op_id:Redir_Great fd:-1 arg_word:{(a/BUILD)} spids:[2002])
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {(DQ ("sh_binary(name='a', srcs=['a.sh'])\n") ("alias(name='b', actual='a')\n"))}
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [2006]
                )
              ]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (Redir op_id:Redir_Great fd:-1 arg_word:{(a/a.sh)} spids:[2015])
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("#!/bin/bash\n") ("echo ") (Right_DoubleQuote "\"") ("Dancing with wolves") 
                        (Right_DoubleQuote "\"") ("\n") ("exit 0\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [2019]
                )
              ]
            )
            (C {(chmod)} {(Lit_Other "+") (x)} {(a/a.sh)})
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(bazel)} {(run)} {(//a) (Lit_Other ":") (b)}]
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: -1
                      arg_word: {(DQ ($ VSub_Name "$TEST_log"))}
                      spids: [2047]
                    )
                  ]
                )
                (C {(fail)} {(DQ ("Expected success"))})
              ]
              op_id: Op_DPipe
            )
            (C {(expect_log)} {(DQ ("Dancing with wolves"))})
          ]
          spids: [1990]
        )
      spids: [1984 1989]
    )
    (C {(run_suite)} {(DQ ("'") (${ VSub_Name PRODUCT_NAME) (" run' integration tests"))})
  ]
)