py_canoe.core.configuration.Configuration
The Configuration object represents the active configuration.
Source code in src\py_canoe\core\configuration.py
50 51 52 53 54 55 56 57 58 59 | |
c_libraries
property
Return collection of C Libraries Object
comment
property
Return configuration comment.
add_database(database_file, network)
Add a database file to the specified channel/network
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in src\py_canoe\core\configuration.py
944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 | |
add_netWork(network_name, network_type=BusType.CAN, sw_channel=1)
Adds a new network to the configuration.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in src\py_canoe\core\configuration.py
1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 | |
fetch_test_modules()
Get all test modules from all test environments and store them in self.__test_modules.
Source code in src\py_canoe\core\configuration.py
61 62 63 64 65 66 67 | |
fetch_test_units()
Get all test units from all test configurations and store them in self.__test_units.
Source code in src\py_canoe\core\configuration.py
69 70 71 72 73 74 75 | |
get_compilation_result()
Get CAPL compilation result with error details.
Compiles all CAPL code in the current configuration and returns detailed result including success status and error information.
| Returns: |
|
|---|
Example
result = config.get_compilation_result() if result["success"]: ... print("Compilation OK") ... else: ... print(f"Compilation failed: {result['error']}")
Source code in src\py_canoe\core\configuration.py
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | |
get_test_module_result(test_module_name, report_timeout=30.0)
Get test module execution result including report path, test case verdicts, and aggregated statistics.
Should be called after execute_test_module() to retrieve the results.
Note: This method does NOT depend on the module's started state. It reads
the verdict and report information directly from the test module object,
and waits (up to report_timeout seconds) for the report-generated
event if it has not fired yet. All returned data are plain Python objects
(snapshots), not live COM objects, so they remain valid after the CANoe
session ends.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Example
result = cfg.get_test_module_result("MyModule") print(f"Module: {result['test_module']}") print(f"Verdict: {result['verdict_name']}") print(f"Pass rate: {result['pass_rate']:.1f}%") print(f"Passed: {result['passed']}/{result['total']}") print(f"Report: {result['report']['generated_full_name']}") for tc in result['test_cases']: ... print(f" {tc['name']}: {tc['verdict_name']}")
Source code in src\py_canoe\core\configuration.py
756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 | |
remove_all_networks()
Remove ALL networks from the simulation setup.
CANoe requires at least one bus, so this will leave one bus remaining. Returns the number of networks actually removed.
Source code in src\py_canoe\core\configuration.py
1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 | |
remove_netWork(name)
Remove a network by name.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in src\py_canoe\core\configuration.py
1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 | |
run_compilation()
Run CAPL compilation and return success status.
Compiles all CAPL code in the current configuration. Use get_compilation_result() if you need error details.
| Returns: |
|
|---|
Example
if config.run_compilation(): ... print("Compilation OK")
Source code in src\py_canoe\core\configuration.py
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | |