! Tests the VERSION command
!
! @author  J. Czechowski IV
!******************************************************************************!
startmacro
  switch INTERACTIVE interAct GET DEF=TRUE  SDEF=TRUE
  switch BASELINE    baseline GET DEF=FALSE SDEF=TRUE

  if interAct then
    res inst "The version information for the SYS option tree should be shown &
              on the right. It should list the version number as ^{ENV.NMVERSION}. \n\n&
              Below that is the output for the VERSION command on other option &
              trees. \n\nOutput should NOT include any details (verbose) from &
              the calc and invoke statements. \n\nVerify that each Option Tree &
              version information has a release and a date."

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

      shellgui/id=idshellgui/attach
      say ""
      say "nM> VERSION/ALL SYS"
      VERSION/ALL SYS

      res origPath opt.path  ! save original path
      call test_ver database
      call test_ver audio
      call test_ver net      ! NET option tree added in 3.7.2
      call test_ver ucl
      call test_ver dsp
      call test_ver hwc
      call test_ver vnc
      call test_ver webvnc
      call test_ver minio
      !call test_ver xbc
      path set ^origPath     ! restore original path
    pipe off

  else
    ! VERSION is tested only in an interactive mode
  endif

endmacro

!******************************************************************************!
procedure processMessage m:msg
  !say "msg.name ^msg.name, data ^msg.data"

  if msg.name eqs "MAIN" then
    assert/text="Tests for VERSION" msg.data eqss "PASS"
    pipe stop
  else
    ! do nothing
    say "^reg.main.name: Unhandled message name: ^msg.name from fid: ^msg.fid dats: ^msg.data"
  endif
return

!******************************************************************************!
procedure test_ver s:optionTree

  path add ^optionTree
  say ""
  say "nM> VERSION/ALL ^optionTree"
  VERSION/ALL ^optionTree
  path rem ^optionTree

return
