X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=formats%2Fctf%2Fmetadata%2Fctf-parser-test.c;h=cfd847d016bb1641b305d3de13a58a0dc7e0d4e3;hb=7de8808cf86ee8922f261d4cd6ee91aa0fa103b1;hp=d2d4031e649ea49037236cae5feeb66d783dc0d5;hpb=34d3acc4fc9f020b0e2616a29a339b5c546a05c1;p=babeltrace.git diff --git a/formats/ctf/metadata/ctf-parser-test.c b/formats/ctf/metadata/ctf-parser-test.c index d2d4031e..cfd847d0 100644 --- a/formats/ctf/metadata/ctf-parser-test.c +++ b/formats/ctf/metadata/ctf-parser-test.c @@ -1,3 +1,21 @@ +/* + * ctf-parser-test.c + * + * Common Trace Format Parser Test + * + * Copyright 2010 - Mathieu Desnoyers + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + */ + #include #include #include @@ -10,6 +28,7 @@ extern int yydebug; int main(int argc, char **argv) { struct ctf_scanner *scanner; + int ret = 0; yydebug = 1; scanner = ctf_scanner_alloc(stdin); @@ -18,8 +37,14 @@ int main(int argc, char **argv) return -1; } ctf_scanner_append_ast(scanner); + + if (ctf_visitor_print_xml(stdout, 0, &scanner->ast->root)) { + fprintf(stderr, "error visiting AST for XML output\n"); + ret = -1; + } ctf_scanner_free(scanner); - return 0; + + return ret; }