(command.CommandList
  children: [
    (command.Simple
      words: [{<exec>}]
      redirects: [(redir.Redir op:<Id.Redir_GreatAnd '2>&'> fd:2 arg_word:{<1>})]
    )
    (C {<echo>} {(SQ <'exec ${PAGER:-/usr/bin/less} "$0" || exit 1'>)})
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DBracket
                  expr: 
                    (bool_expr.Binary
                      op_id: Id.BoolBinary_GlobNEqual
                      left: {(DQ ($ Id.VSub_DollarName '$TEST_SRCDIR'))}
                      right: {</> <Id.Lit_Other '*'>}
                    )
                )
              terminator: <Id.Op_Semi _>
            )
          ]
          action: [
            (C {<export>} 
              {<Id.Lit_VarLike 'TEST_SRCDIR='> 
                (DQ ($ Id.VSub_DollarName '$PWD') </> ($ Id.VSub_DollarName '$TEST_SRCDIR'))
              }
            )
          ]
          spids: [72 88]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DBracket
                  expr: 
                    (bool_expr.Binary
                      op_id: Id.BoolBinary_GlobNEqual
                      left: {(DQ ($ Id.VSub_DollarName '$JAVA_RUNFILES'))}
                      right: {</> <Id.Lit_Other '*'>}
                    )
                )
              terminator: <Id.Op_Semi _>
            )
          ]
          action: [
            (C {<export>} 
              {<Id.Lit_VarLike 'JAVA_RUNFILES='> 
                (DQ ($ Id.VSub_DollarName '$PWD') </> ($ Id.VSub_DollarName '$JAVA_RUNFILES'))
              }
            )
          ]
          spids: [102 118]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DBracket
                  expr: 
                    (bool_expr.Binary
                      op_id: Id.BoolBinary_GlobNEqual
                      left: {(DQ ($ Id.VSub_DollarName '$PYTHON_RUNFILES'))}
                      right: {</> <Id.Lit_Other '*'>}
                    )
                )
              terminator: <Id.Op_Semi _>
            )
          ]
          action: [
            (C {<export>} 
              {<Id.Lit_VarLike 'PYTHON_RUNFILES='> 
                (DQ ($ Id.VSub_DollarName '$PWD') </> ($ Id.VSub_DollarName '$PYTHON_RUNFILES'))
              }
            )
          ]
          spids: [132 148]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DBracket
                  expr: 
                    (bool_expr.Binary
                      op_id: Id.BoolBinary_GlobNEqual
                      left: {(DQ ($ Id.VSub_DollarName '$TEST_TMPDIR'))}
                      right: {</> <Id.Lit_Other '*'>}
                    )
                )
              terminator: <Id.Op_Semi _>
            )
          ]
          action: [
            (C {<export>} 
              {<Id.Lit_VarLike 'TEST_TMPDIR='> 
                (DQ ($ Id.VSub_DollarName '$PWD') </> ($ Id.VSub_DollarName '$TEST_TMPDIR'))
              }
            )
          ]
          spids: [162 178]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DBracket
                  expr: 
                    (bool_expr.Binary
                      op_id: Id.BoolBinary_GlobNEqual
                      left: {(DQ ($ Id.VSub_DollarName '$XML_OUTPUT_FILE'))}
                      right: {</> <Id.Lit_Other '*'>}
                    )
                )
              terminator: <Id.Op_Semi _>
            )
          ]
          action: [
            (C {<export>} 
              {<Id.Lit_VarLike 'XML_OUTPUT_FILE='> 
                (DQ ($ Id.VSub_DollarName '$PWD') </> ($ Id.VSub_DollarName '$XML_OUTPUT_FILE'))
              }
            )
          ]
          spids: [192 208]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.AndOr
                  ops: [Id.Op_DAmp]
                  children: [
                    (command.DBracket
                      expr: 
                        (bool_expr.Unary
                          op_id: Id.BoolUnary_n
                          child: 
                            {
                              (DQ 
                                (braced_var_sub
                                  token: <Id.VSub_Name TEST_TOTAL_SHARDS>
                                  suffix_op: (suffix_op.Unary op_id:Id.VTest_Plus arg_word:{<x>})
                                )
                              )
                            }
                        )
                    )
                    (command.DParen
                      child: 
                        (arith_expr.Binary
                          op_id: Id.Arith_NEqual
                          left: (arith_expr.VarRef token:<Id.Lit_ArithVarLike TEST_TOTAL_SHARDS>)
                          right: (arith_expr.ArithWord w:{<Id.Lit_Digits 0>})
                        )
                    )
                  ]
                )
              terminator: <Id.Op_Semi _>
            )
          ]
          action: [
            (C {<export>} 
              {<Id.Lit_VarLike 'GTEST_SHARD_INDEX='> (DQ (${ Id.VSub_Name TEST_SHARD_INDEX))}
            )
            (C {<export>} 
              {<Id.Lit_VarLike 'GTEST_TOTAL_SHARDS='> (DQ (${ Id.VSub_Name TEST_TOTAL_SHARDS))}
            )
          ]
          spids: [226 254]
        )
      ]
    )
    (C {<export>} {<Id.Lit_VarLike 'GTEST_TMP_DIR='> (DQ (${ Id.VSub_Name TEST_TMPDIR))})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:DIR)
          op: assign_op.Equal
          rhs: {(DQ ($ Id.VSub_DollarName '$TEST_SRCDIR'))}
          spids: [288]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:RUNFILES_MANIFEST_FILE)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName '$DIR') </MANIFEST>}
          spids: [293]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName '$RUNFILES_MANIFEST_ONLY'))} 
                  {<Id.Lit_RBracket ']'>}
                )
              terminator: <Id.Op_Semi _>
            )
          ]
          action: [
            (command.ShFunction
              name: rlocation
              body: 
                (command.BraceGroup
                  children: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.DBracket
                                  expr: 
                                    (bool_expr.Binary
                                      op_id: Id.BoolBinary_GlobEqual
                                      left: {(DQ ($ Id.VSub_Number '$1'))}
                                      right: {</> <Id.Lit_Other '*'>}
                                    )
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                          action: [(C {<echo>} {($ Id.VSub_Number '$1')})]
                          spids: [323 339]
                        )
                      ]
                      else_action: [
                        (C {<echo>} 
                          {
                            (DQ 
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (C {<dirname>} {($ Id.VSub_DollarName '$RUNFILES_MANIFEST_FILE')})
                                    ]
                                  )
                              ) </> ($ Id.VSub_Number '$1')
                            )
                          }
                        )
                      ]
                    )
                  ]
                )
            )
          ]
          spids: [298 311]
        )
      ]
      else_action: [
        (command.ShFunction
          name: rlocation
          body: 
            (command.BraceGroup
              children: [
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (command.Sentence
                          child: 
                            (command.DBracket
                              expr: 
                                (bool_expr.Binary
                                  op_id: Id.BoolBinary_GlobEqual
                                  left: {(DQ ($ Id.VSub_Number '$1'))}
                                  right: {</> <Id.Lit_Other '*'>}
                                )
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                      action: [(C {<echo>} {($ Id.VSub_Number '$1')})]
                      spids: [380 396]
                    )
                  ]
                  else_action: [
                    (C {<echo>} 
                      {
                        (command_sub
                          left_token: <Id.Left_DollarParen '$('>
                          command_list: 
                            (command.CommandList
                              children: [
                                (command.Pipeline
                                  children: [
                                    (C {<grep>} {(DQ <'^'> ($ Id.VSub_Number '$1') <' '>)} 
                                      {($ Id.VSub_DollarName '$RUNFILES_MANIFEST_FILE')}
                                    )
                                    (C {<awk>} {(SQ <'{ print $2 }'>)})
                                  ]
                                  negated: F
                                )
                              ]
                            )
                        )
                      }
                    )
                  ]
                )
              ]
            )
        )
      ]
    )
    (C {<export>} {<-f>} {<rlocation>})
    (C {<export>} {<RUNFILES_MANIFEST_FILE>})
    (command.If
      arms: [
        (if_arm
          cond: [
            (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-z>} 
              {(DQ ($ Id.VSub_DollarName '$TEST_WORKSPACE'))} {<Id.Lit_RBracket ']'>}
            )
          ]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:DIR)
                  op: assign_op.Equal
                  rhs: 
                    {(DQ ($ Id.VSub_DollarName '$DIR')) </> 
                      (DQ ($ Id.VSub_DollarName '$TEST_WORKSPACE'))
                    }
                  spids: [466]
                )
              ]
            )
          ]
          spids: [449 463]
        )
      ]
    )
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (C {<cd>} {(DQ ($ Id.VSub_DollarName '$DIR'))})
        (command.BraceGroup
          children: [
            (command.Sentence
              child: (C {<echo>} {(DQ <'Could not chdir '> ($ Id.VSub_DollarName '$DIR'))})
              terminator: <Id.Op_Semi _>
            )
            (command.Sentence
              child: (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
              terminator: <Id.Op_Semi _>
            )
          ]
        )
      ]
    )
    (C {<echo>} {(DQ <----------------------------------------------------------------------------->)})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:PATH)
          op: assign_op.Equal
          rhs: {(DQ <'.:'> ($ Id.VSub_DollarName '$PATH'))}
          spids: [535]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:TEST_NAME)
          op: assign_op.Equal
          rhs: {($ Id.VSub_Number '$1')}
          spids: [543]
        )
      ]
    )
    (C {<shift>})
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DBracket
                  expr: 
                    (bool_expr.Binary
                      op_id: Id.BoolBinary_GlobEqual
                      left: {(DQ ($ Id.VSub_DollarName '$TEST_NAME'))}
                      right: {</> <Id.Lit_Other '*'>}
                    )
                )
              terminator: <Id.Op_Semi _>
            )
          ]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:EXE)
                  op: assign_op.Equal
                  rhs: {(DQ (${ Id.VSub_Name TEST_NAME))}
                  spids: [568]
                )
              ]
            )
          ]
          spids: [549 565]
        )
      ]
      else_action: [
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:EXE)
              op: assign_op.Equal
              rhs: 
                {
                  (DQ 
                    (command_sub
                      left_token: <Id.Left_DollarParen '$('>
                      command_list: 
                        (command.CommandList
                          children: [
                            (C {<rlocation>} 
                              {($ Id.VSub_DollarName '$TEST_WORKSPACE') </> 
                                ($ Id.VSub_DollarName '$TEST_NAME')
                              }
                            )
                          ]
                        )
                    )
                  )
                }
              spids: [578]
            )
          ]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:exitCode)
          op: assign_op.Equal
          rhs: {<0>}
          spids: [592]
        )
      ]
    )
    (command.AndOr
      ops: [Id.Op_DPipe]
      children: [
        (C {(DQ (${ Id.VSub_Name EXE))} {(DQ ($ Id.VSub_At '$@'))})
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:exitCode)
              op: assign_op.Equal
              rhs: {($ Id.VSub_QMark '$?')}
              spids: [607]
            )
          ]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {<Id.Lit_LBracket '['>} {<-n>} 
                  {
                    (DQ 
                      (braced_var_sub
                        token: <Id.VSub_Name XML_OUTPUT_FILE>
                        suffix_op: (suffix_op.Unary op_id:Id.VTest_Hyphen arg_word:(word.Empty))
                      )
                    )
                  } {<-a>} {<Id.KW_Bang '!'>} {<-f>} 
                  {
                    (DQ 
                      (braced_var_sub
                        token: <Id.VSub_Name XML_OUTPUT_FILE>
                        suffix_op: (suffix_op.Unary op_id:Id.VTest_Hyphen arg_word:(word.Empty))
                      )
                    )
                  } {<Id.Lit_RBracket ']'>}
                )
              terminator: <Id.Op_Semi _>
            )
          ]
          action: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DParen
                          child: 
                            (arith_expr.Binary
                              op_id: Id.Arith_NEqual
                              left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$exitCode')})
                              right: (arith_expr.ArithWord w:{<Id.Lit_Digits 0>})
                            )
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:errors)
                          op: assign_op.Equal
                          rhs: {<1>}
                          spids: [664]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:error_msg)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (DQ <'<error message='> 
                                (word_part.EscapedLiteral
                                  token: <Id.Lit_EscapedChar '\\"'>
                                ) <'exited with error code '> ($ Id.VSub_DollarName '$exitCode') 
                                (word_part.EscapedLiteral
                                  token: <Id.Lit_EscapedChar '\\"'>
                                ) <'></error>'>
                              )
                            }
                          spids: [668]
                        )
                      ]
                    )
                  ]
                  spids: [647 661]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:errors)
                      op: assign_op.Equal
                      rhs: {<0>}
                      spids: [682]
                    )
                  ]
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:error_msg)
                      op: assign_op.Equal
                      rhs: (word.Empty)
                      spids: [686]
                    )
                  ]
                )
              ]
            )
            (command.Simple
              words: [{<cat>}]
              redirects: [
                (redir.HereDoc
                  op: <Id.Redir_DLess '<<'>
                  fd: -1
                  here_begin: {<EOF>}
                  here_end_span_id: 743
                  stdin_parts: [
                    <'<?xml version='>
                    <Id.Right_DoubleQuote '"'>
                    <1.0>
                    <Id.Right_DoubleQuote '"'>
                    <' encoding='>
                    <Id.Right_DoubleQuote '"'>
                    <UTF-8>
                    <Id.Right_DoubleQuote '"'>
                    <'?>\n'>
                    <'<testsuites>\n'>
                    <'  <testsuite name='>
                    <Id.Right_DoubleQuote '"'>
                    ($ Id.VSub_DollarName '$TEST_NAME')
                    <Id.Right_DoubleQuote '"'>
                    <' tests='>
                    <Id.Right_DoubleQuote '"'>
                    <1>
                    <Id.Right_DoubleQuote '"'>
                    <' failures='>
                    <Id.Right_DoubleQuote '"'>
                    <0>
                    <Id.Right_DoubleQuote '"'>
                    <' errors='>
                    <Id.Right_DoubleQuote '"'>
                    ($ Id.VSub_DollarName '$errors')
                    <Id.Right_DoubleQuote '"'>
                    <'>\n'>
                    <'    <testcase name='>
                    <Id.Right_DoubleQuote '"'>
                    ($ Id.VSub_DollarName '$TEST_NAME')
                    <Id.Right_DoubleQuote '"'>
                    <' status='>
                    <Id.Right_DoubleQuote '"'>
                    <run>
                    <Id.Right_DoubleQuote '"'>
                    <'>'>
                    ($ Id.VSub_DollarName '$error_msg')
                    <'</testcase>\n'>
                    <'  </testsuite>\n'>
                    <'</testsuites>\n'>
                  ]
                )
                (redir.Redir
                  op: <Id.Redir_Great '>'>
                  fd: -1
                  arg_word: {(${ Id.VSub_Name XML_OUTPUT_FILE)}
                )
              ]
            )
          ]
          spids: [611 640]
        )
      ]
    )
    (command.ControlFlow
      token: <Id.ControlFlow_Exit exit>
      arg_word: {($ Id.VSub_DollarName '$exitCode')}
    )
  ]
)