Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1488901pxb; Thu, 28 Jan 2021 19:11:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+34oXncmN+bhS8Ja551afPn6A3CfEPJkud1jS95DmUe0FTUCdeiGTDmZLtmAp6Yfj9Nhj X-Received: by 2002:a17:906:c793:: with SMTP id cw19mr2505016ejb.246.1611889875955; Thu, 28 Jan 2021 19:11:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611889875; cv=none; d=google.com; s=arc-20160816; b=ne+e1p4AnVdxOGsYIghESQRGwRpL0M1Dp3Vp+su9JHirK/l+m2PXXzJC4rhV3DEkg6 +FMCh/FIjj0IVAZY4DXI/RoRsGTOFqlcoSE3lVQfN/9G0yXoZT9Ana/4sbLJVdV0ZxZx HvOYzP8i6BU+3IjOzurO9WKGbKs+PRU9/BSbLI+kWdY1F4yKBnOTGaLlCkOOzEXMRNWm xdoEstVe+aoqVhRvKzDZrJaCwuJbpV07SXitUslbTe+FOEN40HYpj5sz6uzE/uaclcDd 7S/ODe/Ud5robOTuffKBqWUoRNsYBfUo8tcytqab0cZpcI0MhEl2M2qhh1hinNtWyJzp yzpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OKBQYxsiF/Yxl/0bRH0OqXnXLh71Bs92MecR17vq6CE=; b=aJEzrfrQXACHIRlNwy1mFS0W1A22t4RYTRUvsB8Z/30CvBy2qtdE0CnpNuPaIMVgD2 OStt7CTYIoWy4JwsnnMHmaGwjNKkmq0Digj3JNlp4SavGpB7Y6tGmGx9Ho9HITmKDRhZ 0c25v2aCfJ5gfnC6E+H74knEbnssRF5AsqzPE2HGNtRWHXnDvPubUCil9/5zaTjQMy5B b33Xp7F84oAhE2Dz3Yy9q/vUC9qHe/bU7Da9qjvugWrhPCaITXRDYnCS8fX/2sUFHIEz DCcMoZPfChFLNCNKRcYlZ5pvdnrIaLdSBtG28dVFH60dlYBZbVYy7WzHDqd2CMW+pntP +LYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YyD6yWoG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l13si4394623ejg.566.2021.01.28.19.10.51; Thu, 28 Jan 2021 19:11:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YyD6yWoG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231838AbhA2DHW (ORCPT + 99 others); Thu, 28 Jan 2021 22:07:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231755AbhA2DGl (ORCPT ); Thu, 28 Jan 2021 22:06:41 -0500 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F291AC061793 for ; Thu, 28 Jan 2021 19:05:22 -0800 (PST) Received: by mail-pl1-x62d.google.com with SMTP id d13so4493480plg.0 for ; Thu, 28 Jan 2021 19:05:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OKBQYxsiF/Yxl/0bRH0OqXnXLh71Bs92MecR17vq6CE=; b=YyD6yWoGpCJBFSxr5KRkbyz5bfteCsw39788klP5cnw03qARl97eSoGDQg8ShaHYMB +9hHYQc9rgyU5dFnO0S/zoWBhNvMGrHZszlgbWsYa8/r5YlVRp0wOe8+HZ+UwUSMS2lY yZPXNzOj1dM0/CwLm0fOF5X9rnt6C0xec6nqE4t7OMnCEqxW+vteZ0eq3EaekznrH4/Y c0th+OgCWrgUpZXQtP7vfZiFqOZP3fiO2Q+eWnlD9H/a4yIsK5oJK66xr8s3E28ZcDFP rh1/IQ9t+f4HhBcbqODmoetiQSjoK5X4ERzDst+KHYWNvCwCDiyCUuK/pvBvCQt751Hg F9BA== 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=OKBQYxsiF/Yxl/0bRH0OqXnXLh71Bs92MecR17vq6CE=; b=ClcdbHW6pJIEBYVK1lkUTIx1dORQddTKkz+kAvds36h3vkVGV2FmChDkI/TpVrT5o3 RLQmQBglFlkqQszotVqtuD6i24zH4S7qAi/Gnxm0j/c4K1914Ks+TB0GwvXoJ6GqCnfM OQXslftptZ9w6zmbdqRL8ZvOFZZ5ppe6TSGtFIDhc10cUi1BVbN62ErVewijDSXHxfQ9 084sNx9xM4g4YLwudGOt1kjkqsSmBruJ6gxFlR5SDzM1tiXgGNcL5c08knihWaGXGAvm t2uopWfqHVba+lz9g4txNUjoh3z7l25FlYrT5mqQm3xFKjFXYzEpWsXdS7DFQYhQ0hnm +1Qw== X-Gm-Message-State: AOAM530SoMty2Wel+fdKubxasDFLCHQs2JBUT6VT2JDqoM+vNixN9ypH Yl4dOB/C6Nb6H+c8on4MgyJ/3SOHBC0s5A== X-Received: by 2002:a17:902:d2c1:b029:de:7c38:f86a with SMTP id n1-20020a170902d2c1b02900de7c38f86amr2336534plc.83.1611889522041; Thu, 28 Jan 2021 19:05:22 -0800 (PST) Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id y75sm6854496pfg.119.2021.01.28.19.05.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 19:05:21 -0800 (PST) From: John Stultz To: lkml Cc: John Stultz , Shuah Khan , Brian Starkey , Sumit Semwal , Laura Abbott , Hridya Valsaraju , Suren Baghdasaryan , Sandeep Patil , Daniel Mentz , linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kselftest@vger.kernel.org Subject: [PATCH 4/5] kselftests: dmabuf-heaps: Cleanup test output Date: Fri, 29 Jan 2021 03:05:13 +0000 Message-Id: <20210129030514.1231773-4-john.stultz@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210129030514.1231773-1-john.stultz@linaro.org> References: <20210129030514.1231773-1-john.stultz@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Cleanup the test output so it is a bit easier to read Cc: Shuah Khan Cc: Brian Starkey Cc: Sumit Semwal Cc: Laura Abbott Cc: Hridya Valsaraju Cc: Suren Baghdasaryan Cc: Sandeep Patil Cc: Daniel Mentz Cc: linux-media@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: linux-kselftest@vger.kernel.org Signed-off-by: John Stultz --- .../selftests/dmabuf-heaps/dmabuf-heap.c | 44 +++++++++---------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c b/tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c index 8cedd539c7fb..d179d81e2355 100644 --- a/tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c +++ b/tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c @@ -148,16 +148,14 @@ static int test_alloc_and_import(char *heap_name) void *p = NULL; int ret; - printf("Testing heap: %s\n", heap_name); - heap_fd = dmabuf_heap_open(heap_name); if (heap_fd < 0) return -1; - printf("Allocating 1 MEG\n"); + printf(" Testing allocation and importing: "); ret = dmabuf_heap_alloc(heap_fd, ONE_MEG, 0, &dmabuf_fd); if (ret) { - printf("Allocation Failed!\n"); + printf("FAIL (Allocation Failed!)\n"); ret = -1; goto out; } @@ -169,11 +167,10 @@ static int test_alloc_and_import(char *heap_name) dmabuf_fd, 0); if (p == MAP_FAILED) { - printf("mmap() failed: %m\n"); + printf("FAIL (mmap() failed)\n"); ret = -1; goto out; } - printf("mmap passed\n"); dmabuf_sync(dmabuf_fd, DMA_BUF_SYNC_START); memset(p, 1, ONE_MEG / 2); @@ -183,33 +180,31 @@ static int test_alloc_and_import(char *heap_name) importer_fd = open_vgem(); if (importer_fd < 0) { ret = importer_fd; - printf("Failed to open vgem\n"); + printf("(Could not open vgem - skipping): "); } else { ret = import_vgem_fd(importer_fd, dmabuf_fd, &handle); if (ret < 0) { - printf("Failed to import buffer\n"); + printf("FAIL (Failed to import buffer)\n"); goto out; } - printf("import passed\n"); } ret = dmabuf_sync(dmabuf_fd, DMA_BUF_SYNC_START); if (ret < 0) { - printf("Sync start failed!\n"); + printf("FAIL (DMA_BUF_SYNC_START failed!)\n"); goto out; } memset(p, 0xff, ONE_MEG); ret = dmabuf_sync(dmabuf_fd, DMA_BUF_SYNC_END); if (ret < 0) { - printf("Sync end failed!\n"); + printf("FAIL (DMA_BUF_SYNC_END failed!)\n"); goto out; } - printf("syncs passed\n"); close_handle(importer_fd, handle); ret = 0; - + printf(" OK\n"); out: if (p) munmap(p, ONE_MEG); @@ -297,23 +292,24 @@ static int test_alloc_compat(char *heap_name) if (heap_fd < 0) return -1; - printf("Testing (theoretical)older alloc compat\n"); + printf(" Testing (theoretical)older alloc compat: "); ret = dmabuf_heap_alloc_older(heap_fd, ONE_MEG, 0, &dmabuf_fd); if (ret) { - printf("Older compat allocation failed!\n"); + printf("FAIL (Older compat allocation failed!)\n"); ret = -1; goto out; } close(dmabuf_fd); + printf("OK\n"); - printf("Testing (theoretical)newer alloc compat\n"); + printf(" Testing (theoretical)newer alloc compat: "); ret = dmabuf_heap_alloc_newer(heap_fd, ONE_MEG, 0, &dmabuf_fd); if (ret) { - printf("Newer compat allocation failed!\n"); + printf("FAIL (Newer compat allocation failed!)\n"); ret = -1; goto out; } - printf("Ioctl compatibility tests passed\n"); + printf("OK\n"); out: if (dmabuf_fd >= 0) close(dmabuf_fd); @@ -332,17 +328,17 @@ static int test_alloc_errors(char *heap_name) if (heap_fd < 0) return -1; - printf("Testing expected error cases\n"); + printf(" Testing expected error cases: "); ret = dmabuf_heap_alloc(0, ONE_MEG, 0x111111, &dmabuf_fd); if (!ret) { - printf("Did not see expected error (invalid fd)!\n"); + printf("FAIL (Did not see expected error (invalid fd)!)\n"); ret = -1; goto out; } ret = dmabuf_heap_alloc(heap_fd, ONE_MEG, 0x111111, &dmabuf_fd); if (!ret) { - printf("Did not see expected error (invalid heap flags)!\n"); + printf("FAIL (Did not see expected error (invalid heap flags)!)\n"); ret = -1; goto out; } @@ -350,12 +346,12 @@ static int test_alloc_errors(char *heap_name) ret = dmabuf_heap_alloc_fdflags(heap_fd, ONE_MEG, ~(O_RDWR | O_CLOEXEC), 0, &dmabuf_fd); if (!ret) { - printf("Did not see expected error (invalid fd flags)!\n"); + printf("FAIL (Did not see expected error (invalid fd flags)!)\n"); ret = -1; goto out; } - printf("Expected error checking passed\n"); + printf("OK\n"); ret = 0; out: if (dmabuf_fd >= 0) @@ -384,6 +380,8 @@ int main(void) if (!strncmp(dir->d_name, "..", 3)) continue; + printf("Testing heap: %s\n", dir->d_name); + printf("=======================================\n"); ret = test_alloc_and_import(dir->d_name); if (ret) break; -- 2.25.1