<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>30975</bug_id>
          
          <creation_ts>2015-04-27 17:38:47 +0300</creation_ts>
          <short_desc>(spec %check) automatically detect whether a test has failed</short_desc>
          <delta_ts>2015-05-06 13:24:51 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>drakon</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ivan Zakharyaschev">imz</reporter>
          <assigned_to name="Ivan Zakharyaschev">imz</assigned_to>
          <cc>lav</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>151328</commentid>
    <comment_count>0</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2015-04-27 17:38:47 +0300</bug_when>
    <thetext>drakon-1.22-alt1

I can&apos;t detect automatically whether there has been a failure in the
unittests called from %check in the RPM spec.

In older versions of drakon, I grepped the output and checked whether
there are only the names of the tests there --
http://git.altlinux.org/people/imz/packages/?p=drakon.git;a=blob;f=drakon.spec;h=b26edeaacd9a60b0ebbd81145b249f023b56fc33;hb=848248d8591ae11be5e9ca29ad098f55170c4dd7#l70
.

That was needed because the exit code was 0 even if it failed (because of a not found library).

In newer versions (1.22 -- the last one which doesn&apos;t require tcl8.6),
there are tests which output something (see below), so I don&apos;t know
how to check whether all tests were successful.

We should come up with a way to check this or to modify the source code so
that it exits with different exit codes...

As for now, I have disabled %check in the RPM spec.

Executing(%check): /bin/sh -e /usr/src/tmp/rpm-tmp.13657
+ umask 022
+ /bin/mkdir -p /usr/src/RPM/BUILD
+ cd /usr/src/RPM/BUILD
+ cd drakon-1.22
+ pushd unittest/
~/RPM/BUILD/drakon-1.22/unittest ~/RPM/BUILD/drakon-1.22
+ ./unittest.tcl
+ tee check.log
flag_on_test
repeat_test
zip_test
wrap_test
invoke_test
invoke_all_test
vec2.addxy.test
swap_test
rectangles_intersect_test
rectangles_on_axis_test
touching_side_test
push_rect_test
add_border_test
hit_rectangle_test
move_rectangle_test
make_rect_test
snap_test
intervals_touch_test
intervals_intersect_test
map_test
filter_test
lfilter_test
lfilter_user_test
snap_delta_test
sql_escape_test
char_set_test
unpack_test
line_hit_box_test
box_cut_line_vertical_test
box_cut_line_horizontal_test
intersect_lines_updown_test
intersect_lines_leftright_test
contains_test
remove_test
init_cap_test
replace_extension_test
generate_structure_test
put_value_test
have_intersection_test
is_variable_test
add_range_test
append_not_empty_test
subtract_test
dict_get_safe_test
art_test
diagram: 2 rows
id 1 name jiafei description {vud boss}
id 2 name alan description {}
diagram: 2 rows
id 1 name jiafei description {vud boss}
id 2 name alan description {}
open_model_ok
create_model_ok
open_model_fail
create_model_fail
save_as_model
sql_build
apply_test
next_key_test
zoomup_test
zoomdown_test
zoom_vertices_test
diagram_info_test
undo_test
switch_to_item_test
insert_action_test
take_selection_from_shadow_test
take_shapes_from_shadow_test
change_text_test
layer_unlayer
zplace_test
add_to_canvas_test
create_prim_test
insert_delete
find_items_test
hit_test
hit_handle_test
selection_test
action_handle_test
resize_test
shadow_selection_test
to_tokens_test
find_occurences_test
find_token_occurences_test
replace_occurences_test
replace_one_test
replace_test
find_all_test
extract_auto_test
extract_auto_test2
branch_trouble
auto_test
extract_sections_test
extract_return_type_test
extract_tcl_signature_test
extract_for_test
extract_foreach_test
extract_cpp_signature_test
extract_java_signature_test
extract_java_class_test
push_test
pop_test
nsorter_test
extract_copying_test
extract_class_name_test
get_alt_item_test
nogoto_test
noggen_test
extract_tables_test
diff_array_test
parse_message_signature_test
algo2_test
after_others_test
find_common_point_test
merge.simple_test
line.arrow_test
arrow.line_test
merge.segments_test
merge.on.1.line_test
icons.touch_test
cut.simple_test
segment.cut.segment_test
lines.cut_test
get.only_test
connection_build_test
class_build_error_test
class_build_success_test
automaton_test
sm_no_branches.drn
Diagram &apos;state machine&apos; is a state machine and must be a silhouette.
    while executing
&quot;error $message&quot;
    (procedure &quot;gen::report_error&quot; line 3)
    invoked from within
&quot;gen::report_error $diagram_id &quot;&quot; $message&quot;
    (procedure &quot;bad_diagram&quot; line 3)
    invoked from within
&quot;bad_diagram $diagram_id  &quot;Diagram &apos;$name&apos; is a state machine and must
be a silhouette.&quot;&quot;
    (procedure &quot;has_branches&quot; line 15)
    invoked from within
&quot;has_branches $gdb $diagram_id&quot;
    (procedure &quot;build_machine&quot; line 12)
    invoked from within
&quot;build_machine $gdb $diagram_id $callbacks &quot;
    (procedure &quot;sma::extract_machine&quot; line 22)
    invoked from within
&quot;sma::extract_machine $gdb $callbacks &quot;
    (procedure &quot;gen_cs::generate&quot; line 7)
    invoked from within
&quot;$generator $db $gdb $filename&quot;
    (procedure &quot;p.do_generate&quot; line 8)
    invoked from within
&quot;p.do_generate $generator $language $dst_filename &quot;
state machine: Diagram &apos;state machine&apos; is a state machine and must be
a silhouette.
sm_no_receive.drn
No &apos;receive&apos; statements found.
    while executing
&quot;error $message&quot;
    (procedure &quot;gen::report_error&quot; line 3)
    invoked from within
&quot;gen::report_error $diagram_id &quot;&quot; $message&quot;
    (procedure &quot;bad_diagram&quot; line 3)
    invoked from within
&quot;bad_diagram $diagram_id  &quot;No &apos;receive&apos; statements found.&quot;&quot;
    (procedure &quot;build_machine&quot; line 9)
    invoked from within
&quot;build_machine $gdb $diagram_id $callbacks &quot;
    (procedure &quot;sma::extract_machine&quot; line 22)
    invoked from within
&quot;sma::extract_machine $gdb $callbacks &quot;
    (procedure &quot;gen_cs::generate&quot; line 7)
    invoked from within
&quot;$generator $db $gdb $filename&quot;
    (procedure &quot;p.do_generate&quot; line 8)
    invoked from within
&quot;p.do_generate $generator $language $dst_filename &quot;
state machine: No &apos;receive&apos; statements found.
sm_receive_middle.drn
A &apos;receive&apos; icon must be first in the branch.
    while executing
&quot;error $message&quot;
    (procedure &quot;gen::report_error&quot; line 3)
    invoked from within
&quot;gen::report_error $diagram_id $items $message&quot;
    (procedure &quot;bad_vertex&quot; line 9)
    invoked from within
&quot;bad_vertex $gdb $receive  &quot;A &apos;receive&apos; icon must be first in the branch.&quot;&quot;
    (procedure &quot;receives_are_first&quot; line 21)
    invoked from within
&quot;receives_are_first $gdb $receives&quot;
    (procedure &quot;build_machine&quot; line 12)
    invoked from within
&quot;build_machine $gdb $diagram_id $callbacks &quot;
    (procedure &quot;sma::extract_machine&quot; line 22)
    invoked from within
&quot;sma::extract_machine $gdb $callbacks &quot;
    (procedure &quot;gen_cs::generate&quot; line 7)
    invoked from within
&quot;$generator $db $gdb $filename&quot;
    (procedure &quot;p.do_generate&quot; line 8)
    invoked from within
&quot;p.do_generate $generator $language $dst_filename &quot;
state machine: item 98: A &apos;receive&apos; icon must be first in the branch.
sm_receive_end.drn
Exit branch should not start with a &apos;receive&apos;.
    while executing
&quot;error $message&quot;
    (procedure &quot;gen::report_error&quot; line 3)
    invoked from within
&quot;gen::report_error $diagram_id $items $message&quot;
    (procedure &quot;bad_vertex&quot; line 9)
    invoked from within
&quot;bad_vertex $gdb $header  &quot;Exit branch should not start with a &apos;receive&apos;.&quot;&quot;
    (procedure &quot;all_start_with_receive&quot; line 20)
    invoked from within
&quot;all_start_with_receive $gdb $diagram_id&quot;
    (procedure &quot;build_machine&quot; line 12)
    invoked from within
&quot;build_machine $gdb $diagram_id $callbacks &quot;
    (procedure &quot;sma::extract_machine&quot; line 22)
    invoked from within
&quot;sma::extract_machine $gdb $callbacks &quot;
    (procedure &quot;gen_cs::generate&quot; line 7)
    invoked from within
&quot;$generator $db $gdb $filename&quot;
    (procedure &quot;p.do_generate&quot; line 8)
    invoked from within
&quot;p.do_generate $generator $language $dst_filename &quot;
State machine: item 10: Exit branch should not start with a &apos;receive&apos;.
sm_no_receive_middle.drn
State branch should start with a &apos;receive&apos;.
    while executing
&quot;error $message&quot;
    (procedure &quot;gen::report_error&quot; line 3)
    invoked from within
&quot;gen::report_error $diagram_id $items $message&quot;
    (procedure &quot;bad_vertex&quot; line 9)
    invoked from within
&quot;bad_vertex $gdb $header  &quot;State branch should start with a &apos;receive&apos;.&quot;&quot;
    (procedure &quot;all_start_with_receive&quot; line 36)
    invoked from within
&quot;all_start_with_receive $gdb $diagram_id&quot;
    (procedure &quot;build_machine&quot; line 12)
    invoked from within
&quot;build_machine $gdb $diagram_id $callbacks &quot;
    (procedure &quot;sma::extract_machine&quot; line 22)
    invoked from within
&quot;sma::extract_machine $gdb $callbacks &quot;
    (procedure &quot;gen_cs::generate&quot; line 7)
    invoked from within
&quot;$generator $db $gdb $filename&quot;
    (procedure &quot;p.do_generate&quot; line 8)
    invoked from within
&quot;p.do_generate $generator $language $dst_filename &quot;
state machine: item 19: State branch should start with a &apos;receive&apos;.
+ egrep -v &apos;^[[:alnum:]_.]*$&apos; check.log
diagram: 2 rows
id 1 name jiafei description {vud boss}
id 2 name alan description {}
diagram: 2 rows
id 1 name jiafei description {vud boss}
id 2 name alan description {}
Diagram &apos;state machine&apos; is a state machine and must be a silhouette.
    while executing
&quot;error $message&quot;
    (procedure &quot;gen::report_error&quot; line 3)
    invoked from within
&quot;gen::report_error $diagram_id &quot;&quot; $message&quot;
    (procedure &quot;bad_diagram&quot; line 3)
    invoked from within
&quot;bad_diagram $diagram_id  &quot;Diagram &apos;$name&apos; is a state machine and must
be a silhouette.&quot;&quot;
    (procedure &quot;has_branches&quot; line 15)
    invoked from within
&quot;has_branches $gdb $diagram_id&quot;
    (procedure &quot;build_machine&quot; line 12)
    invoked from within
&quot;build_machine $gdb $diagram_id $callbacks &quot;
    (procedure &quot;sma::extract_machine&quot; line 22)
    invoked from within
&quot;sma::extract_machine $gdb $callbacks &quot;
    (procedure &quot;gen_cs::generate&quot; line 7)
    invoked from within
&quot;$generator $db $gdb $filename&quot;
    (procedure &quot;p.do_generate&quot; line 8)
    invoked from within
&quot;p.do_generate $generator $language $dst_filename &quot;
state machine: Diagram &apos;state machine&apos; is a state machine and must be
a silhouette.
No &apos;receive&apos; statements found.
    while executing
&quot;error $message&quot;
    (procedure &quot;gen::report_error&quot; line 3)
    invoked from within
&quot;gen::report_error $diagram_id &quot;&quot; $message&quot;
    (procedure &quot;bad_diagram&quot; line 3)
    invoked from within
&quot;bad_diagram $diagram_id  &quot;No &apos;receive&apos; statements found.&quot;&quot;
    (procedure &quot;build_machine&quot; line 9)
    invoked from within
&quot;build_machine $gdb $diagram_id $callbacks &quot;
    (procedure &quot;sma::extract_machine&quot; line 22)
    invoked from within
&quot;sma::extract_machine $gdb $callbacks &quot;
    (procedure &quot;gen_cs::generate&quot; line 7)
    invoked from within
&quot;$generator $db $gdb $filename&quot;
    (procedure &quot;p.do_generate&quot; line 8)
    invoked from within
&quot;p.do_generate $generator $language $dst_filename &quot;
state machine: No &apos;receive&apos; statements found.
A &apos;receive&apos; icon must be first in the branch.
    while executing
&quot;error $message&quot;
    (procedure &quot;gen::report_error&quot; line 3)
    invoked from within
&quot;gen::report_error $diagram_id $items $message&quot;
    (procedure &quot;bad_vertex&quot; line 9)
    invoked from within
&quot;bad_vertex $gdb $receive  &quot;A &apos;receive&apos; icon must be first in the branch.&quot;&quot;
    (procedure &quot;receives_are_first&quot; line 21)
    invoked from within
&quot;receives_are_first $gdb $receives&quot;
    (procedure &quot;build_machine&quot; line 12)
    invoked from within
&quot;build_machine $gdb $diagram_id $callbacks &quot;
    (procedure &quot;sma::extract_machine&quot; line 22)
    invoked from within
&quot;sma::extract_machine $gdb $callbacks &quot;
    (procedure &quot;gen_cs::generate&quot; line 7)
    invoked from within
&quot;$generator $db $gdb $filename&quot;
    (procedure &quot;p.do_generate&quot; line 8)
    invoked from within
&quot;p.do_generate $generator $language $dst_filename &quot;
state machine: item 98: A &apos;receive&apos; icon must be first in the branch.
Exit branch should not start with a &apos;receive&apos;.
    while executing
&quot;error $message&quot;
    (procedure &quot;gen::report_error&quot; line 3)
    invoked from within
&quot;gen::report_error $diagram_id $items $message&quot;
    (procedure &quot;bad_vertex&quot; line 9)
    invoked from within
&quot;bad_vertex $gdb $header  &quot;Exit branch should not start with a &apos;receive&apos;.&quot;&quot;
    (procedure &quot;all_start_with_receive&quot; line 20)
    invoked from within
&quot;all_start_with_receive $gdb $diagram_id&quot;
    (procedure &quot;build_machine&quot; line 12)
    invoked from within
&quot;build_machine $gdb $diagram_id $callbacks &quot;
    (procedure &quot;sma::extract_machine&quot; line 22)
    invoked from within
&quot;sma::extract_machine $gdb $callbacks &quot;
    (procedure &quot;gen_cs::generate&quot; line 7)
    invoked from within
&quot;$generator $db $gdb $filename&quot;
    (procedure &quot;p.do_generate&quot; line 8)
    invoked from within
&quot;p.do_generate $generator $language $dst_filename &quot;
State machine: item 10: Exit branch should not start with a &apos;receive&apos;.
State branch should start with a &apos;receive&apos;.
    while executing
&quot;error $message&quot;
    (procedure &quot;gen::report_error&quot; line 3)
    invoked from within
&quot;gen::report_error $diagram_id $items $message&quot;
    (procedure &quot;bad_vertex&quot; line 9)
    invoked from within
&quot;bad_vertex $gdb $header  &quot;State branch should start with a &apos;receive&apos;.&quot;&quot;
    (procedure &quot;all_start_with_receive&quot; line 36)
    invoked from within
&quot;all_start_with_receive $gdb $diagram_id&quot;
    (procedure &quot;build_machine&quot; line 12)
    invoked from within
&quot;build_machine $gdb $diagram_id $callbacks &quot;
    (procedure &quot;sma::extract_machine&quot; line 22)
    invoked from within
&quot;sma::extract_machine $gdb $callbacks &quot;
    (procedure &quot;gen_cs::generate&quot; line 7)
    invoked from within
&quot;$generator $db $gdb $filename&quot;
    (procedure &quot;p.do_generate&quot; line 8)
    invoked from within
&quot;p.do_generate $generator $language $dst_filename &quot;
state machine: item 19: State branch should start with a &apos;receive&apos;.
+ echo &apos;It seems that a test printed an error message.&apos;
It seems that a test printed an error message.
+ exit 1
error: Bad exit status from /usr/src/tmp/rpm-tmp.13657 (%check)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>151329</commentid>
    <comment_count>1</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2015-04-27 17:41:54 +0300</bug_when>
    <thetext>I&apos;ve found the answer.

The answer is in this change to unittest.tcl , which puts &quot;success&quot; at
the end -- https://github.com/stepan-mitkin/drakon_editor/commit/2473affd4eb5be5d03c390f36f557754ae472ecd#diff-c3e047f69439ee7aa529996a7e547dc5R76
.

We should switch the gear repo to refer to the new upstream Git repo, and cherry-pick that change.

(We still cannot use the latest release of drakon because it requires tcl 8.6. -- https://bugzilla.altlinux.org/show_bug.cgi?id=30407#c2 )</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>