! This tests the contlab2 macro for the Macro Control Lab 2
!
! Author:  Neon Ngo
! Version: $Id: test_contlab2.mm,v 1.1 2007/07/24 22:51:29 ntn Exp $
!
startmacro
  switch INTERACTIVE interAct GET DEF=TRUE  SDEF=TRUE
  switch BASELINE    baseline GET DEF=FALSE SDEF=TRUE

  if interAct then
    res inst "Verify the EXPECTED OUTPUT against the ACTUAL OUTPUT."

    pipe on
      panel/msgid=MAIN/setup/controls=gc
      gcontrol text idtext "Instructions" "^inst" 24 4 /title
      gcontrol menu main "Exit with Status = " "PASS,FAIL" /tleft
      set gc.main.itemColors {PASS=GREEN,FAIL=RED}

      shellgui/attach
      say ""
      say "EXPECTED (SIMILAR) OUTPUT:"
      say "REG.PANEL=P: PANEL,FILE=,/MSGID=MAIN,/SETUP=,/CONTROLS=gc"
      say "REG.WIN.PANE0=Pane PANE0 x=0 y=0 w=0 h=0"
      say "REG.WIN.SHELLGUI=Pane SHELLGUI x=213 y=28 w=477 h=462"
      say "REG.SHELLGUI=P: SHELLGUI,/ATTACH="
      say "REG.CONTLAB2=M: CONTLAB2,TAB=reg,PREFIX=reg"
      say ""
      say "ACTUAL OUTPUT:"
      say "nM> contlab2 reg reg"
      contlab2 reg reg
    pipe off
  endif
endmacro

procedure processMessage m:msg
  if msg.name eqs "MAIN" then
    assert/text="^reg.main.name: Tests for CONTLAB2" msg.data eqss "PASS"
    pipe stop
  else
    say "^reg.main.name: Unhandled message name: ^msg.name from fid: ^msg.fid data: ^msg.data"
  endif
return
