symtab-parser-000.sh 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # symtab parser tests
  2. sh_test()
  3. {
  4. local interpreter="$1"
  5. cd "$rootdir" || die "Failed to change to rootdir '$rootdir'"
  6. # Print help text
  7. "$interpreter" ./awlsim-symtab -h >/dev/null ||\
  8. test_failed "Call to awlsim-symtab -h failed"
  9. # Test CSV input
  10. cat << EOF |\
  11. "$interpreter" ./awlsim-symtab -I auto -O csv - - >/dev/null ||\
  12. test_failed "Call to awlsim-symtab -I auto -O csv failed"
  13. Merker 1;M 0.0;BOOL;Symbol 1
  14. Merker 2;M 0.1;BOOL;Symbol 2
  15. EOF
  16. cat << EOF |\
  17. "$interpreter" ./awlsim-symtab -I csv -O csv - - >/dev/null ||\
  18. test_failed "Call to awlsim-symtab -I csv -O csv failed"
  19. Merker 1;M 0.0;BOOL;Symbol 1
  20. Merker 2;M 0.1;BOOL;Symbol 2
  21. EOF
  22. cat << EOF |\
  23. "$interpreter" ./awlsim-symtab -I csv -O readable-csv - - >/dev/null ||\
  24. test_failed "Call to awlsim-symtab -I csv -O readable-csv failed"
  25. Merker 1;M 0.0;BOOL;Symbol 1
  26. Merker 2;M 0.1;BOOL;Symbol 2
  27. EOF
  28. cat << EOF |\
  29. "$interpreter" ./awlsim-symtab -I csv -O asc - - >/dev/null ||\
  30. test_failed "Call to awlsim-symtab -I csv -O asc failed"
  31. Merker 1;M 0.0;BOOL;Symbol 1
  32. Merker 2;M 0.1;BOOL;Symbol 2
  33. EOF
  34. # Test ASC input
  35. cat << EOF |\
  36. "$interpreter" ./awlsim-symtab -I auto -O asc - - >/dev/null ||\
  37. test_failed "Call to awlsim-symtab -I auto -O asc failed"
  38. 126,Merker 1 M 0.0 BOOL Symbol 1
  39. 126,Merker 2 M 0.1 BOOL Symbol 2
  40. EOF
  41. cat << EOF |\
  42. "$interpreter" ./awlsim-symtab -I asc -O asc - - >/dev/null ||\
  43. test_failed "Call to awlsim-symtab -I asc -O asc failed"
  44. 126,Merker 1 M 0.0 BOOL Symbol 1
  45. 126,Merker 2 M 0.1 BOOL Symbol 2
  46. EOF
  47. cat << EOF |\
  48. "$interpreter" ./awlsim-symtab -I asc -O csv - - >/dev/null ||\
  49. test_failed "Call to awlsim-symtab -I asc -O csv failed"
  50. 126,Merker 1 M 0.0 BOOL Symbol 1
  51. 126,Merker 2 M 0.1 BOOL Symbol 2
  52. EOF
  53. cat << EOF |\
  54. "$interpreter" ./awlsim-symtab -I asc -O readable-csv - - >/dev/null ||\
  55. test_failed "Call to awlsim-symtab -I asc -O readable-csv failed"
  56. 126,Merker 1 M 0.0 BOOL Symbol 1
  57. 126,Merker 2 M 0.1 BOOL Symbol 2
  58. EOF
  59. }