From patchwork Tue Oct 27 23:55:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 1389056 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=XfnalaTY; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CLTCt5B6Xz9sV1 for ; Wed, 28 Oct 2020 10:57:46 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1992882515; Wed, 28 Oct 2020 00:56:21 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="XfnalaTY"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0016F824D6; Wed, 28 Oct 2020 00:56:09 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qv1-xf43.google.com (mail-qv1-xf43.google.com [IPv6:2607:f8b0:4864:20::f43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 90FD3824BC for ; Wed, 28 Oct 2020 00:56:06 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qv1-xf43.google.com with SMTP id de3so1588706qvb.5 for ; Tue, 27 Oct 2020 16:56:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=E8kA8PNwoUI9NCVNAKigvsoXQvai3g7QL5MvImYUQ14=; b=XfnalaTYt2/hf5D6FZRqMsGo8RkM76t8LfM38abkwLjwGgxUwGHFCvXDAwM5Yadbb1 LTE7EETi4hV56+3EAvE2D9fsDQwvX0AoB9AD1Nep9syGTLTjZT24BWJV0vKQIkz8NHYV cd7lGaVJButUYN/i9i2/jIHAgY3LO7J6YiAybjMtqTiM3Es57SGykEvFw+39OWQeSPAQ XQRtEWQPWbdF1kZxsiY434tcmE7ijworEf+zkFcq9KGoJRsxEMlGIY9eGSPv1Elvlzly /Ohl/Sg6SXInkXg4p4Hvi0rhNSZBWRJAY6+ZWSDxDx2dXW/Rgs8UHHphrDDA67Y5PtCM vJTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=E8kA8PNwoUI9NCVNAKigvsoXQvai3g7QL5MvImYUQ14=; b=c5VVWsiYfBTZEFvM9VEZJEn5OZwbh9LMsB5asX2dIHgaovnXxh9o4flI0+g36hLKR0 SXoJk/T39i0+gWQsGfmG+q+fT0agXnUySuUKQeZ2fWEqTw1ZL/zUKjv0za5BAMmLCyXU tQUY+z/BeC0F4bRfQ3mG/DWeK6/kmbGsM/MvveV+eiskUZmuAQrwtuYJosJ6fm0I5Yp6 Y2xY4mktgN0Hzp8i7rOVy9lewifdyzMRatSGv8rYVVwOGLPx/1s33BFN4Gw2zOMneoo0 UvVObjimWWQ1ucTVStNo2qrSKbGPGFLxAivNavWsMr0SioJBoiz4yo/V3FOYb2mKKKB7 J7+A== X-Gm-Message-State: AOAM5317XCA+ry5Ziz96Sk8kMEZTG1mgO0MSfHrLXq1/iFLcq5gKzpnK VUbB+jzYoemkZmMj+gIx55IEN6D722c7bg== X-Google-Smtp-Source: ABdhPJwCrk3yGIuIf12P9UL5Msh7/ojFp18CuwJbjmDA/HVQXQUJ7j9UoxITn4FUMvHChOzcgGlZBg== X-Received: by 2002:a0c:cd0e:: with SMTP id b14mr5000352qvm.3.1603842965311; Tue, 27 Oct 2020 16:56:05 -0700 (PDT) Received: from godwin.fios-router.home (pool-108-51-35-162.washdc.fios.verizon.net. [108.51.35.162]) by smtp.gmail.com with ESMTPSA id 69sm1907543qko.48.2020.10.27.16.56.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 16:56:04 -0700 (PDT) From: Sean Anderson To: u-boot@lists.denx.de Cc: Tom Rini , Heinrich Schuchardt , Simon Glass , Sean Anderson Subject: [PATCH v4 09/22] test: log: Give tests names instead of numbers Date: Tue, 27 Oct 2020 19:55:28 -0400 Message-Id: <20201027235541.706077-10-seanga2@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201027235541.706077-1-seanga2@gmail.com> References: <20201027235541.706077-1-seanga2@gmail.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Now that the log test command is no more, we can give the log tests proper names. Signed-off-by: Sean Anderson --- (no changes since v3) Changes in v3: - New test/log/log_test.c | 48 ++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/test/log/log_test.c b/test/log/log_test.c index c5ca6dcb7a..4ac378fdad 100644 --- a/test/log/log_test.c +++ b/test/log/log_test.c @@ -72,7 +72,7 @@ static int do_check_log_entries(struct unit_test_state *uts, int flags, int min, #define check_log_entries_none() check_log_entries_flags(0) /* Check a category filter using the first category */ -int log_test_00(struct unit_test_state *uts) +int log_test_cat_allow(struct unit_test_state *uts) { enum log_category_t cat_list[] = { log_uc_cat(UCLASS_MMC), log_uc_cat(UCLASS_SPI), @@ -94,10 +94,10 @@ int log_test_00(struct unit_test_state *uts) ut_assertok(log_remove_filter("console", filt)); return 0; } -LOG_TEST_FLAGS(log_test_00, UT_TESTF_CONSOLE_REC); +LOG_TEST_FLAGS(log_test_cat_allow, UT_TESTF_CONSOLE_REC); /* Check a category filter that should block log entries */ -int log_test_02(struct unit_test_state *uts) +int log_test_cat_deny_implicit(struct unit_test_state *uts) { enum log_category_t cat_list[] = { log_uc_cat(UCLASS_MMC), LOGC_NONE, LOGC_END @@ -114,10 +114,10 @@ int log_test_02(struct unit_test_state *uts) ut_assertok(log_remove_filter("console", filt)); return 0; } -LOG_TEST_FLAGS(log_test_02, UT_TESTF_CONSOLE_REC); +LOG_TEST_FLAGS(log_test_cat_deny_implicit, UT_TESTF_CONSOLE_REC); /* Check passing and failing file filters */ -int log_test_03(struct unit_test_state *uts) +int log_test_file(struct unit_test_state *uts) { int filt; @@ -135,10 +135,10 @@ int log_test_03(struct unit_test_state *uts) ut_assertok(log_remove_filter("console", filt)); return 0; } -LOG_TEST_FLAGS(log_test_03, UT_TESTF_CONSOLE_REC); +LOG_TEST_FLAGS(log_test_file, UT_TESTF_CONSOLE_REC); /* Check a passing file filter (second in list) */ -int log_test_05(struct unit_test_state *uts) +int log_test_file_second(struct unit_test_state *uts) { int filt; @@ -152,10 +152,10 @@ int log_test_05(struct unit_test_state *uts) ut_assertok(log_remove_filter("console", filt)); return 0; } -LOG_TEST_FLAGS(log_test_05, UT_TESTF_CONSOLE_REC); +LOG_TEST_FLAGS(log_test_file_second, UT_TESTF_CONSOLE_REC); /* Check a passing file filter (middle of list) */ -int log_test_06(struct unit_test_state *uts) +int log_test_file_mid(struct unit_test_state *uts) { int filt; @@ -170,10 +170,10 @@ int log_test_06(struct unit_test_state *uts) ut_assertok(log_remove_filter("console", filt)); return 0; } -LOG_TEST_FLAGS(log_test_06, UT_TESTF_CONSOLE_REC); +LOG_TEST_FLAGS(log_test_file_mid, UT_TESTF_CONSOLE_REC); /* Check a log level filter */ -int log_test_07(struct unit_test_state *uts) +int log_test_level(struct unit_test_state *uts) { int filt; @@ -188,10 +188,10 @@ int log_test_07(struct unit_test_state *uts) ut_assertok(log_remove_filter("console", filt)); return 0; } -LOG_TEST_FLAGS(log_test_07, UT_TESTF_CONSOLE_REC); +LOG_TEST_FLAGS(log_test_level, UT_TESTF_CONSOLE_REC); /* Check two filters, one of which passes everything */ -int log_test_08(struct unit_test_state *uts) +int log_test_double(struct unit_test_state *uts) { int filt1, filt2; @@ -208,10 +208,10 @@ int log_test_08(struct unit_test_state *uts) ut_assertok(log_remove_filter("console", filt2)); return 0; } -LOG_TEST_FLAGS(log_test_08, UT_TESTF_CONSOLE_REC); +LOG_TEST_FLAGS(log_test_double, UT_TESTF_CONSOLE_REC); /* Check three filters, which together pass everything */ -int log_test_09(struct unit_test_state *uts) +int log_test_triple(struct unit_test_state *uts) { int filt1, filt2, filt3; @@ -231,9 +231,9 @@ int log_test_09(struct unit_test_state *uts) ut_assertok(log_remove_filter("console", filt3)); return 0; } -LOG_TEST_FLAGS(log_test_09, UT_TESTF_CONSOLE_REC); +LOG_TEST_FLAGS(log_test_triple, UT_TESTF_CONSOLE_REC); -int do_log_test_10(struct unit_test_state *uts) +int do_log_test_helpers(struct unit_test_state *uts) { int i; @@ -255,18 +255,18 @@ int do_log_test_10(struct unit_test_state *uts) return 0; } -int log_test_10(struct unit_test_state *uts) +int log_test_helpers(struct unit_test_state *uts) { int ret; gd->log_fmt = LOGF_TEST; - ret = do_log_test_10(uts); + ret = do_log_test_helpers(uts); gd->log_fmt = log_get_default_format(); return ret; } -LOG_TEST_FLAGS(log_test_10, UT_TESTF_CONSOLE_REC); +LOG_TEST_FLAGS(log_test_helpers, UT_TESTF_CONSOLE_REC); -int do_log_test_11(struct unit_test_state *uts) +int do_log_test_disable(struct unit_test_state *uts) { ut_assertok(console_record_reset_enable()); log_err("default\n"); @@ -282,13 +282,13 @@ int do_log_test_11(struct unit_test_state *uts) return 0; } -int log_test_11(struct unit_test_state *uts) +int log_test_disable(struct unit_test_state *uts) { int ret; gd->log_fmt = LOGF_TEST; - ret = do_log_test_10(uts); + ret = do_log_test_disable(uts); gd->log_fmt = log_get_default_format(); return ret; } -LOG_TEST_FLAGS(log_test_11, UT_TESTF_CONSOLE_REC); +LOG_TEST_FLAGS(log_test_disable, UT_TESTF_CONSOLE_REC);