Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp296153lqb; Thu, 14 Mar 2024 11:24:26 -0700 (PDT) X-Forwarded-Encrypted: i=4; AJvYcCWczZU8HOEY81TulWU6xyPS8yqIG3GMXQknUrYM0Skss4GQlByWNQWla6wEiIxKhZGAHf8kQdmDA2gnuwTKDu9hCuWR1y1tZET1umuC0A== X-Google-Smtp-Source: AGHT+IECGfpwG+0E0tLHwXYVetNPUrXN8VKx5wqj/hOTXvFYxKuh392NS3harH0uhW+cN6XQdIal X-Received: by 2002:a17:90b:30c6:b0:29b:ad3a:7b01 with SMTP id hi6-20020a17090b30c600b0029bad3a7b01mr2293565pjb.46.1710440666620; Thu, 14 Mar 2024 11:24:26 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1710440666; cv=pass; d=google.com; s=arc-20160816; b=dAQunOqUiECvdWSbsL9ON7Lq0rq1ZM4EUuS827eN+REUTnmobZuzDzEdpGB4/y6R9i i+nseUlfbCRUG/zHM9uzUEg4uH4BRTzNzwswUjV7PT8w6ITd+Zm8hVo3pEpTYRjuNQgo KMaYKQlOPaoBvBmTbTImgwEWzhtVQuHFwrmVn93Vmu1nBfJByZDypJpOKmZLAh6wHHJL PSEibCtzw5xTj3sLm+WVJX3Xw4GSDyxWAVU+CB4hGjnIcXh0qnt35GVAHzkUhz8yKpXy Mpv8oo87+FFfgWWV/KrCp7HRntnn1jxGla15rqNxb1uufZuKHfjob64nIF5DQHKw32P4 buKA== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ZLFhzfdhZUwusV8AXnmOoKbPCZ//+DwsOZ8N6ZZvG00=; fh=ExGhjNQEFJgRqHmYATVc5UXZbS7abAmaHDitrfHKOuE=; b=kfBToh8BH36zhqjFHcTsXuhvFqyZkxxFpzB5EvNkD595AXVXguk1gh19TTbXBeRqHw Cler6gQ97VrKcbfelYDv6gayNsbwi9qEjlEo4E+q6UjXDgdlCmnj/SG7sF+b6IfnC8WT JQhrGT0O4j02md285z609jB82L9+o2+mqnXB1tCsyjQeCZqWq5MgR2k2/UAiLP/AucwC vg9YEttu7VGUEnim7vw4TFYjF74qnASAC0DcaqiKejSVo/67WXljAWmsXAOF6QnLPT2P 8odYTbvjZtjVp6p6jtjz0VANQ0TeJmfLoYPLop81TDp8R/EFMPbZCurm1OIluzuL82Ab BVMg==; dara=google.com ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@iki.fi header.s=lahtoruutu header.b=KaXRu9QT; arc=pass (i=2 spf=pass spfdomain=iki.fi dkim=pass dkdomain=iki.fi); spf=pass (google.com: domain of linux-bluetooth+bounces-2535-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-2535-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id t6-20020a17090ae50600b0029bac9bb071si1097955pjy.72.2024.03.14.11.24.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 11:24:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-2535-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@iki.fi header.s=lahtoruutu header.b=KaXRu9QT; arc=pass (i=2 spf=pass spfdomain=iki.fi dkim=pass dkdomain=iki.fi); spf=pass (google.com: domain of linux-bluetooth+bounces-2535-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-2535-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 470B12822AB for ; Thu, 14 Mar 2024 18:24:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D9D5777644; Thu, 14 Mar 2024 18:21:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=iki.fi header.i=@iki.fi header.b="KaXRu9QT" X-Original-To: linux-bluetooth@vger.kernel.org Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [185.185.170.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86ACE77626 for ; Thu, 14 Mar 2024 18:21:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.185.170.37 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710440500; cv=pass; b=lyyGuqiLQjMjc3ZBUgBwsX9wspIrKs9LW4np8VruAHlfa9wxz9J9br1Dfvfs8G0Z7WEG0xBgiXfEDAxOJBpCnt3bZvE5zejyFOA0iSUFKPdVkElU0SpgWD9vaYXiGCPYtVNCuw3fP8BRVrq36XhGqjyEU2BuzdzLgkha2IZr4/c= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710440500; c=relaxed/simple; bh=SI2L/BY/+xja5cZSti2rAP6ySA6EPIsm3IH0CbzMyCA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VTXtuUUVNjnyf/1kpSjW11goK7XbJHxJpI/qnX49N+IGHSph8/bA+JoE4EmzjQCkea5o4I9f+rBJwF3mZsQ7SkiaOxxB5TwXSMETupb1nHMnlG0MZdfCSeCZEqQsLU0DWIobm+hFlT5ATgIMr6UuVo3ZLTjY9191Eb8oESwOdWs= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi; spf=pass smtp.mailfrom=iki.fi; dkim=pass (2048-bit key) header.d=iki.fi header.i=@iki.fi header.b=KaXRu9QT; arc=pass smtp.client-ip=185.185.170.37 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iki.fi Received: from monolith.lan (unknown [193.138.7.198]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pav) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 4TwbLN01yrz49Pyp; Thu, 14 Mar 2024 20:21:31 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1710440492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZLFhzfdhZUwusV8AXnmOoKbPCZ//+DwsOZ8N6ZZvG00=; b=KaXRu9QTBPykDF9UJzOXiFTRKUUAC0KlvE28YGt67LvEZnIoW6zmI4ze/k3MpO1s6ILmvo v8WrevqzVPfaQMgZivwo8QjpXNd1jJXbGTs9XS1OEMSeeiEYYaUC4HYHKwRYbFjT3xBT/U zCp0VH2IyKnG7Euk5Tc7PKLmM6wNgUO3Epghmr6hJ+Xdp0ecXgoYAeU8OUKrshGwQ+/I5T eigmUC+jSAmOT/HMzXgXM5LTp6fPQBIB176c/wZMIs4kjl5fa1IRiOvwnU75vmL85VXHQd /a6L+3ta3FNC0I2fmngUPNv++3gt9RKmyDx4fXgwlmiSPm8DVzZO9Yp7WfCSGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1710440492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZLFhzfdhZUwusV8AXnmOoKbPCZ//+DwsOZ8N6ZZvG00=; b=DkHQYb3VSIBwHb+1mZIZt2eBEjw8vIpDgYJ1WCvjnLgarGGBZ1LAdFJNa/MZpp9i6E+7fE kEgSvAaxuakVrZuu98osMdn2WbJcA6Y58vp3doLRqX6+Fe4xyV338c4fYeqqfeSKK3Cm3W 8XLqilBhe/jX7WVjrnEYF00UHGM8Css6D4wawihDUGtANGIDuPsKb/Lj5tSdJkMYP8ef3/ u1ERbP+VsPx/UwtMrxr6SDRC9vakuB+VdcLiPLXmefCyTH8+tvy4FJVU4gJ2KzaGSBx5+d Cg1ktmRr6XWd0StZLUN4MAz8cJGEaTPqyKnTtTU91Xfcqg2Zo7L5z35QjVW2xA== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=pav smtp.mailfrom=pav@iki.fi ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1710440492; a=rsa-sha256; cv=none; b=XFUHNRqlGcGbmmbrPBRk3fAnF8Mc6wQWMwZGjWoGvR2wq/geks3xNufTyuBa1ufft9VRKi OusRhn/cmIV+zOe4uOan+NP/COZv+Ao3274CvvuoucFs+kxpH6xhbLlzg7VCa26Au5A5yp CerhJELkr9ZFTkjWZnH8iWu/y3KLMwBo7lhEin4dJcBw5x+q/lmeTqJxI0GBm7iNdVyhNj 2QwmqDdpg2juoIxljMiBIGT4M/zWoKjBL7PeLMIVBZG+UhfXcpRUQJEVGMGna63LN6sp2w rnQhFiTCnd/9F+8qYR7feGKPQBFTzrdqPWBEb+xL0BdAgs4K2iWRTCSK/BDfVw== From: Pauli Virtanen To: linux-bluetooth@vger.kernel.org Cc: Pauli Virtanen Subject: [PATCH BlueZ v2 6/9] shared/tester: run test with given name Date: Thu, 14 Mar 2024 20:21:15 +0200 Message-ID: X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Add option for running a single test with given name. Useful when some test names have a common prefix, so that neither -s or -p can distinguish them. --- src/shared/tester.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/shared/tester.c b/src/shared/tester.c index a1ee5b687..280f509b9 100644 --- a/src/shared/tester.c +++ b/src/shared/tester.c @@ -112,6 +112,7 @@ static gboolean option_monitor = FALSE; static gboolean option_list = FALSE; static const char *option_prefix = NULL; static const char *option_string = NULL; +static const char *option_name = NULL; struct monitor_hdr { uint16_t opcode; @@ -285,6 +286,12 @@ void tester_add_full(const char *name, const void *test_data, if (!test_func) return; + if (option_name && strcmp(name, option_name)) { + if (destroy) + destroy(user_data); + return; + } + if (option_prefix && !g_str_has_prefix(name, option_prefix)) { if (destroy) destroy(user_data); @@ -829,6 +836,8 @@ static GOptionEntry options[] = { "Enable monitor output" }, { "list", 'l', 0, G_OPTION_ARG_NONE, &option_list, "Only list the tests to be run" }, + { "name", 'n', 0, G_OPTION_ARG_STRING, &option_name, + "Run test with given name" }, { "prefix", 'p', 0, G_OPTION_ARG_STRING, &option_prefix, "Run tests matching provided prefix" }, { "string", 's', 0, G_OPTION_ARG_STRING, &option_string, -- 2.44.0