• Typical layout (non-interactive tests):
    ! Tests for the FOO command
    !
    startmacro
      ! Run any non-interactive tests
      call basicTest
      call specialTest
    endmacro
    
    procedure basicTest
      ! tests here
    return
    
    procedure specialTest
      ! tests here
    return
  • Typical layout (with interactive tests):
    (Parts that differ from a non-interactive test macro, shown in blue.)
    ! Tests for the FOO command
    !
    startmacro
      switch INTERACTIVE interAct GET DEF=TRUE SDEF=TRUE
    
      ! Run any non-interactive tests
      call basicTest
      call specialTest
    
      if interAct then
        ! Run any interactive tests
        pipe on
          panel/setup/controls=gc
    
          gcontrol text   idtext "Instructions"      "TBD" 24 7 /title
          gcontrol button test   "TestA,TestB,TestC" none       /nc=3
    
          gcontrol menu   main "Exit with Status = " "PASS,FAIL" /tleft
          set gc.main.itemColors {PASS=GREEN,FAIL=RED}
        pipe off
      endif
    endmacro
    
    procedure processMessage m:msg
      if msg.name eqs "MAIN" then
        assert/text="^reg.main.name: User indicated tests" msg.data eqss "PASS"
        pipe stop
      elseif msg.name eqs "TEST" then
        if msg.data eqs "TESTA" then
          call testA
        elseif msg.data eqs "TESTB" then
          call testB
        elseif msg.data eqs "TESTC" then
          call testC
        endif
      endif
    return
    
    ! test procedures go here.