Skip to content

Commit b5f2374

Browse files
committed
Add a test schema, and the schema status page script
build_all.sh builds many schemas. It creates a summary in markdown syntax suitable for upload to the scl wiki, with links to stderr output expr-src-aggregate.exp is a small schema that fedex_plus fails on
1 parent 419f8f8 commit b5f2374

File tree

2 files changed

+171
-0
lines changed

2 files changed

+171
-0
lines changed

data/buggy/expr-src-aggregate.exp

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
-- $ ../bin/fedex_plus ../../data/test_schema.exp
2+
-- ../../data/test_schema.exp:34: --ERROR: Query expression source must be an aggregate.
3+
-- Errors in input
4+
5+
SCHEMA aggregate_error_schema;
6+
7+
ENTITY representation_item
8+
SUPERTYPE OF (ONEOF (binary_representation_item, compound_representation_item));
9+
name : label;
10+
--WHERE
11+
-- WR1 : SIZEOF(using_representations(SELF)) > 0;
12+
END_ENTITY;
13+
14+
TYPE list_representation_item = LIST [1:?] OF representation_item;
15+
END_TYPE;
16+
17+
TYPE set_representation_item = SET [1:?] OF representation_item;
18+
END_TYPE;
19+
20+
TYPE compound_item_definition = SELECT (
21+
list_representation_item,
22+
set_representation_item);
23+
END_TYPE;
24+
25+
ENTITY compound_representation_item
26+
SUPERTYPE OF (ONEOF (point_and_vector, table_representation_item))
27+
SUBTYPE OF (representation_item);
28+
item_element : compound_item_definition;
29+
END_ENTITY;
30+
31+
ENTITY table_representation_item
32+
SUBTYPE OF (compound_representation_item);
33+
WHERE
34+
WR1 : SIZEOF(QUERY(itet <* SELF\compound_representation_item.item_element |
35+
NOT('TEST_SCHEMA.ROW_REPRESENTATION_ITEM' IN TYPEOF(itet))
36+
)) = 0;
37+
END_ENTITY;
38+
39+
40+
41+
--
42+
43+
ENTITY row_representation_item
44+
SUBTYPE OF (compound_representation_item);
45+
SELF\compound_representation_item.item_element : list_representation_item;
46+
END_ENTITY;
47+
48+
49+
ENTITY binary_representation_item
50+
SUBTYPE OF (representation_item);
51+
binary_value : BINARY;
52+
END_ENTITY;
53+
54+
ENTITY point_and_vector
55+
SUBTYPE OF (compound_representation_item); --, geometric_representation_item);
56+
SELF\compound_representation_item.item_element : point_and_vector_members;
57+
END_ENTITY;
58+
59+
TYPE point_and_vector_members = LIST [2:3] OF identifier;
60+
END_TYPE;
61+
62+
TYPE label = STRING;
63+
END_TYPE;
64+
65+
TYPE identifier = STRING;
66+
END_TYPE;
67+
68+
END_SCHEMA;

misc/wiki-scripts/build_all.sh

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
#!/bin/sh
2+
3+
out_dir="wiki-dir"
4+
matrix_file="$out_dir/Schema-build-matrix.md"
5+
mk="make -j4"
6+
7+
#count warnings and errors, append to $matrix_file
8+
function count_we {
9+
echo "<tr><td><b>$1</b></td>" >>$matrix_file
10+
echo "<td><font color="blue">0 warnings</font></td>" >>$matrix_file
11+
echo "<td><font color="red">0 errors</font></td><td>" >>$matrix_file
12+
if [ -s $2 ]; then
13+
echo "<td><font color="blue">`grep -ci warning $2` warnings</font></td>" >>$matrix_file
14+
echo "<td><font color="red">`grep -ci error $2` errors</font></td><td>" >>$matrix_file
15+
echo -n "<a href=" >>$matrix_file
16+
echo $2 | sed -e "s/^\(fedex.*\)\.txt\s*$/\1.md/;" >>$matrix_file
17+
echo ">full text</a>" >>$matrix_file
18+
else
19+
if [ -f $2 ]; then
20+
rm $2
21+
fi
22+
fi
23+
echo "</td></tr>" >>$matrix_file
24+
}
25+
26+
#make fedex warnings and errors pretty
27+
function fedex_details {
28+
(
29+
i="$out_dir/fedex_$1_stderr.txt"
30+
w=`sed -ne 's|^.*:\([0-9]\+\): WARNING: \(.*\)$|<tr><td>\1</td><td>\2</td></tr>|p;' $i`
31+
e=`sed -ne 's|^.*:\([0-9]\+\): --ERROR: \(.*\)$|<tr><td>\1</td><td>\2</td></tr>|p;' $i`
32+
if [ "x$w" != "x" ]; then
33+
echo "<table width=100%><tr><td><font color="blue">fedex_plus warnings</font></td></tr><tr><td><table width=100%>"
34+
echo "<tr><th>Line</th><th>Message</th>$w</table></td></tr></table>"
35+
fi
36+
if [ "x$e" != "x" ]; then
37+
echo "<table width=100%><tr><td><font color="red">fedex_plus errors</font></td></tr><tr><td><table width=100%>"
38+
echo "<tr><th>Line</th><th>Message</th>$e</table></td></tr></table>"
39+
fi
40+
o=`sed -e 's|^.*:[0-9]\+: WARNING: .*$||g;' -e 's|^.*:[0-9]\+: --ERROR: .*$||g;' $i`
41+
if [ "x$e" != "x" ]; then
42+
echo "<br><h3>Other text in file</h3>"
43+
echo "<pre>"
44+
echo $o
45+
echo "</pre>"
46+
fi
47+
) >$out_dir/fedex_$1_stderr.md
48+
}
49+
50+
function build_one {
51+
#set $i to the schema name, all caps (to match fedex_plus output)
52+
i=`sed -ne '0,/^\s*SCHEMA/s/^.*SCHEMA\s\+\(.*\);.*$/\1/p;' $1|tr a-z A-Z`
53+
54+
echo "Running fedex_plus for $i..."
55+
make -f data/CMakeFiles/sdai_$i.dir/build.make $i/compstructs.cc >/dev/null 2>"$out_dir/fedex_"$i"_stderr.txt" >"$out_dir/fedex_"$i"_stdout.txt" && \
56+
$mk sdai_$i >/dev/null 2>"$out_dir/compile_libsdai_"$i"_stderr.txt" && \
57+
$mk p21read_sdai_$i >/dev/null 2>"$out_dir/compile_p21read_sdai_"$i"_stderr.txt"
58+
59+
#todo: test p21read_sdai_$i
60+
61+
#create a table for this schema in the markdown file
62+
echo "<tr><td><table width=100%><tr><th>Schema $i</th></tr><tr><td>" >>$matrix_file
63+
j=`echo $1|sed -e "s|^.*/\(.*\.exp\)$|\1|;"` #j is the name of the express file
64+
echo "$j</td></tr><tr><td><table border=1>" >>$matrix_file
65+
count_we "fedex_plus (generate c++)" $out_dir/fedex_"$i"_stderr.txt
66+
count_we "gcc (compile lib)" $out_dir/compile_libsdai_"$i"_stderr.txt
67+
count_we "gcc (compile p21read)" $out_dir/compile_p21read_sdai_"$i"_stderr.txt
68+
echo "</table></td></tr>" >>$matrix_file
69+
echo "</table></td></tr>" >>$matrix_file
70+
71+
if [ -s $out_dir/fedex_"$i"_stderr.txt ]; then
72+
fedex_details $i
73+
fi
74+
}
75+
76+
schemas="../data/example/example.exp;../data/ap227/ap227.exp;../data/ap214e3/AP214E3_2010.exp;../data/select.exp;../data/ap203e2/ap203e2_mim_lf.exp;../data/ap203/203wseds.exp;../data/ifc2x3/IFC2X3_TC1.exp;../data/pdmnet.exp;../data/ifc2x4/IFC2X4_RC2.exp;/opt/step/notingit/part409cdts_wg3n2617mim_lf.exp;/opt/step/notingit/ap242_managed_model_based_3d_engineering_mim_lf.exp;/opt/step/notingit/AP224E3_wg3n1941.exp;/opt/step/notingit/AP238E2_aim_lf_20100903.exp"
77+
78+
#schemas="../data/example/example.exp;../data/ap203/203wseds.exp;../data/ap203e2/ap203e2_mim_lf.exp"
79+
80+
function build {
81+
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC_LIBS=OFF -DBUILD_SCHEMAS=$schemas
82+
83+
# build all parts of scl that are necessary for schema libs to build
84+
echo Building SCL...
85+
$mk stepeditor | grep "^Linking"
86+
$mk fedex_plus stepdai | grep "^Linking"
87+
88+
for h in `echo $schemas | sed -e 's/;/\n/g;'`
89+
do
90+
build_one $h
91+
done
92+
}
93+
94+
mkdir -p build_all && cd build_all && rm -rf * && mkdir $out_dir
95+
echo "## `date`" >$matrix_file
96+
git log --decorate=short -n1 |\
97+
head -n1 |\
98+
sed -e 's|^.*commit \([a-z0-9]\+\) .*$|### commit [\1](http://github.com/mpictor/StepClassLibrary/commit/\1)|;' >>$matrix_file
99+
echo "<table border=1>" >>$matrix_file
100+
101+
build
102+
103+
echo "</table>" >>$matrix_file

0 commit comments

Comments
 (0)