X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=formats%2Fctf%2Fmetadata%2Fctf-parser-test.c;fp=formats%2Fctf%2Fmetadata%2Fctf-parser-test.c;h=0000000000000000000000000000000000000000;hp=fed85f11466933e5eb592d30842ea98e943345e6;hb=dc3fffef7b84cc4af1a7c99828fd57a106cd2257;hpb=f3985ab106d89d8e764c1a8dd0c8bda09b755d10 diff --git a/formats/ctf/metadata/ctf-parser-test.c b/formats/ctf/metadata/ctf-parser-test.c deleted file mode 100644 index fed85f11..00000000 --- a/formats/ctf/metadata/ctf-parser-test.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include -#include -#include -#include -#include -#include -#include -#include "ctf-scanner.h" -#include "ctf-parser.h" -#include "ctf-ast.h" - -bool babeltrace_verbose, babeltrace_debug; - -int main(int argc, char **argv) -{ - struct ctf_scanner *scanner; - struct ctf_trace *trace; - int ret = 0; - - babeltrace_debug = 1; - babeltrace_verbose = 1; - scanner = ctf_scanner_alloc(); - if (!scanner) { - fprintf(stderr, "Error allocating scanner\n"); - return -ENOMEM; - } - ret = ctf_scanner_append_ast(scanner, stdin); - if (ret) { - fprintf(stderr, "Error creating AST\n"); - goto end; - } - - ret = ctf_visitor_print_xml(stderr, 0, &scanner->ast->root); - if (ret) { - fprintf(stderr, "Error visiting AST for XML output\n"); - goto end; - } - - ret = ctf_visitor_semantic_check(stderr, 0, &scanner->ast->root); - if (ret) { - fprintf(stderr, "Error in CTF semantic validation %d\n", ret); - goto end; - } - trace = malloc(sizeof(*trace)); - memset(trace, 0, sizeof(*trace)); - ret = ctf_visitor_construct_metadata(stderr, 0, &scanner->ast->root, - trace, BYTE_ORDER); - if (ret) { - fprintf(stderr, "Error in CTF metadata constructor %d\n", ret); - goto free_trace; - } -free_trace: - free(trace); -end: - ctf_scanner_free(scanner); - return ret; -}