326a030feed43fe10bbfff4342ec613a117869af
[nit.git] / contrib / neo_doxygen / src / tests / neo_doxygen_dump.nit
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 # A variant of the `neo_doxygen` program that produces a debugging output of the graph instead of saving it.
16 #
17 # Note: The `--dest` option is ignored.
18 module tests::neo_doxygen_dump
19
20 import tests
21 import neo_doxygen
22
23 redef class Sys
24 redef fun program_name do return "%PROGRAM_NAME%"
25 end
26
27 redef class NeoDoxygenJob
28 redef fun list_files(dir) do
29 var a = super.to_a
30 default_comparator.sort(a)
31 return a
32 end
33 end
34
35 redef class NeoDoxygenCommand
36 redef fun create_store(url) do return new DebugStore
37 end
38
39 class DebugStore
40 super GraphStore
41
42 redef fun has_node_label(name) do return false
43
44 redef fun save_all(neo_entities) do
45 print ""
46 for n in neo_entities do
47 if n isa NeoEdge then
48 var buffer = new RopeBuffer
49 n.debug buffer
50 print buffer
51 end
52 end
53 print "---===DONE===---"
54 end
55 end