(CommandList
  children: [
    (C {(set)} {(-eu)})
    (Assignment
      keyword: Assign_Readonly
      pairs: [
        (assign_pair
          lhs: (LhsName name:ScriptDir)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [
                      (C {(dirname)} 
                        {
                          (DQ 
                            (CommandSubPart
                              command_list: 
                                (CommandList
                                  children: [
                                    (Pipeline
                                      children: [
                                        (C {(echo)} {($ VSub_Number "$0")})
                                        (C {(sed)} {(-e)} 
                                          {
                                            (DQ ("s,^") 
                                              (EscapedLiteralPart
                                                token: <Lit_EscapedChar "\\(">
                                              ) ("[^/]") (EscapedLiteralPart token:<Lit_EscapedChar "\\)">) (",") 
                                              (CommandSubPart
                                                command_list: (CommandList children:[(C {(pwd)})])
                                                left_token: <Left_CommandSub "$(">
                                                spids: [39 41]
                                              ) (/) (EscapedLiteralPart token:<Lit_EscapedChar "\\1">) (",")
                                            )
                                          }
                                        )
                                      ]
                                      negated: False
                                    )
                                  ]
                                )
                              left_token: <Left_CommandSub "$(">
                              spids: [22 46]
                            )
                          )
                        }
                      )
                    ]
                  )
                left_token: <Left_CommandSub "$(">
                spids: [18 48]
              )
            }
          spids: [17]
        )
      ]
      spids: [15]
    )
    (FuncDef
      name: printUsage
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:NAME)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [(C {(basename)} {(DQ (${ VSub_Number 0))})]
                          )
                        left_token: <Left_CommandSub "$(">
                        spids: [59 67]
                      )
                    }
                  spids: [58]
                )
              ]
              spids: [58]
            )
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("usage: ") (${ VSub_Name NAME) (" [OPTIONS]\n") ("\n") 
                        ("This script runs some test to check the CocoaPods integration.\n") ("\n") ("OPTIONS:\n") ("\n") (" General:\n") ("\n") ("   -h, --help\n") ("         Show this message\n") 
                        ("   --skip-static\n") ("         Skip the static based pods tests.\n") ("   --skip-framework\n") 
                        ("         Skip the framework based pods tests.\n") ("   --skip-ios\n") ("         Skip the iOS pods tests.\n") ("   --skip-osx\n") 
                        ("         Skip the OS X pods tests.\n") ("\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [72]
                )
              ]
            )
          ]
          spids: [55]
        )
      spids: [51 54]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:TEST_MODES)
          op: Equal
          rhs: {(ArrayLiteralPart words:[{(DQ (static))}{(DQ (framework))}])}
          spids: [102]
        )
      ]
      spids: [102]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:TEST_NAMES)
          op: Equal
          rhs: {(ArrayLiteralPart words:[{(DQ (iOSCocoaPodsTester))}{(DQ (OSXCocoaPodsTester))}])}
          spids: [115]
        )
      ]
      spids: [115]
    )
    (While
      cond: [
        (Sentence
          child: 
            (DBracket
              expr: (BoolBinary op_id:BoolBinary_GlobNEqual left:{($ VSub_Pound "$#")} right:{(0)})
            )
          terminator: <Op_Semi ";">
        )
      ]
      body: 
        (DoGroup
          children: [
            (Case
              to_match: {(DQ (${ VSub_Number 1))}
              arms: [
                (case_arm
                  pat_list: [{(-h)} {(--help)}]
                  action: [(C {(printUsage)}) (C {(exit)} {(0)})]
                  spids: [155 161 172 -1]
                )
                (case_arm
                  pat_list: [{(--skip-static)}]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:TEST_MODES)
                          op: Equal
                          rhs: 
                            {
                              (ArrayLiteralPart
                                words: [
                                  {
                                    (BracedVarSub
                                      token: <VSub_Name TEST_MODES>
                                      bracket_op: (WholeArray op_id:Lit_At)
                                      suffix_op: 
                                        (PatSub
                                          pat: {(static)}
                                          do_all: False
                                          do_prefix: False
                                          do_suffix: False
                                        )
                                      spids: [182 189]
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [180]
                        )
                      ]
                      spids: [180]
                    )
                  ]
                  spids: [175 177 193 -1]
                )
                (case_arm
                  pat_list: [{(--skip-framework)}]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:TEST_MODES)
                          op: Equal
                          rhs: 
                            {
                              (ArrayLiteralPart
                                words: [
                                  {
                                    (BracedVarSub
                                      token: <VSub_Name TEST_MODES>
                                      bracket_op: (WholeArray op_id:Lit_At)
                                      suffix_op: 
                                        (PatSub
                                          pat: {(framework)}
                                          do_all: False
                                          do_prefix: False
                                          do_suffix: False
                                        )
                                      spids: [203 210]
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [201]
                        )
                      ]
                      spids: [201]
                    )
                  ]
                  spids: [196 198 214 -1]
                )
                (case_arm
                  pat_list: [{(--skip-ios)}]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:TEST_NAMES)
                          op: Equal
                          rhs: 
                            {
                              (ArrayLiteralPart
                                words: [
                                  {
                                    (BracedVarSub
                                      token: <VSub_Name TEST_NAMES>
                                      bracket_op: (WholeArray op_id:Lit_At)
                                      suffix_op: 
                                        (PatSub
                                          pat: {(iOSCocoaPodsTester)}
                                          do_all: False
                                          do_prefix: False
                                          do_suffix: False
                                        )
                                      spids: [224 231]
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [222]
                        )
                      ]
                      spids: [222]
                    )
                  ]
                  spids: [217 219 235 -1]
                )
                (case_arm
                  pat_list: [{(--skip-osx)}]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:TEST_NAMES)
                          op: Equal
                          rhs: 
                            {
                              (ArrayLiteralPart
                                words: [
                                  {
                                    (BracedVarSub
                                      token: <VSub_Name TEST_NAMES>
                                      bracket_op: (WholeArray op_id:Lit_At)
                                      suffix_op: 
                                        (PatSub
                                          pat: {(OSXCocoaPodsTester)}
                                          do_all: False
                                          do_prefix: False
                                          do_suffix: False
                                        )
                                      spids: [245 252]
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [243]
                        )
                      ]
                      spids: [243]
                    )
                  ]
                  spids: [238 240 256 -1]
                )
                (case_arm
                  pat_list: [{(-) (Lit_Other "*")}]
                  action: [
                    (SimpleCommand
                      words: [{(echo)} {(DQ ("ERROR: Unknown option: ") (${ VSub_Number 1))}]
                      redirects: [(Redir op_id:Redir_GreatAnd fd:1 arg_word:{(2)} spids:[273])]
                    )
                    (C {(printUsage)})
                    (C {(exit)} {(1)})
                  ]
                  spids: [259 261 285 -1]
                )
                (case_arm
                  pat_list: [{(Lit_Other "*")}]
                  action: [
                    (SimpleCommand
                      words: [{(echo)} {(DQ ("ERROR: Unknown argument: ") (${ VSub_Number 1))}]
                      redirects: [(Redir op_id:Redir_GreatAnd fd:1 arg_word:{(2)} spids:[301])]
                    )
                    (C {(printUsage)})
                    (C {(exit)} {(1)})
                  ]
                  spids: [288 289 313 -1]
                )
              ]
              spids: [144 152 316]
            )
            (C {(shift)})
          ]
          spids: [141 321]
        )
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (DBracket
                  expr: 
                    (BoolBinary
                      op_id: BoolBinary_GlobDEqual
                      left: 
                        {
                          (DQ 
                            (BracedVarSub
                              token: <VSub_Name TEST_NAMES>
                              prefix_op: VSub_Pound
                              bracket_op: (WholeArray op_id:Lit_At)
                              spids: [332 338]
                            )
                          )
                        }
                      right: {(0)}
                    )
                )
              terminator: <Op_Semi ";">
            )
          ]
          action: [
            (SimpleCommand
              words: [{(echo)} {(DQ ("ERROR: Need to run at least iOS or OS X tests."))}]
              redirects: [(Redir op_id:Redir_GreatAnd fd:1 arg_word:{(2)} spids:[358])]
            )
            (C {(exit)} {(2)})
          ]
          spids: [-1 349]
        )
      ]
      spids: [-1 366]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (DBracket
                  expr: 
                    (BoolBinary
                      op_id: BoolBinary_GlobDEqual
                      left: 
                        {
                          (DQ 
                            (BracedVarSub
                              token: <VSub_Name TEST_MODES>
                              prefix_op: VSub_Pound
                              bracket_op: (WholeArray op_id:Lit_At)
                              spids: [373 379]
                            )
                          )
                        }
                      right: {(0)}
                    )
                )
              terminator: <Op_Semi ";">
            )
          ]
          action: [
            (SimpleCommand
              words: [{(echo)} {(DQ ("ERROR: Need to run at least static or frameworks tests."))}]
              redirects: [(Redir op_id:Redir_GreatAnd fd:1 arg_word:{(2)} spids:[399])]
            )
            (C {(exit)} {(2)})
          ]
          spids: [-1 390]
        )
      ]
      spids: [-1 407]
    )
    (FuncDef
      name: header
      body: 
        (BraceGroup
          children: [
            (C {(echo)} {(DQ )})
            (C {(echo)} 
              {(DQ ("========================================================================"))}
            )
            (C {(echo)} {(DQ ("    ") (${ VSub_At "@"))})
            (C {(echo)} 
              {(DQ ("========================================================================"))}
            )
            (C {(echo)} {(DQ )})
          ]
          spids: [414]
        )
      spids: [410 413]
    )
    (FuncDef
      name: cleanup
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:TEST_NAME)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number "$1"))}
                  spids: [467]
                )
              ]
              spids: [465]
            )
            (C {(echo)} {(DQ ("Cleaning up..."))})
            (AndOr
              children: [
                (SimpleCommand
                  words: [
                    {(xcodebuild)}
                    {(-workspace)}
                    {(DQ (${ VSub_Name TEST_NAME) (.xcworkspace))}
                    {(-scheme)}
                    {(DQ (${ VSub_Name TEST_NAME))}
                    {(clean)}
                  ]
                  redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[511])]
                )
                (C {(true)})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(pod)} {(deintegrate)}]
                  redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[524])]
                )
                (C {(true)})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [(C {(pod)} {(cache)} {(clean)} {(--all)}) (C {(true)})]
              op_id: Op_DPipe
            )
            (AndOr
              children: [(C {(rm)} {(-f)} {(Podfile.lock)}) (C {(true)})]
              op_id: Op_DPipe
            )
            (AndOr
              children: [(C {(rm)} {(-rf)} {(DQ (${ VSub_Name TEST_NAME) (.xcworkspace))}) (C {(true)})]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (C {(git)} {(checkout)} {(--)} {(DQ (${ VSub_Name TEST_NAME) (.xcodeproj))})
                (C {(true)})
              ]
              op_id: Op_DPipe
            )
            (AndOr children:[(C {(rm)} {(-f)} {(Podfile)})(C {(true)})] op_id:Op_DPipe)
          ]
          spids: [462]
        )
      spids: [458 461]
    )
    (FuncDef
      name: do_test
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:TEST_NAME)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number "$1"))}
                  spids: [625]
                )
              ]
              spids: [623]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:TEST_MODE)
                  op: Equal
                  rhs: {(DQ ($ VSub_Number "$2"))}
                  spids: [633]
                )
              ]
              spids: [631]
            )
            (C {(header)} {(DQ (${ VSub_Name TEST_NAME))} {(-)} {(Mode) (Lit_Other ":")} 
              {(DQ (${ VSub_Name TEST_MODE))}
            )
            (C {(cd)} {(DQ (${ VSub_Name ScriptDir) (/) (${ VSub_Name TEST_NAME))})
            (C {(trap)} {(DQ ("cleanup ") (${ VSub_Name TEST_NAME))} {(EXIT)})
            (C {(pod)} {(cache)} {(clean)} {(--all)})
            (C {(cp)} {(-f)} {(DQ (Podfile-) (${ VSub_Name TEST_MODE))} {(DQ (Podfile))})
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:xcodebuild_args)
                  op: Equal
                  rhs: 
                    {
                      (ArrayLiteralPart
                        words: [
                          {(DQ (-workspace))}
                          {(DQ (${ VSub_Name TEST_NAME) (.xcworkspace))}
                          {(DQ (-scheme))}
                          {(DQ (${ VSub_Name TEST_NAME))}
                        ]
                      )
                    }
                  spids: [726]
                )
              ]
              spids: [726]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolBinary
                              op_id: BoolBinary_GlobDEqual
                              left: {(DQ (${ VSub_Name TEST_NAME))}
                              right: {(iOS) (Lit_Other "*")}
                            )
                        )
                      terminator: <Op_Semi ";">
                    )
                  ]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:xcodebuild_args)
                          op: PlusEqual
                          rhs: 
                            {
                              (ArrayLiteralPart
                                words: [
                                  {(-sdk)}
                                  {(iphonesimulator)}
                                  {(Lit_VarLike "ONLY_ACTIVE_ARCH=") (NO)}
                                  {(-destination)}
                                  {(DQ ("platform=iOS Simulator,name=iPad 2,OS=9.3"))}
                                ]
                              )
                            }
                          spids: [792]
                        )
                      ]
                      spids: [792]
                    )
                  ]
                  spids: [-1 781]
                )
              ]
              spids: [-1 814]
            )
            (C {(pod)} {(install)} {(--verbose)})
            (C {(xcodebuild)} 
              {
                (DQ 
                  (BracedVarSub
                    token: <VSub_Name xcodebuild_args>
                    bracket_op: (WholeArray op_id:Lit_At)
                    spids: [833 838]
                  )
                )
              } {(build)}
            )
            (C {(trap)} {(-)} {(EXIT)})
            (C {(cleanup)} {(DQ (${ VSub_Name TEST_NAME))})
          ]
          spids: [620]
        )
      spids: [616 619]
    )
    (ForEach
      iter_name: TEST_NAME
      iter_words: [
        {
          (DQ 
            (BracedVarSub
              token: <VSub_Name TEST_NAMES>
              bracket_op: (WholeArray op_id:Lit_At)
              spids: [877 882]
            )
          )
        }
      ]
      do_arg_iter: False
      body: 
        (DoGroup
          children: [
            (ForEach
              iter_name: TEST_MODE
              iter_words: [
                {
                  (DQ 
                    (BracedVarSub
                      token: <VSub_Name TEST_MODES>
                      bracket_op: (WholeArray op_id:Lit_At)
                      spids: [897 902]
                    )
                  )
                }
              ]
              do_arg_iter: False
              body: 
                (DoGroup
                  children: [
                    (C {(do_test)} {(DQ (${ VSub_Name TEST_NAME))} {(DQ (${ VSub_Name TEST_MODE))})
                  ]
                  spids: [907 925]
                )
              spids: [895 905]
            )
          ]
          spids: [887 927]
        )
      spids: [875 885]
    )
  ]
)