trick/test/SIM_test_varserv/RUN_test/unit_test.py

30 lines
837 B
Python
Raw Normal View History

2015-02-26 15:02:31 +00:00
import trick
import socket
from trick.unit_test import *
def main():
trick.var_server_set_port(40000)
trick.var_ascii()
trick.real_time_enable()
trick.exec_set_software_frame(0.01)
# trick.set_var_server_info_msg_on()
2015-02-26 15:02:31 +00:00
trick.var_server_create_tcp_socket('localhost', 49000)
trick.var_server_create_udp_socket('', 48000)
# trick.var_server_create_multicast_socket('224.10.10.10','', 47000)
trick.exec_set_terminate_time(1000.0)
2015-02-26 15:02:31 +00:00
varServerPort = trick.var_server_get_port()
test_output = ( os.getenv("TRICK_HOME") + "/trick_test/SIM_test_varserv.xml" )
command = 'os.system("./models/test_client/test_client ' + str(varServerPort) + ' --gtest_output=xml:' + test_output + ' &")'
2015-02-26 15:02:31 +00:00
# Start the test client after everything has been initialized (hopefully)
trick.add_read(1.0, command)
2015-02-26 15:02:31 +00:00
if __name__ == "__main__":
main()