test_calcRL.tcl 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. #! /bin/sh
  2. # restart using wish \
  3. exec /sppdg/software/tools/public_domain/${HOST_TYPE}/bin/wish "$0" "$@"
  4. set auto_path [linsert $auto_path 0 /sppdg/software/src/tnt/calcRL/lib]
  5. set auto_path [linsert $auto_path 0 /sppdg/software/src/tnt/bem/lib]
  6. set auto_path [linsert $auto_path 0 /sppdg/software/src/tnt/gui]
  7. package require Itcl
  8. package require -exact BWidget 1.2.1
  9. package require calcRL
  10. package require gui
  11. # From whence is this script run?
  12. # For there shall we find the rest.
  13. set ::scriptDir [file dirname [info script]]
  14. source [file join $::scriptDir calcRL_compare.tcl]
  15. proc runTests { testNode originalNode log {cSegs 10} {pSegs 10} } {
  16. puts "-----------------------------------------------"
  17. puts "\nRunning calcRL on $testNode..."
  18. ::calcRL::calcRL_RunBatch $testNode 0
  19. calcRL_compare $testNode.out $originalNode.out_save $log
  20. }
  21. ##################################################################
  22. # Create the main window.
  23. ##################################################################
  24. proc createMain { calcRLInitialize } {
  25. global mainframe
  26. global status
  27. # Menu description
  28. set descmenu {
  29. "&File" all file 0 {
  30. {command "&Quit" {} "Quit" {Ctrl q} -command _quit}
  31. }
  32. }
  33. set mainframe [MainFrame .mainframe \
  34. -menu $descmenu \
  35. -textvariable status]
  36. ::gui::guiCreateConsole
  37. ::gui::guiConsole 1
  38. pack $mainframe -fill both -expand yes
  39. wm protocol . WM_DELETE_WINDOW {_exit}
  40. }
  41. proc runTheTests { log testDir orgDir } {
  42. global env
  43. runTests $testDir/jc.data $orgDir/jc.data $log 20 40
  44. update
  45. runTests $testDir/test $orgDir/test $log 40 80
  46. update
  47. runTests $testDir/tst0.data $orgDir/tst0.data $log 45 45
  48. update
  49. runTests $testDir/tst1.data $orgDir/tst1.data $log 45 45
  50. update
  51. runTests $testDir/tst2.data $orgDir/tst2.data $log 45 45
  52. update
  53. runTests $testDir/tst3.data $orgDir/tst3.data $log 45 45
  54. update
  55. runTests $testDir/tst4.data $orgDir/tst4.data $log 45 45
  56. update
  57. runTests $testDir/tst5.data $orgDir/tst5.data $log 45 45
  58. update
  59. runTests $testDir/tst6.data $orgDir/tst6.data $log 45 45
  60. update
  61. }
  62. ##################################################################
  63. ##################################################################
  64. proc main { argv } {
  65. global env
  66. set calcRLInitialize 1
  67. option add *font {courier 10 bold}
  68. wm withdraw .
  69. # Create main window
  70. createMain $calcRLInitialize
  71. BWidget::place . 0 0 center
  72. set testDir $::scriptDir
  73. set orgDir $::scriptDir
  74. set log [open $testDir/test_bem.log w]
  75. runTheTests $log $testDir $orgDir
  76. close $log
  77. }
  78. main $argv