mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
* Initial attempt to create unit tests for DATA class (tnc). * Completed initial set of tests. * Adding pytest to install packages. * Corrects issue #173 fix I didn't look carefully enough at `helpers.check_callsign` to see that it returns a list. The first element of the list is `True`/`False`. * Making check_callsign evaluation more consistent. * Update .gitignore this is more a test commit to see if GitHub Client for MacOS is working, * mkfifo test prototype First partially working prototype for testing the full tnc with mkfifo named pipes. * single tnc test file moved to a single file for running tnc tests * fixed typo * Added parameters to tests. Make other minor tweaks and documentation. * Clean up two existing tests. Adapted both tests to pytest and maintained compatibility with existing ctest method. Tweaked CMakeLists.txt . * Adding pure python highsnr_stdio_P_P_multi test. Intended to replace highsnr_stdio_P_P_multi which uses POSIX shell. * Adding pure python highsnr_stdio_P_P_datac0 test. Intended to replace highsnr_stdio_P_P_datac0 which uses POSIX shell. * Parameterize recent tests. Renamed datac0 to datacx after including all data codecs in test. * Parameterize mode as well. Add ability to run tests from main directory as well as within test/. * Add list of tests and brief descriptions. * Add more native python tests conversions. * Update README with new tests. * Tweak README again. * Rename test to be findable by pytest. * Rename test for ctest. * Update correct file this time. * Minor test tweaks. * Add modem test proof-of-concept. * Adjustment to ARQ short test. * Various refactorings. Type hints, trailing backslash, range usage, etc. * Ignore unknown arguments in argparse. * Minor cleanups. * Update test/README.md. * Update test_pa to quiet pylint. * Give up trying to suppress structlog output. * Correct module comments. * Remove excess trailing spaces. * Remove excess newlines. * Various refactorings. Type hints, trailing backslash, range usage, etc. * mkfifo test prototype First partially working prototype for testing the full tnc with mkfifo named pipes. * Update test_tnc and tweak IRS/ISS. * Correct test_modem to detect failures. * Trying to be less dependent on env variables. * Add IRS/ISS tests to ctests * Pin codec2 revision to v1.0.3. * Correcting git mistake. * Pin codec2 revision to master. This should be a specific release, that implements freedv_set_tuning_range. Co-authored-by: DJ2LS <75909252+DJ2LS@users.noreply.github.com>
55 lines
1.3 KiB
Python
Executable file
55 lines
1.3 KiB
Python
Executable file
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
|
|
import multiprocessing
|
|
import os
|
|
import sys
|
|
import time
|
|
|
|
import pytest
|
|
|
|
# pylint: disable=wrong-import-position
|
|
sys.path.insert(0, "..")
|
|
sys.path.insert(0, "../tnc")
|
|
sys.path.insert(0, "test")
|
|
import test_tnc_IRS as irs
|
|
import test_tnc_ISS as iss
|
|
|
|
|
|
# These do not update static.INFO.
|
|
# "CONNECT", "SEND_TEST_FRAME"
|
|
@pytest.mark.parametrize("command", ["CQ", "PING", "BEACON"])
|
|
def test_tnc(command):
|
|
|
|
iss_proc = multiprocessing.Process(target=iss.t_arq_iss, args=[command])
|
|
irs_proc = multiprocessing.Process(target=irs.t_arq_irs, args=[command])
|
|
# print("Starting threads.")
|
|
iss_proc.start()
|
|
irs_proc.start()
|
|
|
|
time.sleep(12)
|
|
|
|
# print("Terminating threads.")
|
|
irs_proc.terminate()
|
|
iss_proc.terminate()
|
|
irs_proc.join()
|
|
iss_proc.join()
|
|
|
|
for idx in range(2):
|
|
try:
|
|
os.unlink(f"/tmp/hfchannel{idx+1}")
|
|
except FileNotFoundError as fnfe:
|
|
print(f"Unlinking pipe: {fnfe}")
|
|
|
|
assert iss_proc.exitcode == 0, f"Transmit side failed test. {iss_proc}"
|
|
assert irs_proc.exitcode == 0, f"Receive side failed test. {irs_proc}"
|
|
|
|
|
|
if __name__ == "__main__":
|
|
# Run pytest with the current script as the filename.
|
|
ecode = pytest.main(["-s", "-v", sys.argv[0]])
|
|
if ecode == 0:
|
|
print("errors: 0")
|
|
else:
|
|
print(ecode)
|