Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/halmodule/halquery/expected
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ invert.0 {'haltype': 'function', 'name': 'invert.0', 'comp': 'invert', 'comp_id'
or2.0 {'haltype': 'function', 'name': 'or2.0', 'comp': 'or2', 'comp_id': 'ID', 'users': 1, 'reentrant': False}
xor2.0 {'haltype': 'function', 'name': 'xor2.0', 'comp': 'xor2', 'comp_id': 'ID', 'users': 1, 'reentrant': False}
# Threads
testthread {'haltype': 'thread', 'name': 'testthread', 'comp': '__testthread', 'comp_id': 'ID', 'priority': 0, 'period': 1000000, 'functions': [{'haltype': 'threadfunction', 'name': 'and2.0', 'index': 0, 'is_init': False}, {'haltype': 'threadfunction', 'name': 'or2.0', 'index': 1, 'is_init': False}, {'haltype': 'threadfunction', 'name': 'xor2.0', 'index': 2, 'is_init': False}]}
testthread {'haltype': 'thread', 'name': 'testthread', 'comp': '__testthread', 'comp_id': 'ID', 'priority': 'PRIO', 'period': 1000000, 'functions': [{'haltype': 'threadfunction', 'name': 'and2.0', 'index': 0, 'is_init': False}, {'haltype': 'threadfunction', 'name': 'or2.0', 'index': 1, 'is_init': False}, {'haltype': 'threadfunction', 'name': 'xor2.0', 'index': 2, 'is_init': False}]}
# Signal pins
and2.0.out {'haltype': 'pin', 'name': 'and2.0.out', 'type': <Type.BOOL>, 'dir': <Dir.OUT>, 'value': False, 'alias': None, 'signal': 'net-xor-a', 'comp': 'and2', 'comp_id': 'ID'}
xor2.0.in0 {'haltype': 'pin', 'name': 'xor2.0.in0', 'type': <Type.BOOL>, 'dir': <Dir.IN>, 'value': False, 'alias': None, 'signal': 'net-xor-a', 'comp': 'xor2', 'comp_id': 'ID'}
Expand All @@ -65,4 +65,4 @@ Param: {'haltype': 'parameter', 'name': 'invert.0.deadband', 'type': <Type.REAL>
Signal: {'haltype': 'signal', 'name': 'net-output', 'type': <Type.BOOL>, 'value': False, 'writers': 1, 'readers': 0, 'bidirs': 0, 'driver': 'xor2.0.out'}
Component: {'haltype': 'component', 'name': 'and2', 'type': <CompType.REALTIME>, 'id': 'ID', 'pid': 0, 'ready': True, 'insmod': 'count=1'}
Function: {'haltype': 'function', 'name': 'xor2.0', 'comp': 'xor2', 'comp_id': 'ID', 'users': 1, 'reentrant': False}
Thread: {'haltype': 'thread', 'name': 'testthread', 'comp': '__testthread', 'comp_id': 'ID', 'priority': 0, 'period': 1000000, 'functions': [{'haltype': 'threadfunction', 'name': 'and2.0', 'index': 0, 'is_init': False}, {'haltype': 'threadfunction', 'name': 'or2.0', 'index': 1, 'is_init': False}, {'haltype': 'threadfunction', 'name': 'xor2.0', 'index': 2, 'is_init': False}]}
Thread: {'haltype': 'thread', 'name': 'testthread', 'comp': '__testthread', 'comp_id': 'ID', 'priority': 'PRIO', 'period': 1000000, 'functions': [{'haltype': 'threadfunction', 'name': 'and2.0', 'index': 0, 'is_init': False}, {'haltype': 'threadfunction', 'name': 'or2.0', 'index': 1, 'is_init': False}, {'haltype': 'threadfunction', 'name': 'xor2.0', 'index': 2, 'is_init': False}]}
11 changes: 9 additions & 2 deletions tests/halmodule/halquery/halquerytest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ def fix_comp_id(d):
d['comp_id'] = "ID"
return fix_enum_numbers(d)

# The thread priority is 0 without realtime and the scheduler priority
# with it, so mask it as well.
def fix_thread(d):
if 'priority' in d:
d['priority'] = "PRIO"
return fix_comp_id(d)

def fix_id(d):
if 'id' in d:
d['id'] = "ID"
Expand Down Expand Up @@ -43,7 +50,7 @@ def fix_id(d):

print("# Threads")
for n,v in hal.query.threads().items():
print(n, fix_comp_id(v))
print(n, fix_thread(v))

print("# Signal pins")
for n,v in hal.query.signalpins('net-xor-a').items():
Expand Down Expand Up @@ -74,4 +81,4 @@ def fix_id(d):
print("Signal:", fix_enum_numbers(hal.query.signal('net-output')))
print("Component:", fix_id(hal.query.comp('and2')))
print("Function:", fix_comp_id(hal.query.funct('xor2.0')))
print("Thread:", fix_comp_id(hal.query.thread('testthread')))
print("Thread:", fix_thread(hal.query.thread('testthread')))
11 changes: 8 additions & 3 deletions tests/stale-motion-status/test-ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,16 @@ def settle(what, done):
sys.exit(1)
time.sleep(0.001)

# slowkins busy waits most of a servo period, so a realtime host may
# report a late period; only the other errors count.
def error(err):
if err and "Unexpected realtime delay" not in err[1]:
errors.append(err[1])

errors = []
while True:
err = e.poll()
if err:
errors.append(err[1])
error(err)
s.poll()
if s.interp_state == linuxcnc.INTERP_IDLE:
break
Expand All @@ -89,7 +94,7 @@ def settle(what, done):

err = e.poll()
while err:
errors.append(err[1])
error(err)
err = e.poll()

for msg in failures + errors:
Expand Down
5 changes: 4 additions & 1 deletion tests/workplane-retain/test-ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@ def say(*a):
c.home(-1)
l.wait_for_home(joints=[1, 1, 1, 1, 0, 0, 0, 0, 0])

# A realtime host reports a late servo period on the error channel;
# that says nothing about the plane, so leave it out.
def errors():
msgs = []
while True:
m = e.poll()
if not m:
return msgs
msgs.append(m[1])
if "Unexpected realtime delay" not in m[1]:
msgs.append(m[1])

def mdi(*cmds):
c.mode(linuxcnc.MODE_MDI)
Expand Down
Loading