File: test-peg-parser.cpp

package info (click to toggle)
llama.cpp 8461%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 74,500 kB
  • sloc: cpp: 378,787; ansic: 55,447; python: 31,100; lisp: 12,885; sh: 6,459; objc: 1,398; javascript: 925; xml: 384; makefile: 240
file content (26 lines) | stat: -rw-r--r-- 624 bytes parent folder | download | duplicates (2)
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
#include <cstdlib>
#include <string>
#include <iostream>

#include "peg-parser/tests.h"

int main(int argc, char *argv[]) {
    testing t(std::cout);
    if (argc >= 2) {
        t.set_filter(argv[1]);
    }

    const char * verbose = getenv("LLAMA_TEST_VERBOSE");
    if (verbose) {
        t.verbose = std::string(verbose) == "1";
    }

    t.test("basic", test_basic);
    t.test("unicode", test_unicode);
    t.test("json", test_json_parser);
    t.test("gbnf", test_gbnf_generation);
    t.test("serialization", test_json_serialization);
    t.test("python-dict", test_python_dict_parser);

    return t.summary();
}