(command.CommandList
  children: [
    (C {(Id.KW_Set set)} {(-o)} {(nounset)})
    (C {(Id.KW_Set set)} {(-o)} {(pipefail)})
    (C {(Id.KW_Set set)} {(-o)} {(errexit)})
    (C {(readonly)} 
      {(Id.Lit_VarLike 'OSH=') 
        (braced_var_sub
          token: (Token id:Id.VSub_Name val:OSH span_id:42)
          suffix_op: 
            (suffix_op.Unary
              op_id: Id.VTest_ColonHyphen
              arg_word: {(bin) (Id.Lit_Slash /) (osh)}
            )
        )
      }
    )
    (C {(readonly)} 
      {(Id.Lit_VarLike 'JOBS=') 
        (word_part.ArithSub
          anode: 
            (arith_expr.Binary
              op_id: Id.Arith_Minus
              left: 
                (arith_expr.ArithWord
                  w: 
                    {
                      (command_sub
                        left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:58)
                        command_list: (command.CommandList children:[(C {(nproc)})])
                      )
                    }
                )
              right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)})
            )
        )
      }
    )
    (command.ShFunction
      name: log
      body: 
        (command.BraceGroup
          children: [
            (command.Simple
              words: [{(echo)} {(DQ ($ Id.VSub_At '$@'))}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'1>&' span_id:83)
                  fd: 1
                  arg_word: {(2)}
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: die
      body: 
        (command.BraceGroup
          children: [
            (C {(log)} {(DQ ($ Id.VSub_At '$@'))})
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Exit val:exit span_id:103)
              arg_word: {(1)}
            )
          ]
        )
    )
    (command.ShFunction
      name: fail
      body: 
        (command.BraceGroup
          children: [
            (C {(echo)} {(SQ (Token id:Id.Lit_Chars val:'TEST FAILURE  ' span_id:120))} 
              {(DQ ($ Id.VSub_At '$@'))}
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Exit val:exit span_id:128)
              arg_word: {(1)}
            )
          ]
        )
    )
    (command.ShFunction
      name: assert
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {(test)} {(DQ ($ Id.VSub_At '$@'))})
                (C {(die)} {(DQ ("'") ($ Id.VSub_At '$@') ("' failed"))})
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: run-task-with-status
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(Id.Lit_VarLike 'out_file=') ($ Id.VSub_Number '$1')})
            (C {(shift)})
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {(/usr/bin/env)} {(Id.KW_Time time)} {(--output)} {($ Id.VSub_DollarName '$out_file')} 
                  {(--format)} {(SQ (Token id:Id.Lit_Chars val:'%x %e' span_id:200))} {(--)} {(DQ ($ Id.VSub_At '$@'))}
                )
                (C {(true)})
              ]
            )
            (C {(sed)} {(-i)} 
              {(SQ (Token id:Id.Lit_Chars val:'/Command exited with non-zero status/d' span_id:241))} {($ Id.VSub_DollarName '$out_file')}
            )
          ]
        )
    )
    (command.ShFunction
      name: run-task-with-status-test
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {(run-task-with-status)} {(_tmp/status.txt)} {(sh)} {(-c)} 
                  {(SQ (Token id:Id.Lit_Chars val:'sleep 0.1; exit 1' span_id:274))}
                )
                (C {(true)})
              ]
            )
            (C {(cat)} {(_tmp/status.txt)})
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {(test)} 
                  {
                    (DQ 
                      (command_sub
                        left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:290)
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.Simple
                                words: [{(wc)} {(-l)}]
                                redirects: [
                                  (redir.Redir
                                    op: (Token id:Id.Redir_Less val:'<' span_id:295)
                                    fd: -1
                                    arg_word: {(_tmp/status.txt)}
                                  )
                                ]
                              )
                            ]
                          )
                      )
                    )
                  } {(Id.Lit_Equals '=')} {(SQ (Token id:Id.Lit_Chars val:1 span_id:304))}
                )
                (C {(die)} {(DQ ('Expected only one line'))})
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: run-all
      body: 
        (command.BraceGroup
          children: [
            (command.ForEach
              iter_name: t
              iter_words: [{(DQ ($ Id.VSub_At '$@'))}]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (C {($ Id.VSub_DollarName '$t')})
                    (C {(echo)} {(DQ ('OK  ') ($ Id.VSub_DollarName '$t'))})
                  ]
                )
            )
            (C {(echo)})
            (C {(echo)} {(DQ ('All ') ($ Id.VSub_Number '$0') (' tests passed.'))})
          ]
        )
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(test)} 
                  {
                    (DQ 
                      (command_sub
                        left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:380)
                        command_list: 
                          (command.CommandList
                            children: [(C {(basename)} {($ Id.VSub_Number '$0')})]
                          )
                      )
                    )
                  } {(Id.Lit_Equals '=')} {(SQ (Token id:Id.Lit_Chars val:common.sh span_id:390))}
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:392)
            )
          ]
          action: [(C {(DQ ($ Id.VSub_At '$@'))})]
          spids: [375 394]
        )
      ]
    )
  ]
)