linuxcnc.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # LinuxCNC hardware module test
  2. __run_awlsim_linuxcnc_hal()
  3. {
  4. local interpreter="$1"
  5. local test_dir="$2"
  6. local awl_file="$3"
  7. shift 3
  8. export EXTRA_PYTHONPATH="$rootdir/libs/linuxcnc_fake_hal"
  9. setup_test_environment "$interpreter"
  10. local interpreter="$RET"
  11. FAKEHAL_HALFILE="${test_dir}/linuxcnc.hal" \
  12. "$interpreter" ./awlsim-linuxcnc-hal \
  13. --input-base 0 --input-size 32 \
  14. --output-base 0 --output-size 32 \
  15. --watchdog off --extended-insns \
  16. --listen localhost:$(get_port) \
  17. "$@" \
  18. "$awl_file" >/dev/null ||\
  19. test_failed "LinuxCNC test '$(basename "$awl_file")' failed"
  20. cleanup_test_environment
  21. }
  22. sh_test()
  23. {
  24. local interpreter="$1"
  25. local test_dir="$2"
  26. local test_name="$3"
  27. cd "$rootdir" || die "Failed to change to rootdir '$rootdir'"
  28. infomsg
  29. for testfile in "000-base/empty.awl"\
  30. "000-base/shutdown.awl"\
  31. "000-base/EXAMPLE.awlpro"; do
  32. infomsg " Running linuxcnc test with: $testfile"
  33. __run_awlsim_linuxcnc_hal "$interpreter" "$test_dir" \
  34. "$rootdir/tests/$testfile" \
  35. --max-runtime 1.0
  36. done
  37. infomsg " Running I/O test"
  38. __run_awlsim_linuxcnc_hal "$interpreter" "$test_dir" \
  39. "$test_dir/linuxcnc-iotest.awl__"
  40. }