! Tests the genmsgtbl macros use of Convert to generate the qmessages.tbl file.
!
! @author  J. Roush
! @version $Id: test_genmsgtbl.txt,v 1.1 2008/07/15 18:27:34 jsr Exp $
!
startmacro/ps=128k u:resTests["numTested"] u:resFails["numFailed"]

  !---------- INITIALIZATION -----------------------------------------------------------------------
  local fs,fwidth,form,pass,item,test_count,fail_count
  res test_count 0
  res fail_count 0
  res opt_tree "NXM"

  ! Build and run genmsgtbl to verify that qmessages.tbl file is in correct place.
  INFO "You should see several 'WARN:' statements."

  mtrans genmsgtbl
  genmsgtbl ^opt_tree

  fname tmp cfg qmessages tbl ^opt_tree
  nm/on/bg/id=999
    nm assert/STAT="STATUS"/DEBUG=NO ^tmp fexist
    nm set xm.status status
    call assert_str "'genmsgtbl' generated file in correct location" test_count fail_count "PASS" status
  nm/off

!---------- CLEANUP ------------------------------------------------------------------------------
  rem/quiet tmp
  rem/quiet STATUS

  res ^resTests test_count
  res ^resFails fail_count
endmacro

!===================================================================================================
include "%xm_assert" ! Includes the assertion subroutines
