(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 {(source)} {(test/common.sh)})
    (C {(export)} {(Id.Lit_VarLike 'PYTHONPATH=') (.)})
    (command.ShFunction
      name: unit
      body: (command.BraceGroup children:[(C {(DQ ($ Id.VSub_At '$@'))})])
    )
    (command.ShFunction
      name: delete-pyc
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (command.Pipeline
                  children: [
                    (C {(find)} {(.)} {(-name)} {(SQ (Token id:Id.Lit_Chars val:'*.pyc' span_id:103))})
                    (C {(xargs)} {(--no-run-if-empty)} {(--)} {(rm)})
                  ]
                  negated: F
                )
                (C {(true)})
              ]
            )
          ]
        )
    )
    (C {(readonly)} 
      {(Id.Lit_VarLike 'PY_273=') (Id.Lit_TildeLike '~') (/src/languages/Python-2.7.3/python)}
    )
    (C {(readonly)} 
      {(Id.Lit_VarLike 'PY_272=') (Id.Lit_TildeLike '~') (/src/languages/Python-2.7.2/python)}
    )
    (C {(readonly)} 
      {(Id.Lit_VarLike 'PY_27=') (Id.Lit_TildeLike '~') (/src/languages/Python-2.7/python)}
    )
    (command.ShFunction
      name: banner
      body: 
        (command.BraceGroup
          children: [(C {(echo)} {(-----)}) (C {(echo)} {(DQ ($ Id.VSub_At '$@'))}) (C {(echo)} {(----)})]
        )
    )
    (command.ShFunction
      name: tests-to-run
      body: 
        (command.BraceGroup
          children: [
            (command.ForEach
              iter_name: t
              iter_words: [
                (word.BracedTree
                  parts: [
                    (word_part.BracedTuple
                      words: [{(build)} {(test)} {(native)} {(asdl)} {(core)} {(osh)} {(test)} {(tools)}]
                    )
                    (/)
                    (Id.Lit_Star '*')
                    (_test.py)
                  ]
                )
              ]
              do_arg_iter: F
              body: 
                (command.DoGroup
                  children: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.AndOr
                                  ops: [Id.Op_DAmp]
                                  children: [
                                    (C {(test)} {($ Id.VSub_DollarName '$t')} {(Id.Lit_Equals '=')} 
                                      {
                                        (SQ 
                                          (Token
                                            id: Id.Lit_Chars
                                            val: native/fastlex_test.py
                                            span_id: 234
                                          )
                                        )
                                      }
                                    )
                                    (command.Pipeline
                                      children: [
                                        (C {(test)} {(-e)} 
                                          {(SQ (Token id:Id.Lit_Chars val:fastlex.so span_id:246))}
                                        )
                                      ]
                                      negated: T
                                    )
                                  ]
                                )
                              terminator: (Token id:Id.Op_Semi val:';' span_id:248)
                            )
                          ]
                          action: [
                            (command.ControlFlow
                              token: (Token id:Id.ControlFlow_Continue val:continue span_id:253)
                            )
                          ]
                          spids: [225 250]
                        )
                      ]
                    )
                    (C {(echo)} {($ Id.VSub_DollarName '$t')})
                  ]
                )
            )
          ]
        )
    )
    (command.ShFunction
      name: run-test-and-maybe-abort
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(Id.Lit_VarLike 't=') ($ Id.VSub_Number '$1')})
            (C {(echo)})
            (C {(echo)} {(DQ ('[') ($ Id.VSub_DollarName '$t') (']'))})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.Pipeline
                          children: [
                            (command.Simple
                              words: [{($ Id.VSub_DollarName '$t')}]
                              redirects: [
                                (redir.Redir
                                  op: (Token id:Id.Redir_Great val:'>' span_id:303)
                                  fd: -1
                                  arg_word: {(/dev/null)}
                                )
                              ]
                            )
                          ]
                          negated: T
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:305)
                    )
                  ]
                  action: [
                    (C {(echo)})
                    (C {(echo)} {(DQ ('*** ') ($ Id.VSub_DollarName '$t') (' FAILED ***'))})
                    (C {(echo)})
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:325)
                      arg_word: {(255)}
                    )
                  ]
                  spids: [297 307]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: all
      body: 
        (command.BraceGroup
          children: [
            (command.TimeBlock
              pipeline: 
                (command.Pipeline
                  children: [
                    (C {(tests-to-run)})
                    (C {(xargs)} {(-n)} {(1)} {(--)} {($ Id.VSub_Number '$0')} {(run-test-and-maybe-abort)})
                  ]
                  negated: F
                )
            )
            (C {(echo)})
            (C {(echo)} {(DQ ('All unit tests passed.'))})
          ]
        )
    )
    (command.ShFunction
      name: all-in-one
      body: 
        (command.BraceGroup
          children: [
            (command.Simple
              words: [
                {(python)}
                {(-m)}
                {(unittest)}
                {(discover)}
                {(--failfast)}
                {(--verbose)}
                {(--pattern)}
                {(SQ (Token id:Id.Lit_Chars val:'*_test.py' span_id:418))}
              ]
              more_env: [
                (env_pair
                  name: _OVM_RESOURCE_ROOT
                  val: {($ Id.VSub_DollarName '$PWD')}
                  spids: [398]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: run-test-and-log
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(Id.Lit_VarLike 'tasks_csv=') ($ Id.VSub_Number '$1')})
            (C {(local)} {(Id.Lit_VarLike 't=') ($ Id.VSub_Number '$2')})
            (C {(local)} {(Id.Lit_VarLike 'log=') (_tmp/unit/) ($ Id.VSub_DollarName '$t') (.txt)})
            (C {(mkdir)} {(-p)} 
              {
                (command_sub
                  left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:493)
                  command_list: 
                    (command.CommandList
                      children: [(C {(dirname)} {($ Id.VSub_DollarName '$log')})]
                    )
                )
              }
            )
            (command.Simple
              words: [
                {(benchmarks/time.py)}
                {(--out)}
                {($ Id.VSub_DollarName '$tasks_csv')}
                {(--field)}
                {($ Id.VSub_DollarName '$t')}
                {(--field)}
                {(DQ ($ Id.VSub_DollarName '$t') (.txt))}
                {(--)}
                {($ Id.VSub_DollarName '$t')}
              ]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_Great val:'>' span_id:526)
                  fd: -1
                  arg_word: {($ Id.VSub_DollarName '$log')}
                )
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:529)
                  fd: 2
                  arg_word: {(1)}
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: run-all-and-log
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(Id.Lit_VarLike 'out_dir=') (_tmp/unit)})
            (C {(mkdir)} {(-p)} {($ Id.VSub_DollarName '$out_dir')})
            (C {(rm)} {(-r)} {(-f)} {($ Id.VSub_DollarName '$out_dir') (/) (Id.Lit_Star '*')})
            (C {(local)} {(Id.Lit_VarLike 'tasks_csv=') ($ Id.VSub_DollarName '$out_dir') (/tasks.csv)})
            (C {(local)} {(Id.Lit_VarLike 'status=') (0)})
            (command.Simple
              words: [
                {(echo)}
                {(SQ (Token id:Id.Lit_Chars val:'status,elapsed_secs,test,test_HREF' span_id:594))}
              ]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_Great val:'>' span_id:597)
                  fd: -1
                  arg_word: {($ Id.VSub_DollarName '$tasks_csv')}
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (command.TimeBlock
                  pipeline: 
                    (command.Pipeline
                      children: [
                        (C {(tests-to-run)})
                        (C {(xargs)} {(-n)} {(1)} {(--)} {($ Id.VSub_Number '$0')} {(run-test-and-log)} 
                          {($ Id.VSub_DollarName '$tasks_csv')}
                        )
                      ]
                      negated: F
                    )
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:status)
                      op: assign_op.Equal
                      rhs: {(1)}
                      spids: [624]
                    )
                  ]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: (C {(test)} {($ Id.VSub_DollarName '$status')} {(-ne)} {(0)})
                      terminator: (Token id:Id.Op_Semi val:';' span_id:638)
                    )
                  ]
                  action: [
                    (C {(cat)} {($ Id.VSub_DollarName '$tasks_csv')})
                    (C {(echo)})
                    (C {(echo)} 
                      {
                        (DQ ('*** Some tests failed.  See ') ($ Id.VSub_DollarName '$tasks_csv') 
                          (' ***')
                        )
                      }
                    )
                    (C {(echo)})
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:664)
                      arg_word: {($ Id.VSub_DollarName '$status')}
                    )
                  ]
                  spids: [629 640]
                )
              ]
            )
            (C {(echo)})
            (C {(echo)} {(DQ ('All unit tests passed.'))})
          ]
        )
    )
    (C {(source)} {(benchmarks/common.sh)})
    (command.ShFunction
      name: print-report
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} 
              {(Id.Lit_VarLike 'in_dir=') 
                (braced_var_sub
                  token: (Token id:Id.VSub_Number val:1 span_id:713)
                  suffix_op: 
                    (suffix_op.Unary
                      op_id: Id.VTest_ColonHyphen
                      arg_word: {(_tmp) (Id.Lit_Slash /) (unit)}
                    )
                )
              }
            )
            (C {(local)} 
              {(Id.Lit_VarLike 'base_url=') (SQ (Token id:Id.Lit_Chars val:../../web span_id:725))}
            )
            (command.Simple
              words: [{(cat)}]
              redirects: [
                (redir.HereDoc
                  op: (Token id:Id.Redir_DLess val:'<<' span_id:736)
                  fd: -1
                  here_begin: {(EOF)}
                  here_end_span_id: 798
                  stdin_parts: [
                    ('<!DOCTYPE html>\n')
                    ('<html>\n')
                    ('  <head>\n')
                    ('    <title>Unit Test Results</title>\n')
                    ('    <script type=')
                    (Id.Right_DoubleQuote '"')
                    (text/javascript)
                    (Id.Right_DoubleQuote '"')
                    (' src=')
                    (Id.Right_DoubleQuote '"')
                    ($ Id.VSub_DollarName '$base_url')
                    (/table/table-sort.js)
                    (Id.Right_DoubleQuote '"')
                    ('></script>\n')
                    ('    <link rel=')
                    (Id.Right_DoubleQuote '"')
                    (stylesheet)
                    (Id.Right_DoubleQuote '"')
                    (' type=')
                    (Id.Right_DoubleQuote '"')
                    (text/css)
                    (Id.Right_DoubleQuote '"')
                    (' href=')
                    (Id.Right_DoubleQuote '"')
                    ($ Id.VSub_DollarName '$base_url')
                    (/table/table-sort.css)
                    (Id.Right_DoubleQuote '"')
                    (' />\n')
                    ('    <link rel=')
                    (Id.Right_DoubleQuote '"')
                    (stylesheet)
                    (Id.Right_DoubleQuote '"')
                    (' type=')
                    (Id.Right_DoubleQuote '"')
                    (text/css)
                    (Id.Right_DoubleQuote '"')
                    (' href=')
                    (Id.Right_DoubleQuote '"')
                    ($ Id.VSub_DollarName '$base_url')
                    (/benchmarks.css)
                    (Id.Right_DoubleQuote '"')
                    (' />\n')
                    ('\n')
                    ('  </head>\n')
                    ('  <body>\n')
                    ('    <p id=')
                    (Id.Right_DoubleQuote '"')
                    (home-link)
                    (Id.Right_DoubleQuote '"')
                    ('>\n')
                    ('      <a href=')
                    (Id.Right_DoubleQuote '"')
                    (/)
                    (Id.Right_DoubleQuote '"')
                    ('>oilshell.org</a>\n')
                    ('    </p>\n')
                    ('    <h2>Unit Test Results</h2>\n')
                    ('\n')
                  ]
                )
              ]
            )
            (C {(csv2html)} {($ Id.VSub_DollarName '$in_dir') (/report.csv)})
            (command.Simple
              words: [{(cat)}]
              redirects: [
                (redir.HereDoc
                  op: (Token id:Id.Redir_DLess val:'<<' span_id:809)
                  fd: -1
                  here_begin: {(EOF)}
                  here_end_span_id: 815
                  stdin_parts: [('  </body>\n') ('</html>\n')]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: write-report
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(Id.Lit_VarLike 'out=') (_tmp/unit/index.html)})
            (C {(test/report.R)} {(unit)} {(_tmp/unit)} {(_tmp/unit)})
            (command.Simple
              words: [{(print-report)}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_Great val:'>' span_id:863)
                  fd: -1
                  arg_word: {($ Id.VSub_DollarName '$out')}
                )
              ]
            )
            (C {(echo)} {(DQ ('Wrote ') ($ Id.VSub_DollarName '$out'))})
          ]
        )
    )
    (command.ShFunction
      name: run-for-release
      body: (command.BraceGroup children:[(C {(run-all-and-log)}) (C {(write-report)})])
    )
    (C {(DQ ($ Id.VSub_At '$@'))})
  ]
)