Import LinuxCNC source tree

This commit is contained in:
Wang Dequan
2026-08-20 06:17:39 +08:00
commit 2c814634c3
9429 changed files with 10556013 additions and 0 deletions

1
tests/threads.0/README Normal file
View File

@@ -0,0 +1 @@
Tests that threads run in the right order and with the right frequency.

35
tests/threads.0/checkresult Executable file
View File

@@ -0,0 +1,35 @@
#!/usr/bin/env python3
import sys
l = [int(line.strip()) for line in open(sys.argv[1])]
if len(l) != 3500:
print("result contained %d lines, not the expected 3500 lines!" % (len(l)))
raise SystemExit(1) # failure
lineno = 1
got_reset = 0
expected = 1
for i in l:
if i == 1:
if expected != 1: got_reset = 1
expected = i + 1
lineno = lineno + 1
continue
if i != expected:
if expected == 1:
print("line %d: got %d, expected %d" % (lineno, i, expected))
else:
print("line %d: got %d, expected %d or 1" % (lineno, i, expected))
raise SystemExit(1) # failure
expected = i + 1
lineno = lineno + 1
if got_reset:
raise SystemExit(0) # success
print("no reset in %d lines!" % (lineno-1))
raise SystemExit(1) # failure

16
tests/threads.0/test.hal Normal file
View File

@@ -0,0 +1,16 @@
setexact_for_test_suite_only
loadrt threads name1=fast period1=100000 name2=slow period2=1000000
loadrt threadtest count=1
loadrt sampler cfg=u depth=4096
net count <= threadtest.0.count
net count => sampler.0.pin.0
addf threadtest.0.increment fast
addf sampler.0 fast
addf threadtest.0.reset slow
start
loadusr -w halsampler -n 3500