/[eiffelstudio]/branches/eth/eve/Src/Eiffel/interface/graphical/tools/autodebug/data/es_adb_config.e
ViewVC logotype

Contents of /branches/eth/eve/Src/Eiffel/interface/graphical/tools/autodebug/data/es_adb_config.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 95332 - (show annotations)
Fri Jun 27 12:57:49 2014 UTC (5 years, 3 months ago) by maxpei
File size: 28045 byte(s)
Fixed a few bugs in AutoFix and AutoDebug.
1 note
2 description: "Summary description for {ES_ADB_CONFIG}."
3 author: ""
4 date: "$Date$"
5 revision: "$Revision$"
6
7 class
8 ES_ADB_CONFIG
9
10 inherit
11 EPA_UTILITY
12
13 feature -- Project
14
15 project: E_PROJECT
16 -- Eiffel project.
17
18 feature -- Status report
19
20 is_project_loaded: BOOLEAN
21 do
22 Result := project /= Void
23 end
24
25 is_each_session_testing_one_class: BOOLEAN
26 do
27 Result := testing_session_type = testing_session_type_one_class
28 end
29
30 is_each_session_testing_one_group: BOOLEAN
31 do
32 Result := testing_session_type = testing_session_type_one_group
33 end
34
35 is_each_session_testing_all_classes: BOOLEAN
36 do
37 Result := testing_session_type = testing_session_type_all_classes
38 end
39
40 is_starting_fixing_after_each_testing_session: BOOLEAN
41 do
42 Result := start_fixing_type = start_fixing_type_after_each_testing_session
43 end
44
45 is_starting_fixing_after_all_testing_sessions: BOOLEAN
46 do
47 Result := start_fixing_type = start_fixing_type_after_all_testing_sessions
48 end
49
50 is_starting_fixing_manually: BOOLEAN
51 do
52 Result := start_fixing_type = start_fixing_type_manually
53 end
54
55 feature -- Primitive config values
56
57 class_groups: DS_ARRAYED_LIST [STRING]
58 -- Groups of classes to be debugged.
59 do
60 if class_groups_internal = Void then
61 create class_groups_internal.make_equal (10)
62 end
63 Result := class_groups_internal
64 end
65
66 working_directory: ES_ADB_WORKING_DIRECTORY
67 -- Directory where intermediate results are to be stored.
68 do
69 if working_directory_internal = Void then
70 if project /= Void then
71 create working_directory_internal.make (default_working_directory)
72 end
73 end
74 Result := working_directory_internal
75 end
76
77 testing_session_type: INTEGER
78
79 max_session_length_for_testing: INTEGER
80
81 should_use_fixed_seed_in_testing: BOOLEAN
82
83 fixed_seed: INTEGER
84
85 start_fixing_type: INTEGER
86
87 max_session_length_for_fixing: INTEGER
88
89 max_nbr_fix_candidates: INTEGER
90
91 should_fix_implementation: BOOLEAN
92
93 should_fix_contracts: BOOLEAN
94
95 max_nbr_passing_tests: INTEGER
96
97 max_nbr_failing_tests: INTEGER
98
99 should_show_implementation_fixable: BOOLEAN
100
101 should_show_contract_fixable: BOOLEAN
102
103 should_show_not_fixable: BOOLEAN
104
105 should_show_not_yet_attempted: BOOLEAN
106
107 should_show_candidate_fix_available: BOOLEAN
108
109 should_show_candidate_fix_unavailable: BOOLEAN
110
111 should_show_candidate_fix_accepted: BOOLEAN
112
113 should_show_manually_fixed: BOOLEAN
114
115 feature -- Config value validity
116
117 is_valid_max_session_length (a_val: INTEGER): BOOLEAN
118 do
119 Result := a_val > 0
120 end
121
122 is_valid_max_nbr_fix_candidates (a_val: INTEGER): BOOLEAN
123 do
124 Result := a_val > 0
125 end
126
127 is_valid_max_nbr_tests (a_val: INTEGER): BOOLEAN
128 do
129 Result := a_val >= 0
130 end
131
132 is_valid_testing_session_type (a_val: INTEGER): BOOLEAN
133 do
134 Result := Testing_session_type_one_class <= a_val and then a_val <= Testing_session_type_all_classes
135 end
136
137 is_valid_start_fixing_type (a_type: INTEGER): BOOLEAN
138 do
139 Result := start_fixing_type_after_each_testing_session <= a_type and then a_type <= start_fixing_type_manually
140 end
141
142 feature -- Classes and groups to debug
143
144 classes_to_test_in_sessions: DS_ARRAYED_LIST [DS_HASH_SET [CLASS_C]]
145 -- Classes grouped in sessions.
146 local
147 l_class_cursor: DS_HASH_SET_CURSOR [CLASS_C]
148 l_set: DS_HASH_SET [CLASS_C]
149 l_group_cursor: DS_ARRAYED_LIST_CURSOR [STRING]
150 do
151 create Result.make_equal (32)
152
153 inspect testing_session_type
154 when testing_session_type_one_class then
155 from
156 l_class_cursor := all_classes.new_cursor
157 l_class_cursor.start
158 until
159 l_class_cursor.after
160 loop
161 create l_set.make_equal (1)
162 l_set.force (l_class_cursor.item)
163 Result.force_last (l_set)
164
165 l_class_cursor.forth
166 end
167
168 when testing_session_type_one_group then
169 from
170 l_group_cursor := class_groups.new_cursor
171 l_group_cursor.start
172 until
173 l_group_cursor.after
174 loop
175 Result.force_last (groups_to_classes.item (l_group_cursor.item))
176 l_group_cursor.forth
177 end
178
179 when testing_session_type_all_classes then
180 Result.force_last (all_classes)
181 end
182 end
183
184 all_classes: DS_HASH_SET [CLASS_C]
185 -- All classes to debug.
186 local
187 l_groups_to_classes_cursor: DS_HASH_TABLE_CURSOR [DS_HASH_SET [CLASS_C], STRING]
188 do
189 if all_classes_internal = Void then
190 create all_classes_internal.make_equal (64)
191 from
192 l_groups_to_classes_cursor := groups_to_classes.new_cursor
193 l_groups_to_classes_cursor.start
194 until
195 l_groups_to_classes_cursor.after
196 loop
197 all_classes_internal.merge (l_groups_to_classes_cursor.item)
198 l_groups_to_classes_cursor.forth
199 end
200 end
201
202 Result := all_classes_internal
203 end
204
205 all_class_names: DS_HASH_SET [STRING]
206 -- Set of names of classes to debug.
207 local
208 l_cursor: DS_HASH_SET_CURSOR [CLASS_C]
209 do
210 if all_class_names_internal = Void then
211 create all_class_names_internal.make_equal (all_classes.count * 2 + 1)
212 from
213 l_cursor := all_classes.new_cursor
214 l_cursor.start
215 until
216 l_cursor.after
217 loop
218 all_class_names_internal.force (l_cursor.item.name_in_upper)
219 l_cursor.forth
220 end
221 end
222 Result := all_class_names_internal
223 end
224
225 groups_to_classes: DS_HASH_TABLE [DS_HASH_SET [CLASS_C], STRING]
226 -- Map from group names to the set of classes in that group.
227 -- Key: group
228 -- Val: set of classes in that group.
229 do
230 if groups_to_classes_internal = Void then
231 create groups_to_classes_internal.make_equal (64)
232 end
233 Result := groups_to_classes_internal
234 end
235
236 feature{NONE} -- Groups and classes implementation
237
238 classes_in_group (a_group: STRING): DS_HASH_SET [CLASS_C]
239 --
240 require
241 a_group /= Void and then not a_group.is_empty
242 not a_group.has (' ') and then not a_group.has ('%T')
243 local
244 l_group: STRING
245 l_list: LIST [STRING]
246 l_cursor: INDEXABLE_ITERATION_CURSOR [STRING]
247 do
248 create Result.make_equal (10)
249 l_list := a_group.split (group_member_separator)
250 l_list.do_all (agent (a_member: STRING; a_classes: DS_HASH_SET [CLASS_C]) do a_classes.merge (classes_in_group_member (a_member)) end (?, Result))
251 end
252
253 classes_in_group_member (a_member: STRING): DS_HASH_SET [CLASS_C]
254 --
255 require
256 a_member /= Void and then not a_member.is_empty
257 not a_member.has (' ') and then not a_member.has ('%T')
258 local
259 l_separator_index: INTEGER
260 l_member_type, l_member_val: STRING
261 l_conf_classes: ARRAYED_LIST [CONF_CLASS]
262
263 l_list: LIST [STRING]
264 l_cursor: INDEXABLE_ITERATION_CURSOR [STRING]
265 do
266 create Result.make_equal (10)
267 if a_member.has (group_member_type_value_separator) then
268 l_separator_index := a_member.index_of (group_member_type_value_separator, 1)
269 l_member_type := a_member.substring (1, l_separator_index - 1)
270 if l_member_type.is_case_insensitive_equal_general ("cluster") then
271 l_member_val := a_member.substring (l_separator_index + 1, a_member.count)
272 if attached {CLUSTER_I} workbench.universe.group_of_name (l_member_val) as lt_cluster then
273 l_conf_classes := lt_cluster.classes.linear_representation
274 across l_conf_classes as l_conf_class_cursor loop
275 if attached {EIFFEL_CLASS_I} l_conf_class_cursor.item as lt_eiffel_class then
276 Result.force (lt_eiffel_class.compiled_class)
277 end
278 end
279 end
280 end
281 else
282 if attached first_class_starts_with_name (a_member) as lt_class then
283 Result.force (lt_class)
284 end
285 end
286 end
287
288 feature -- Modify class groups
289
290 add_class_group (a_group: STRING)
291 -- Add `a_group' to debug.
292 require
293 project /= Void
294 do
295 add_groups_to_debug_from_string (a_group)
296 end
297
298 remove_class_group (a_group: STRING)
299 -- Remove `a_group' from groups to debug.
300 require
301 project /= Void
302 a_group /= Void
303 do
304 if class_groups.has (a_group) then
305 class_groups.delete (a_group)
306 groups_to_classes.remove (a_group)
307 all_classes_internal := Void
308 all_class_names_internal := Void
309 end
310 end
311
312 remove_all_class_groups
313 -- Remove all groups to debug.
314 do
315 class_groups.wipe_out
316 groups_to_classes.wipe_out
317 all_classes_internal := Void
318 all_class_names_internal := Void
319 end
320
321 feature -- Set others
322
323 set_working_directory (a_dir: ES_ADB_WORKING_DIRECTORY)
324 require
325 a_dir /= Void
326 do
327 working_directory_internal := a_dir.twin
328 end
329
330 set_testing_session_type (a_type: INTEGER)
331 require
332 is_valid_testing_session_type (a_type)
333 do
334 testing_session_type := a_type
335 end
336
337 set_max_session_length_for_testing (a_val: INTEGER)
338 require
339 is_valid_max_session_length (a_val)
340 do
341 max_session_length_for_testing := a_val
342 end
343
344 set_use_fixed_seed_in_testing (a_flag: BOOLEAN)
345 do
346 should_use_fixed_seed_in_testing := a_flag
347 end
348
349 set_fixed_seed (a_seed: INTEGER)
350 do
351 fixed_seed := a_seed
352 end
353
354 set_start_fixing_type (a_type: INTEGER)
355 require
356 is_valid_start_fixing_type (a_type)
357 do
358 start_fixing_type := a_type
359 end
360
361 set_max_session_length_for_fixing (a_val: INTEGER)
362 require
363 is_valid_max_session_length (a_val)
364 do
365 max_session_length_for_fixing := a_val
366 end
367
368 set_max_nbr_fix_candidates (a_val: INTEGER)
369 require
370 is_valid_max_nbr_fix_candidates (a_val)
371 do
372 max_nbr_fix_candidates := a_val
373 end
374
375 set_fix_implementation (a_flag: BOOLEAN)
376 do
377 should_fix_implementation := a_flag
378 end
379
380 set_fix_contracts (a_flag: BOOLEAN)
381 do
382 should_fix_contracts := a_flag
383 end
384
385 set_max_nbr_passing_tests (a_val: INTEGER)
386 require
387 is_valid_max_nbr_tests (a_val)
388 do
389 max_nbr_passing_tests := a_val
390 end
391
392 set_max_nbr_failing_tests (a_val: INTEGER)
393 require
394 is_valid_max_nbr_tests (a_val)
395 do
396 max_nbr_failing_tests := a_val
397 end
398
399 set_show_implementation_fixable (a_flag: BOOLEAN)
400 do
401 should_show_implementation_fixable := a_flag
402 end
403
404 set_show_contract_fixable (a_flag: BOOLEAN)
405 do
406 should_show_contract_fixable := a_flag
407 end
408
409 set_show_not_fixable (a_flag: BOOLEAN)
410 do
411 should_show_not_fixable := a_flag
412 end
413
414 set_show_not_yet_attempted (a_flag: BOOLEAN)
415 do
416 should_show_not_yet_attempted := a_flag
417 end
418
419 set_show_candidate_fix_available (a_flag: BOOLEAN)
420 do
421 should_show_candidate_fix_available := a_flag
422 end
423
424 set_show_candidate_fix_unavailable (a_flag: BOOLEAN)
425 do
426 should_show_candidate_fix_unavailable := a_flag
427 end
428
429 set_show_candidate_fix_accepted (a_flag: BOOLEAN)
430 do
431 should_show_candidate_fix_accepted := a_flag
432 end
433
434 set_show_manually_fixed (a_flag: BOOLEAN)
435 do
436 should_show_manually_fixed := a_flag
437 end
438
439 feature -- Default values
440
441 initialize_default
442 -- Initialize the config using default values.
443 do
444 class_groups_internal := Void
445 working_directory_internal := Void
446 testing_session_type := default_testing_session_type
447 max_session_length_for_testing := default_max_session_length_for_testing
448 should_use_fixed_seed_in_testing := default_should_use_fixed_seed_in_testing
449 fixed_seed := default_fixed_seed
450 start_fixing_type := default_start_fixing_type
451 max_session_length_for_fixing := default_max_session_length_for_fixing
452 max_nbr_fix_candidates := default_max_nbr_fix_candidates
453 should_fix_implementation := default_should_fix_implementation
454 should_fix_contracts := default_should_fix_contracts
455 max_nbr_passing_tests := default_max_nbr_passing_tests
456 max_nbr_failing_tests := default_max_nbr_failing_tests
457
458 should_show_implementation_fixable := default_should_show_implementation_fixable
459 should_show_contract_fixable := default_should_show_contract_fixable
460 should_show_not_fixable := default_should_show_not_fixable
461
462 should_show_not_yet_attempted := default_should_show_not_yet_attempted
463 should_show_candidate_fix_available := default_should_show_candidate_fix_available
464 should_show_candidate_fix_unavailable := default_should_show_candidate_fix_unavailable
465 should_show_candidate_fix_accepted := default_should_show_candidate_fix_unavailable
466 should_show_manually_fixed := default_should_show_manually_fixed
467 end
468
469 default_working_directory: PATH
470 require
471 project /= Void
472 do
473 Result := project.project_directory.data_path.extended ("AutoDebug")
474 end
475
476 autodebug_config_path: PATH
477 require
478 project /= Void
479 do
480 Result := project.project_directory.location.extended ("AutoDebug.cfg")
481 end
482
483 feature -- Load and save
484
485 load (a_project: E_PROJECT)
486 -- Load config from project directory, if possible.
487 -- Initialize the variables to default value,
488 -- if the value is missing, or the given one is invalid.
489 require
490 a_project /= Void
491 local
492 l_path: PATH
493 l_file: PLAIN_TEXT_FILE
494 do
495 project := a_project
496
497 l_path := autodebug_config_path
498 create l_file.make_with_path (l_path)
499 initialize_default
500 if l_file.exists then
501 load_from_file (l_file)
502 end
503 end
504
505 unload
506 -- Unload the config.
507 do
508 project := Void
509 initialize_default
510 end
511
512 save
513 -- Save config to project directory.
514 require
515 project /= Void
516 local
517 l_path: PATH
518 l_file: PLAIN_TEXT_FILE
519 do
520 l_path := autodebug_config_path
521 create l_file.make_with_path (l_path)
522 save_to_file (l_file)
523 end
524
525 feature{NONE} -- Load and save implementation
526
527 load_from_file (a_file: PLAIN_TEXT_FILE)
528 --
529 require
530 project /= Void
531 a_file /= Void and then a_file.exists
532 local
533 l_line, l_head, l_value: STRING
534 l_index: INTEGER
535 l_parts: LIST [STRING]
536 l_path: PATH
537 l_dir: DIRECTORY
538 do
539 a_file.open_read
540 if a_file.is_open_read then
541 from
542 a_file.read_line
543 until
544 a_file.end_of_file
545 loop
546 l_line := a_file.last_string
547 l_index := l_line.index_of (':', 1)
548 l_head := l_line.substring (1, l_index - 1)
549 l_value:= l_line.substring (l_index + 1, l_line.count)
550
551 if l_head ~ str_class_groups_to_debug then
552 add_groups_to_debug_from_string (l_value)
553 elseif l_head ~ str_working_directory then
554 create l_path.make_from_string (l_value)
555 create l_dir.make_with_path (l_path)
556 if not l_dir.exists then
557 l_dir.recursive_create_dir
558 end
559 if l_dir.exists then
560 set_working_directory (create {ES_ADB_WORKING_DIRECTORY}.make (l_path))
561 else
562 set_working_directory (create {ES_ADB_WORKING_DIRECTORY}.make (default_working_directory))
563 end
564 elseif l_head ~ str_each_session_tests then
565 if l_value.is_integer and then is_valid_testing_session_type (l_value.to_integer) then
566 set_testing_session_type (l_value.to_integer)
567 end
568 elseif l_head ~ str_max_session_length_for_testing then
569 if l_value.is_integer and then is_valid_max_session_length (l_value.to_integer) then
570 set_max_session_length_for_testing (l_value.to_integer)
571 end
572 elseif l_head ~ str_should_usg_fixed_seed_in_testing then
573 if l_value.is_boolean then
574 set_use_fixed_seed_in_testing (l_value.to_boolean)
575 end
576 elseif l_head ~ str_fixed_seed then
577 if l_value.is_integer then
578 set_fixed_seed (l_value.to_integer)
579 end
580 elseif l_head ~ str_start_fixing then
581 if l_value.is_integer then
582 set_start_fixing_type (l_value.to_integer)
583 end
584 elseif l_head ~ str_max_session_length_for_fixing then
585 if l_value.is_integer and then is_valid_max_session_length (l_value.to_integer) then
586 set_max_session_length_for_fixing (l_value.to_integer)
587 end
588 elseif l_head ~ str_max_nbr_fix_candidates then
589 if l_value.is_integer and then is_valid_max_nbr_fix_candidates (l_value.to_integer) then
590 set_max_nbr_fix_candidates (l_value.to_integer)
591 end
592 elseif l_head ~ str_should_fix_implementation then
593 if l_value.is_boolean then
594 set_fix_implementation (l_value.to_boolean)
595 end
596 elseif l_head ~ str_should_fix_contracts then
597 if l_value.is_boolean then
598 set_fix_contracts (l_value.to_boolean)
599 end
600 elseif l_head ~ str_max_nbr_passing_tests then
601 if l_value.is_integer and then is_valid_max_nbr_tests (l_value.to_integer) then
602 set_max_nbr_passing_tests (l_value.to_integer)
603 end
604 elseif l_head ~ str_max_nbr_failing_tests then
605 if l_value.is_integer and then is_valid_max_nbr_tests (l_value.to_integer) then
606 set_max_nbr_failing_tests (l_value.to_integer)
607 end
608 elseif l_head ~ str_should_show_implementation_fixable then
609 if l_value.is_boolean then
610 set_show_implementation_fixable (l_value.to_boolean)
611 end
612 elseif l_head ~ str_should_show_contract_fixable then
613 if l_value.is_boolean then
614 set_show_contract_fixable (l_value.to_boolean)
615 end
616 elseif l_head ~ str_should_show_not_fixable then
617 if l_value.is_boolean then
618 set_show_not_fixable (l_value.to_boolean)
619 end
620 elseif l_head ~ str_should_show_not_yet_attempted then
621 if l_value.is_boolean then
622 set_show_not_yet_attempted (l_value.to_boolean)
623 end
624 elseif l_head ~ str_should_show_candidate_fix_availabe then
625 if l_value.is_boolean then
626 set_show_candidate_fix_available (l_value.to_boolean)
627 end
628 elseif l_head ~ str_should_show_candidate_fix_unavailable then
629 if l_value.is_boolean then
630 set_show_candidate_fix_unavailable (l_value.to_boolean)
631 end
632 elseif l_head ~ str_should_show_candidate_fix_accepted then
633 if l_value.is_boolean then
634 set_show_candidate_fix_accepted (l_value.to_boolean)
635 end
636 elseif l_head ~ str_should_show_manually_fixed then
637 if l_value.is_boolean then
638 set_show_manually_fixed (l_value.to_boolean)
639 end
640 end
641
642 a_file.read_line
643 end
644 a_file.close
645 end
646 end
647
648 save_to_file (a_file: PLAIN_TEXT_FILE)
649 require
650 project /= Void
651 a_file /= Void
652 local
653 l_content: STRING
654 do
655 a_file.open_write
656 if a_file.is_open_write then
657 create l_content.make (1024)
658 l_content.append (str_class_groups_to_debug)
659 l_content.append_character (key_value_separator)
660 l_content.append (groups_to_debug_to_str)
661 l_content.append_character ('%N')
662
663 l_content.append (str_working_directory)
664 l_content.append_character (key_value_separator)
665 l_content.append (working_directory.root_dir.out)
666 l_content.append_character ('%N')
667
668 l_content.append (str_each_session_tests)
669 l_content.append_character (key_value_separator)
670 l_content.append (testing_session_type.out)
671 l_content.append_character ('%N')
672
673 l_content.append (str_max_session_length_for_testing)
674 l_content.append_character (key_value_separator)
675 l_content.append (max_session_length_for_testing.out)
676 l_content.append_character ('%N')
677
678 l_content.append (str_should_usg_fixed_seed_in_testing)
679 l_content.append_character (key_value_separator)
680 l_content.append (should_use_fixed_seed_in_testing.out)
681 l_content.append_character ('%N')
682
683 l_content.append (str_fixed_seed)
684 l_content.append_character (key_value_separator)
685 l_content.append (fixed_seed.out)
686 l_content.append_character ('%N')
687
688 l_content.append (str_start_fixing)
689 l_content.append_character (key_value_separator)
690 l_content.append (start_fixing_type.out)
691 l_content.append_character ('%N')
692
693 l_content.append (str_max_session_length_for_fixing)
694 l_content.append_character (key_value_separator)
695 l_content.append (max_session_length_for_fixing.out)
696 l_content.append_character ('%N')
697
698 l_content.append (str_max_nbr_fix_candidates)
699 l_content.append_character (key_value_separator)
700 l_content.append (max_nbr_fix_candidates.out)
701 l_content.append_character ('%N')
702
703 l_content.append (str_should_fix_implementation)
704 l_content.append_character (key_value_separator)
705 l_content.append (should_fix_implementation.out)
706 l_content.append_character ('%N')
707
708 l_content.append (str_should_fix_contracts)
709 l_content.append_character (key_value_separator)
710 l_content.append (should_fix_contracts.out)
711 l_content.append_character ('%N')
712
713 l_content.append (str_max_nbr_passing_tests)
714 l_content.append_character (key_value_separator)
715 l_content.append (max_nbr_passing_tests.out)
716 l_content.append_character ('%N')
717
718 l_content.append (str_max_nbr_failing_tests)
719 l_content.append_character (key_value_separator)
720 l_content.append (max_nbr_failing_tests.out)
721 l_content.append_character ('%N')
722
723 l_content.append (str_should_show_implementation_fixable)
724 l_content.append_character (key_value_separator)
725 l_content.append (should_show_implementation_fixable.out)
726 l_content.append_character ('%N')
727
728 l_content.append (str_should_show_contract_fixable)
729 l_content.append_character (key_value_separator)
730 l_content.append (should_show_contract_fixable.out)
731 l_content.append_character ('%N')
732
733 l_content.append (str_should_show_not_fixable)
734 l_content.append_character (key_value_separator)
735 l_content.append (should_show_not_fixable.out)
736 l_content.append_character ('%N')
737
738 l_content.append (str_should_show_not_yet_attempted)
739 l_content.append_character (key_value_separator)
740 l_content.append (should_show_not_yet_attempted.out)
741 l_content.append_character ('%N')
742
743 l_content.append (str_should_show_candidate_fix_availabe)
744 l_content.append_character (key_value_separator)
745 l_content.append (should_show_candidate_fix_available.out)
746 l_content.append_character ('%N')
747
748 l_content.append (str_should_show_candidate_fix_unavailable)
749 l_content.append_character (key_value_separator)
750 l_content.append (should_show_candidate_fix_unavailable.out)
751 l_content.append_character ('%N')
752
753 l_content.append (str_should_show_candidate_fix_accepted)
754 l_content.append_character (key_value_separator)
755 l_content.append (should_show_candidate_fix_accepted.out)
756 l_content.append_character ('%N')
757
758 l_content.append (str_should_show_manually_fixed)
759 l_content.append_character (key_value_separator)
760 l_content.append (should_show_manually_fixed.out)
761 l_content.append_character ('%N')
762
763 a_file.put_string (l_content)
764 a_file.close
765 end
766 end
767
768 feature{NONE} -- String representation
769
770 add_groups_to_debug_from_string (a_str: STRING)
771 -- Added classes, whose name appears in `a_str', to `classes_to_debug'.
772 -- Ignoring the invalid class names.
773 require
774 project /= Void
775 a_str /= Void
776 local
777 l_str: STRING
778 l_list: LIST [STRING]
779 l_cursor: INDEXABLE_ITERATION_CURSOR [STRING]
780 l_class: CLASS_C
781 l_name: STRING
782 do
783 l_str := a_str.twin
784 l_str.prune_all (' ')
785 l_str.prune_all ('%T')
786 l_list := l_str.split (group_separator)
787
788 from
789 l_cursor := l_list.new_cursor
790 l_cursor.start
791 until
792 l_cursor.after
793 loop
794 l_name := l_cursor.item
795 if not l_name.is_empty and then not class_groups.has (l_name) then
796 class_groups.force_last (l_name)
797 groups_to_classes.force (classes_in_group (l_name), l_name)
798 all_classes_internal := Void
799 all_class_names_internal := Void
800 end
801
802 l_cursor.forth
803 end
804 end
805
806 groups_to_debug_to_str: STRING
807 local
808 l_cursor: DS_ARRAYED_LIST_CURSOR [STRING]
809 do
810 create Result.make (128)
811 from
812 l_cursor := class_groups.new_cursor
813 l_cursor.start
814 until
815 l_cursor.after
816 loop
817 if not Result.is_empty then
818 Result.append_character (group_separator)
819 end
820 Result.append (l_cursor.item)
821
822 l_cursor.forth
823 end
824 end
825
826 feature -- Constant
827
828 str_class_groups_to_debug: STRING = "class.groups.to.debug"
829 str_working_directory: STRING = "working.directory"
830 str_each_session_tests: STRING = "each.session.tests"
831 str_each_session_tests_one_class: STRING = "one.class"
832 str_each_session_tests_one_group: STRING = "one.group"
833 str_each_session_tests_all_classes: STRING = "all.classes"
834 str_max_session_length_for_testing: STRING = "max.session.length.for.testing"
835 str_should_usg_fixed_seed_in_testing: STRING = "should.use.fixed.seed.in.testing"
836 str_fixed_seed: STRING = "fixed.seed"
837 str_start_fixing: STRING = "start.fixing"
838 str_max_session_length_for_fixing: STRING = "max.session.length.for.fixing"
839 str_max_nbr_fix_candidates: STRING = "max.nbr.fix.candidates"
840 str_should_fix_implementation: STRING = "should.fix.implementation"
841 str_should_fix_contracts: STRING = "should.fix.contracts"
842 str_max_nbr_passing_tests: STRING = "max.nbr.passing.tests"
843 str_max_nbr_failing_tests: STRING = "max.nbr.failing.tests"
844 str_should_show_implementation_fixable: STRING = "should.show.implementation.fixable"
845 str_should_show_contract_fixable: STRING = "should.show.contract.fixable"
846 str_should_show_not_fixable: STRING = "should.show.not.fixable"
847 str_should_show_not_yet_attempted: STRING = "should.show.not.yet.attempted"
848 str_should_show_candidate_fix_availabe: STRING = "should.show.candidate.fix.available"
849 str_should_show_candidate_fix_unavailable: STRING = "should.show.candidate.fix.unavailable"
850 str_should_show_candidate_fix_accepted: STRING = "should.show.candidate.fix.accepted"
851 str_should_show_manually_fixed: STRING = "should.show.manually.fixed"
852
853 Testing_session_type_one_class: INTEGER = 1
854 Testing_session_type_one_group: INTEGER = 2
855 Testing_session_type_all_classes: INTEGER = 3
856
857 Start_fixing_type_after_each_testing_session: INTEGER = 1
858 Start_fixing_type_after_all_testing_sessions: INTEGER = 2
859 Start_fixing_type_manually: INTEGER = 3
860
861 key_value_separator: CHARACTER = ':'
862 group_separator: CHARACTER = ';'
863 group_member_separator: CHARACTER = ','
864 group_member_type_value_separator: CHARACTER = ':'
865
866 default_testing_session_type: INTEGER = 2
867 default_start_fixing_type: INTEGER = 1
868 default_max_session_length_for_testing: INTEGER = 10
869 default_should_use_fixed_seed_in_testing: BOOLEAN = False
870 default_fixed_seed: INTEGER = 0
871 default_max_session_length_for_fixing: INTEGER = 10
872 default_max_nbr_fix_candidates: INTEGER = 10
873 default_should_fix_implementation: BOOLEAN = True
874 default_should_fix_contracts: BOOLEAN = True
875 default_max_nbr_passing_tests: INTEGER = 30
876 default_max_nbr_failing_tests: INTEGER = 20
877 default_should_show_implementation_fixable: BOOLEAN = True
878 default_should_show_contract_fixable: BOOLEAN = True
879 default_should_show_not_fixable: BOOLEAN = True
880 default_should_show_not_yet_attempted: BOOLEAN = True
881 default_should_show_candidate_fix_available: BOOLEAN = True
882 default_should_show_candidate_fix_unavailable: BOOLEAN = True
883 default_should_show_candidate_fix_accepted: BOOLEAN = True
884 default_should_show_manually_fixed: BOOLEAN = True
885
886 Max_session_length_for_relaxed_testing: INTEGER = 5
887 Max_session_overhead_length: INTEGER = 5
888
889
890 feature{NONE} -- Internal
891
892 working_directory_internal: like working_directory
893 class_groups_internal: like class_groups
894 groups_to_classes_internal: like groups_to_classes
895 all_classes_internal: like all_classes
896 all_class_names_internal: like all_class_names
897
898
899 ;
900 note
901 copyright: "Copyright (c) 1984-2014, Eiffel Software"
902 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
903 licensing_options: "http://www.eiffel.com/licensing"
904 copying: "[
905 This file is part of Eiffel Software's Eiffel Development Environment.
906
907 Eiffel Software's Eiffel Development Environment is free
908 software; you can redistribute it and/or modify it under
909 the terms of the GNU General Public License as published
910 by the Free Software Foundation, version 2 of the License
911 (available at the URL listed under "license" above).
912
913 Eiffel Software's Eiffel Development Environment is
914 distributed in the hope that it will be useful, but
915 WITHOUT ANY WARRANTY; without even the implied warranty
916 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
917 See the GNU General Public License for more details.
918
919 You should have received a copy of the GNU General Public
920 License along with Eiffel Software's Eiffel Development
921 Environment; if not, write to the Free Software Foundation,
922 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
923 ]"
924 source: "[
925 Eiffel Software
926 5949 Hollister Ave., Goleta, CA 93117 USA
927 Telephone 805-685-1006, Fax 805-685-6869
928 Website http://www.eiffel.com
929 Customer support http://support.eiffel.com
930 ]"
931 end

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23