#!/usr/bin/env python3

import argparse
from gunit import GUnit

# Argument parsing
parser = argparse.ArgumentParser(description="Execute GUnit tests using a client for gdbserver GDB server.")

parser.add_argument('server_url', metavar='URL', type=str, help='Address to the gdbserver GDB server')
parser.add_argument('-d', '--destination', type=str, default='.', help='The path where the output will be generated')
parser.add_argument('test_binary', metavar='BIN', type=str, help='Path to the binary of GUnit test suite')

args = parser.parse_args()

# Actual GUnit stuff
gunit = GUnit.gdbserver(args.server_url, args.destination)
gunit.test(args.test_binary)
gunit.junit()
