-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathtest_debug.py
More file actions
101 lines (92 loc) · 3.99 KB
/
Copy pathtest_debug.py
File metadata and controls
101 lines (92 loc) · 3.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Copyright (c) 2017-2019 The University of Manchester
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
import unittest
import spinn_front_end_common.utilities.report_functions.reports as \
reports_names
from spinn_front_end_common.utilities.report_functions.network_specification \
import _FILENAME as network_specification_file_name
from spinnaker_testbase import BaseTestCase
from spynnaker.pyNN.data import SpynnakerDataView
from spynnaker.pyNN.extra_algorithms.\
spynnaker_neuron_network_specification_report import (_GRAPH_NAME)
import pyNN.spiNNaker as sim
class TestDebug(BaseTestCase):
"""
that it does not crash in debug mode. All reports on.
"""
# NO unittest_setup() as sim.setup is called
def debug(self):
reports = [
# write_energy_report does not happen on a virtual machine
# "Detailed_energy_report.rpt",
# "energy_summary_report.rpt",
# write_text_specs = False
"data_spec_text_files",
# write_router_reports
reports_names._ROUTING_FILENAME,
# write_partitioner_reports
reports_names._PARTITIONING_FILENAME,
# write_application_graph_placer_report
reports_names._PLACEMENT_VTX_GRAPH_FILENAME,
reports_names._PLACEMENT_CORE_GRAPH_FILENAME,
reports_names._SDRAM_FILENAME,
# repeats reports_names._SDRAM_FILENAME,
# write_router_info_report
reports_names._VIRTKEY_FILENAME,
# write_routing_table_reports not on a virtual boad
# reports_names._ROUTING_TABLE_DIR,
# reports_names._C_ROUTING_TABLE_DIR,
# reports_names._COMPARED_FILENAME,
# write_routing_compression_checker_report not on a virtual board
# "routing_compression_checker_report.rpt",
# write_routing_tables_from_machine_report not on a virtual board
# routing_tables_from_machine_report,
# write_memory_map_report
# ??? used by MachineExecuteDataSpecification but not called ???
# write_network_specification_report
network_specification_file_name,
# write_provenance_data
"data.sqlite3",
# write_tag_allocation_reports
reports_names._TAGS_FILENAME,
# write_algorithm_timings
# "provenance_data/pacman.xml" = different test
# write_board_chip_report not on a virtual board
# BoardChipReport.AREA_CODE_REPORT_NAME,
# write_data_speed_up_report not on a virtual board
# DataSpeedUpPacketGatherMachineVertex.REPORT_NAME
_GRAPH_NAME,
# TODO why svg when default is png
_GRAPH_NAME + ".svg",
]
sim.setup(1.0)
pop = sim.Population(100, sim.IF_curr_exp, {}, label="pop")
pop.record("v")
inp = sim.Population(1, sim.SpikeSourceArray(
spike_times=[0]), label="input")
sim.Projection(inp, pop, sim.AllToAllConnector(),
synapse_type=sim.StaticSynapse(weight=5))
sim.run(1000)
pop.get_data("v")
sim.end()
found = os.listdir(SpynnakerDataView.get_run_dir_path())
print(found)
for report in reports:
self.assertIn(report, found)
def test_debug(self):
self.runsafe(self.debug)
if __name__ == '__main__':
unittest.main()