LinkRunTests 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #Assembles, links and run tests of FreePascal
  2. #Param 1, the directory with the tests to perform.
  3. #Note versions can be either 2 or 3 fields, e g 1.1 1.0.10
  4. (Evaluate {0} =~ /(Å:)¨1[Â:]*/) > Dev:Null
  5. Set mydir {¨1}
  6. Set -e debugverbose 1
  7. Echo "** Assembles, links and run tests for MacOS **"
  8. #Delete -i Å.o
  9. Set -e nrOfSucceded 0
  10. Set -e nrOfFailed 0
  11. #Set compiler version
  12. Set compver '1.9' #Must be at least two fields
  13. If `Evaluate "{compver}" !~ /([0-9]*)¨1.([0-9]*)¨2.([0-9]*)¨3/`
  14. If `Evaluate "{compver}" !~ /([0-9]*)¨1.([0-9]*)¨2/`
  15. Echo Error in compiler version no
  16. Exit 1
  17. Else
  18. Set ¨3 0
  19. End
  20. End
  21. Set -e cv1 {¨1};Set -e cv2 {¨2}; Set -e cv3 {¨3}
  22. Directory {1}units:
  23. #Iterate through files in :units:
  24. Set Exit 0 # To handle the case, in the for stmt, when there is no match
  25. For sourceWithExt In Å.s
  26. Set Exit 1 #Revert error handling
  27. (Evaluate "{sourceWithExt}" =~ /(([Â.])*)¨1Å/) > Dev:Null
  28. Set unitname {¨1}
  29. If `Exists {unitname}.o`
  30. Continue
  31. End
  32. SetFile -c 'MPS ' -t 'TEXT' {unitname}_ppas
  33. Execute {unitname}_ppas
  34. Set Exit 0 # To handle the case, in the for stmt, when there is no match
  35. End
  36. Set Exit 1 #Revert error handling
  37. Directory {1}
  38. {mydir}LinkRunDir ':test:'
  39. {mydir}LinkRunDir ':test:cg:'
  40. {mydir}LinkRunDir ':test:cg:cdecl:'
  41. {mydir}LinkRunDir ':test:units:system:'
  42. {mydir}LinkRunDir ':test:units:strings:'
  43. {mydir}LinkRunDir ':test:units:objects:'
  44. {mydir}LinkRunDir ':test:units:math:'
  45. {mydir}LinkRunDir ':test:opt:'
  46. {mydir}LinkRunDir ':tbs:'
  47. {mydir}LinkRunDir ':tbf:'
  48. {mydir}LinkRunDir ':webtbs:'
  49. {mydir}LinkRunDir ':webtbf:'
  50. Echo "============================================================="
  51. Echo '** Test session finished. **'
  52. Echo "No of succeded tests: {nrOfSucceded}"
  53. Echo "No of failed tests: {nrOfFailed}"