(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: <Id.VSub_Name OSH>
          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: <Id.Left_DollarParen '$('>
                        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:<Id.Redir_GreatAnd '1>&'> fd:1 arg_word:{<2>})]
            )
          ]
        )
    )
    (command.ShFunction
      name: die
      body: 
        (command.BraceGroup
          children: [
            (C {<log>} {(DQ ($ Id.VSub_At '$@'))})
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
        )
    )
    (command.ShFunction
      name: fail
      body: 
        (command.BraceGroup
          children: [
            (C {<echo>} {(SQ <'TEST FAILURE  '>)} {(DQ ($ Id.VSub_At '$@'))})
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> 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 <'%x %e'>)} {<-->} {(DQ ($ Id.VSub_At '$@'))}
                )
                (C {<true>})
              ]
            )
            (C {<sed>} {<-i>} {(SQ <'/Command exited with non-zero status/d'>)} 
              {($ 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 <'sleep 0.1; exit 1'>)})
                (C {<true>})
              ]
            )
            (C {<cat>} {<_tmp/status.txt>})
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {<test>} 
                  {
                    (DQ 
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        command_list: 
                          (command.CommandList
                            children: [
                              (command.Simple
                                words: [{<wc>} {<-l>}]
                                redirects: [
                                  (redir.Redir
                                    op: <Id.Redir_Less '<'>
                                    fd: -1
                                    arg_word: {<_tmp/status.txt>}
                                  )
                                ]
                              )
                            ]
                          )
                      )
                    )
                  } {<Id.Lit_Equals '='>} {(SQ <1>)}
                )
                (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: <Id.Left_DollarParen '$('>
                        command_list: 
                          (command.CommandList
                            children: [(C {<basename>} {($ Id.VSub_Number '$0')})]
                          )
                      )
                    )
                  } {<Id.Lit_Equals '='>} {(SQ <common.sh>)}
                )
              terminator: <Id.Op_Semi _>
            )
          ]
          action: [(C {(DQ ($ Id.VSub_At '$@'))})]
          spids: [375 394]
        )
      ]
    )
  ]
)