! Tests the state transitions in the state diagram at the top of HPrimitive.java
!
! author:  J. Czechowski IV
! version: $Id: test_states.mm,v 1.1 2007/11/02 20:00:14 jxc Exp $
!
startmacro
  call test_states true  true
  call test_states true  false
  call test_states false true
  call test_states false false
endmacro

procedure test_states z:do_sync z:do_return
  set calls "M$CHECKIN" ! M$CHECKIN is mandatory

  if do_sync   then set calls "^calls M$SYNC"
  if do_return then set calls "^calls M$RETURN"

  info "Running test primitive that includes ^calls"
  nxm.xbc.host.test_states/id=foo/stat=status do_sync do_return
  assert/text="Status of Fortran tests" status rexists and ^status eqs "PASS"
  rem status
return