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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
|
QT += testlib scxml
CONFIG += testcase
QT += core qml
QT -= gui
TARGET = tst_scion
CONFIG += console c++11
CONFIG -= app_bundle
TEMPLATE = app
RESOURCES = ../../3rdparty/scion.qrc
SOURCES += \
tst_scion.cpp
defineReplace(nameTheNamespace) {
sn=$$relative_path($$absolute_path($$dirname(1), $$OUT_PWD),$$SCXMLS_DIR)
sn~=s/\\.txml$//
sn~=s/[^a-zA-Z_0-9]/_/
return ($$sn)
}
defineReplace(nameTheClass) {
cn = $$basename(1)
cn ~= s/\\.scxml$//
cn ~=s/\\.txml$//
cn ~= s/[^a-zA-Z_0-9]/_/
return ($$cn)
}
win32 {
QSCXMLC_DEP=$$[QT_HOST_BINS]/qscxmlc.exe
QSCXMLC_CMD=$$QSCXMLC_DEP -no-c++11
} else {
QSCXMLC_DEP=$$[QT_HOST_BINS]/qscxmlc
QSCXMLC_CMD=$$QSCXMLC_DEP
}
myscxml.commands = $$QSCXMLC_CMD -name-qobjects -oh scxml/${QMAKE_FUNC_nameTheNamespace}_${QMAKE_FILE_IN_BASE}.h -ocpp ${QMAKE_FILE_OUT} -namespace ${QMAKE_FUNC_nameTheNamespace} -classname ${QMAKE_FUNC_nameTheClass} ${QMAKE_FILE_IN}
myscxml.depends += $$QSCXMLC_DEP
myscxml.output = scxml/${QMAKE_FUNC_nameTheNamespace}_${QMAKE_FILE_IN_BASE}.cpp
myscxml.input = SCXMLS
myscxml.variable_out = SOURCES
QMAKE_EXTRA_COMPILERS += myscxml
myscxml_hdr.input = SCXMLS
myscxml_hdr.variable_out = SCXML_HEADERS
myscxml_hdr.commands = $$escape_expand(\\n)
myscxml_hdr.depends = scxml/${QMAKE_FUNC_nameTheNamespace}_${QMAKE_FILE_IN_BASE}.cpp
myscxml_hdr.output = scxml/${QMAKE_FUNC_nameTheNamespace}_${QMAKE_FILE_IN_BASE}.h
QMAKE_EXTRA_COMPILERS += myscxml_hdr
qtPrepareTool(QMAKE_MOC, moc)
#scxml_moc_source.CONFIG = no_link
scxml_moc_source.dependency_type = TYPE_C
scxml_moc_source.commands = $$QMAKE_MOC ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
scxml_moc_source.output = scxml/$${QMAKE_H_MOD_MOC}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_CPP)}
scxml_moc_source.input = SCXML_HEADERS
#scxml_moc_source.depends += $$WIN_INCLUDETEMP
scxml_moc_source.variable_out = SOURCES
silent:scxml_moc_source.commands = @echo moc ${QMAKE_FILE_IN} && $$scxml_moc_source.commands
QMAKE_EXTRA_COMPILERS += scxml_moc_source
SCXMLS_DIR += $$absolute_path($$PWD/../../3rdparty/scion-tests/scxml-test-framework/test)
ALLSCXMLS = $$files($$SCXMLS_DIR/*.scxml, true)
# <invoke>
BLACKLISTED = \
test187.txml.scxml \
test207.txml.scxml \
test215.txml.scxml \
test216.txml.scxml \
test220.txml.scxml \
test223.txml.scxml \
test224.txml.scxml \
test225.txml.scxml \
test226.txml.scxml \
test228.txml.scxml \
test229.txml.scxml \
test230.txml.scxml \
test232.txml.scxml \
test233.txml.scxml \
test234.txml.scxml \
test235.txml.scxml \
test236.txml.scxml \
test237.txml.scxml \
test238.txml.scxml \
test239.txml.scxml \
test240.txml.scxml \
test241.txml.scxml \
test242.txml.scxml \
test243.txml.scxml \
test244.txml.scxml \
test245.txml.scxml \
test247.txml.scxml \
test250.txml.scxml \
test252.txml.scxml \
test253.txml.scxml \
test276.txml.scxml \
test338.txml.scxml \
test422.txml.scxml \
test530.txml.scxml \
test554.txml.scxml
# other
BLACKLISTED += \
test301.txml.scxml \
test441a.txml.scxml \
test441b.txml.scxml \
test552.txml.scxml \
test557.txml.scxml \
test558.txml.scxml
for (f,ALLSCXMLS) {
cn = $$basename(f)
if (!contains(BLACKLISTED, $$cn)) {
SCXMLS += $$f
cn ~= s/\\.scxml$//
hn = $$cn
cn ~=s/\\.txml$//
sn = $$relative_path($$dirname(f), $$SCXMLS_DIR)
sn ~=s/[^a-zA-Z_0-9]/_/
inc_list += "$${LITERAL_HASH}include \"scxml/$${sn}_$${hn}.h\""
func_list += " []()->Scxml::StateMachine*{return new $${sn}::$${cn};},"
tn = $$relative_path($$f,$$absolute_path($$SCXMLS_DIR/../../..))
tn ~= s/\\.scxml$//
testBases += " \"$$tn\","
}
}
file_cont= \
$$inc_list \
"std::function<Scxml::StateMachine *()> creators[] = {" \
$$func_list \
"};"
write_file("scxml/compiled_tests.h", file_cont)|error("Aborting.")
testBases_cont = \
"const char *testBases[] = {" \
$$testBases \
"};"
write_file("scxml/scion.h", testBases_cont)|error("Aborting.")
load(qt_tool)
load(qscxmlc)
|