Commit c0149cc0 authored by Anas Nashif's avatar Anas Nashif Committed by Anas Nashif
Browse files

sanitycheck: support listing test cases



Parse all yaml file and create a list of declared testcases. This does
list the individual tests inside test projects, not only the projects
containing the tests, for example:

$ sanitycheck --list-tests  -T tests/net/socket/
 - net.socket.udp.send_recv_2_sock
 - net.socket.udp.v4_sendto_recvfrom
 - net.socket.udp.v6_sendto_recvfrom
 - net.socket.udp.v4_bind_sendto
 - net.socket.udp.v6_bind_sendto
 - net.socket.getaddrinfo_ok
 - net.socket.getaddrinfo_no_host
 - net.socket.tcp.v4_send_recv
 - net.socket.tcp.v6_send_recv
 - net.socket.tcp.v4_sendto_recvfrom
 - net.socket.tcp.v6_sendto_recvfrom
 - net.socket.tcp.v4_sendto_recvfrom_null_dest
 - net.socket.tcp.v6_sendto_recvfrom_null_dest
13 total.

Signed-off-by: default avatarAnas Nashif <anas.nashif@intel.com>
parent 7a5ff137
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -2213,6 +2213,9 @@ def parse_arguments():
    parser.add_argument("--list-tags", action="store_true",
            help="list all tags in selected tests")

    parser.add_argument("--list-tests", action="store_true",
            help="list all tests.")

    parser.add_argument(
        "-r", "--release", action="store_true",
        help="Update the benchmark database with the results of this test "
@@ -2512,6 +2515,16 @@ def main():

        return

    if options.list_tests:
        cnt = 0
        for n,tc in ts.testcases.items():
            for c in tc.cases:
                cnt = cnt + 1
                print(" - {}".format(c))

        print("{} total.".format(cnt))
        return

    discards = []
    if options.load_tests:
        ts.load_from_file(options.load_tests)