cli.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # command line interface tests
  2. sh_test()
  3. {
  4. local interpreter="$1"
  5. cd "$rootdir" || die "Failed to change to rootdir '$rootdir'"
  6. # check awlsim-test executable
  7. "$interpreter" ./awlsim-test -h >/dev/null ||\
  8. test_failed "Call to awlsim-test -h failed"
  9. "$interpreter" ./awlsim-test --help >/dev/null ||\
  10. test_failed "Call to awlsim-test -h failed"
  11. "$interpreter" ./awlsim-test -I dummy >/dev/null ||\
  12. test_failed "Call to awlsim-test -I dummy failed"
  13. "$interpreter" ./awlsim-test --hardware-info dummy >/dev/null ||\
  14. test_failed "Call to awlsim-test --hardware-info dummy failed"
  15. # check awlsim-proupgrade executable
  16. # (proupgrade uses GUI code, so only run in compatible environment)
  17. if interpreter_is_gui_compat "$interpreter"; then
  18. local tmp_project="$(maketemp project)"
  19. cat "$basedir"/tc000_base/EXAMPLE.awlpro > "$tmp_project" ||\
  20. test_failed "Copying of EXAMPLE.awlpro failed"
  21. "$interpreter" ./awlsim-proupgrade -h >/dev/null ||\
  22. test_failed "Call to awlsim-proupgrade -h failed"
  23. "$interpreter" ./awlsim-proupgrade --help >/dev/null ||\
  24. test_failed "Call to awlsim-proupgrade --help failed"
  25. "$interpreter" ./awlsim-proupgrade "$tmp_project" >/dev/null ||\
  26. test_failed "Call to awlsim-proupgrade '$tmp_project' failed"
  27. "$interpreter" ./awlsim-proupgrade -u "$tmp_project" >/dev/null ||\
  28. test_failed "Call to awlsim-proupgrade -u '$tmp_project' failed"
  29. "$interpreter" ./awlsim-proupgrade --gen-uuids "$tmp_project" >/dev/null ||\
  30. test_failed "Call to awlsim-proupgrade --gen-uuids '$tmp_project' failed"
  31. "$interpreter" ./awlsim-proupgrade -L 5 "$tmp_project" >/dev/null ||\
  32. test_failed "Call to awlsim-proupgrade -L 5 '$tmp_project' failed"
  33. fi
  34. }