Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
yaml-cpp
Commits
2dd1cf45
"example/vscode:/vscode.git/clone" did not exist on "59f33851e959a7d2dfd02a1e7db29bb969efdaf0"
Commit
2dd1cf45
authored
May 23, 2012
by
Jesse Beder
Browse files
Added compiler flag to compile the generated tests, since gcc takes *forever* to compile them
parent
f0119757
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
test/create-emitter-tests.py
test/create-emitter-tests.py
+7
-0
test/genemittertests.h
test/genemittertests.h
+7
-0
No files found.
test/create-emitter-tests.py
View file @
2dd1cf45
...
@@ -3,6 +3,7 @@ import yaml
...
@@ -3,6 +3,7 @@ import yaml
import
hashlib
import
hashlib
NS
=
'Emitter'
NS
=
'Emitter'
DEFINE
=
'YAML_GEN_TESTS'
EVENT_COUNT
=
5
EVENT_COUNT
=
5
def
encode_stream
(
line
):
def
encode_stream
(
line
):
...
@@ -142,6 +143,7 @@ def gen_tests():
...
@@ -142,6 +143,7 @@ def gen_tests():
def
create_emitter_tests
(
out
):
def
create_emitter_tests
(
out
):
out
.
write
(
'#ifdef %s
\n
'
%
DEFINE
)
out
.
write
(
'namespace %s {
\n
'
%
NS
)
out
.
write
(
'namespace %s {
\n
'
%
NS
)
tests
=
list
(
gen_tests
())
tests
=
list
(
gen_tests
())
...
@@ -166,11 +168,16 @@ def create_emitter_tests(out):
...
@@ -166,11 +168,16 @@ def create_emitter_tests(out):
out
.
write
(
'}
\n
'
)
out
.
write
(
'}
\n
'
)
out
.
write
(
'}
\n
'
)
out
.
write
(
'}
\n
'
)
out
.
write
(
'#endif // %s
\n\n
'
%
DEFINE
)
out
.
write
(
'void RunGenEmitterTests(int& passed, int& total)
\n
'
)
out
.
write
(
'void RunGenEmitterTests(int& passed, int& total)
\n
'
)
out
.
write
(
'{
\n
'
)
out
.
write
(
'{
\n
'
)
out
.
write
(
'#ifdef %s
\n
'
%
DEFINE
)
for
test
in
tests
:
for
test
in
tests
:
out
.
write
(
' RunGenEmitterTest(&Emitter::%s, "%s", passed, total);
\n
'
%
(
test
[
'name'
],
encode
(
test
[
'name'
])))
out
.
write
(
' RunGenEmitterTest(&Emitter::%s, "%s", passed, total);
\n
'
%
(
test
[
'name'
],
encode
(
test
[
'name'
])))
out
.
write
(
'#else // %s
\n
'
%
DEFINE
)
out
.
write
(
' (void)passed; (void)total;
\n
'
)
out
.
write
(
'#endif // %s
\n
'
%
DEFINE
)
out
.
write
(
'}
\n
'
)
out
.
write
(
'}
\n
'
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
test/genemittertests.h
View file @
2dd1cf45
#ifdef YAML_GEN_TESTS
namespace
Emitter
{
namespace
Emitter
{
TEST
test02571eee35ac0cbd3777
(
YAML
::
Emitter
&
out
)
TEST
test02571eee35ac0cbd3777
(
YAML
::
Emitter
&
out
)
{
{
...
@@ -9746,8 +9747,11 @@ TEST test7adafdc8be65a5d610bf(YAML::Emitter& out)
...
@@ -9746,8 +9747,11 @@ TEST test7adafdc8be65a5d610bf(YAML::Emitter& out)
DONE
();
DONE
();
}
}
}
}
#endif // YAML_GEN_TESTS
void
RunGenEmitterTests
(
int
&
passed
,
int
&
total
)
void
RunGenEmitterTests
(
int
&
passed
,
int
&
total
)
{
{
#ifdef YAML_GEN_TESTS
RunGenEmitterTest
(
&
Emitter
::
test02571eee35ac0cbd3777
,
"test02571eee35ac0cbd3777"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
test02571eee35ac0cbd3777
,
"test02571eee35ac0cbd3777"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
test71b969ca18898d226320
,
"test71b969ca18898d226320"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
test71b969ca18898d226320
,
"test71b969ca18898d226320"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
testd69e4ea95ce6f221c6e7
,
"testd69e4ea95ce6f221c6e7"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
testd69e4ea95ce6f221c6e7
,
"testd69e4ea95ce6f221c6e7"
,
passed
,
total
);
...
@@ -10246,4 +10250,7 @@ void RunGenEmitterTests(int& passed, int& total)
...
@@ -10246,4 +10250,7 @@ void RunGenEmitterTests(int& passed, int& total)
RunGenEmitterTest
(
&
Emitter
::
testec1cdffaae8842854947
,
"testec1cdffaae8842854947"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
testec1cdffaae8842854947
,
"testec1cdffaae8842854947"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
test30727d97de63c1ad395a
,
"test30727d97de63c1ad395a"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
test30727d97de63c1ad395a
,
"test30727d97de63c1ad395a"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
test7adafdc8be65a5d610bf
,
"test7adafdc8be65a5d610bf"
,
passed
,
total
);
RunGenEmitterTest
(
&
Emitter
::
test7adafdc8be65a5d610bf
,
"test7adafdc8be65a5d610bf"
,
passed
,
total
);
#else // YAML_GEN_TESTS
(
void
)
passed
;
(
void
)
total
;
#endif // YAML_GEN_TESTS
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment