!******************************************************************************!
! Tests related to pipe /SHAREMASK switch
!
! Author:  Jay Hallam / Neon Ngo
!******************************************************************************!
startmacro z:isPipesShared[true]

switch INTERACTIVE interAct GET DEF=FALSE

if isPipesShared then
  set instruct "Should see a real-time SINE WAVE plot (pipe from parent macro)"
  set outpipename _childpipe
else
  set instruct "Should *NOT* see a real-time SINE WAVE plot (pipe from parent macro)"
  set outpipename _childpipe_not_shared
endif

pipe on
  waveform outpipename  ELEM=inf shape=white

  if isPipesShared then
    assert/text="Test PIPES sharing: _parentpipe exists in CHILD." _parentpipe FEXISTS
  else
    assert/text="Test PIPES sharing: _parentpipe SHOULD NOT exist in CHILD." _parentpipe NFEXISTS
  endif

  if interact then
    panel/controls=gc/setup
    gcontrol menu done "Exit with Status = " "PASS,FAIL" /tleft
      set gc.done.itemColors {PASS=GREEN,FAIL=RED}

    gcontrol text instructions "Instructions" instruct ,,3
    plot _parentpipe
  endif
pipe off

endmacro

!******************************************************************************!
procedure processMessage
  if msg.name EQS "DONE" then
    assert/text="^reg.main.name: User indicated tests" msg.data eqss "PASS"
    pipe stop
  endif
return
