Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1657635rbb; Mon, 26 Feb 2024 17:53:12 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVtPV6eanXwAJ47tO0K2YYyVO0/f5R9jSNG2EJsx6KNPE8ewy/aM7kZS7rUBHlA1HMEW4HjpnKMALCApGyHyd3j0cMN4DpZr6AkZab2Mw== X-Google-Smtp-Source: AGHT+IHocNqa9kWHugGpXd2WYlP3ocQocPZizXJMY3Nq4Ch18T13qlyev+e28i2N/e1Rdcw9H3aj X-Received: by 2002:a05:6512:370a:b0:513:124:b4a with SMTP id z10-20020a056512370a00b0051301240b4amr1520374lfr.28.1708998792498; Mon, 26 Feb 2024 17:53:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708998792; cv=pass; d=google.com; s=arc-20160816; b=j21NDKdZjySjWljDMA8itOejTsS7Kw40PiNq2tvDeUWKIQHPs8XHG9JhT6hCQ6/C97 wVRNxXIx1Uu5YrV6F8DTiAvMHxj1bc+cjuaikE7TpGC7CMGOnVXYhQj7PdD/76IEYqi4 Mv+0cCpcgx7sPsYmEAQAjPgK0/V97Z0/IYb1JFO5KVopNjaOS76zO0ZVxbjrrtBhp/LY Ywo1fa1OFCuhLhYz9hUqhf0pvTG1O54+yvj9gzHTkWvgskKMm5R4l0KBFu4dU7JHHeH7 0Hjy8sZCFGy0WDMcu7SorCliJcRi+iYySi2RE0rzEZP88jUa1fNggVWbBeSK1a2elepT /A/g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=hWGWJEv4BrNVulJ7dXLkoApOICGicAN+3bV0I2F6xKk=; fh=LkSLsbCAn07fhnT0zO1Q/DlCjd5YZCR+7m6HFNj2HBU=; b=YxR28CGT7n2HNzidT+8yfmndd3eZnY0jInFcEcopC27JeSyq8HpEJkGFSp37Buu7BY 6RCSTvgF3Ax+YcmInjerIL24wCJMYiSgorKcl4yYglhBgY/A2pt/vTavDe5OJjHoEtsN xi4CgFlO63Curae36wYaRD8YwO0bM9XG1B2G3wiNhu9cNFRlOfDdcfjf7LBYcLUMl06s EIO2VamBfItG4cyq+wrtKhaK69K7g5VSbXoeqW+wN4W2IcXRvKGQKty7d01dFSqPA5nK wFS8GQZncX+2YgwJN0J1E20U4iuj6xYNAQk2Zz6CAfxMR9C9ikHRYcwIlIxL7ADdPXJX Ix4A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=TqrPESQa; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-82568-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82568-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a16-20020a170906369000b00a3d62fb274esi260220ejc.249.2024.02.26.17.53.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 17:53:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82568-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=TqrPESQa; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-82568-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82568-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 1AD691F218AB for ; Tue, 27 Feb 2024 01:53:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CE0E6EADA; Tue, 27 Feb 2024 01:53:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="TqrPESQa" Received: from mail-yw1-f177.google.com (mail-yw1-f177.google.com [209.85.128.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7D3A85C82 for ; Tue, 27 Feb 2024 01:53:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708998784; cv=none; b=FTruiFchfsJldiBU/BqS+1vUs1G2XKbz4w1/Cdo0GLR4en/WmXfoayePrnrJDJKClB7CposttGTTs3/pH2vDwRlFxHmfx1uEqB8sr4HNfZ1qXR1uKlJ7csR2wcsmi8Q6iN4i+U76qoQX+LrOROlrwnCgOJbttFX8tWKRGtn9RQY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708998784; c=relaxed/simple; bh=luGIBaugrTyPpoxK0juMBLUHrmUxq4kEDHzWt5a+NhI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=LeYgYd865885GwboHdoFyuJaRIeyMpgxN/L+4cUhtM04BTh2d8DYjzLRhTd5RLlpNIDG3IxTD3nhxFJNsF8vnqAixWaUcLzkyh8/l3anr8kJyjDmoywVb7lk6S+nv6ARG+ofQT8z1thKdSLxEcyJUNwSxSiNJ67HsS7Yg/PlZSQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=TqrPESQa; arc=none smtp.client-ip=209.85.128.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-yw1-f177.google.com with SMTP id 00721157ae682-607bfa4c913so37535777b3.3 for ; Mon, 26 Feb 2024 17:53:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1708998781; x=1709603581; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=hWGWJEv4BrNVulJ7dXLkoApOICGicAN+3bV0I2F6xKk=; b=TqrPESQaWfH9Vh1SEyA0VWQA6Xwn8aMQugrHR8L7Sh9X9kiwyzQbqzY7dPENPmHaYP fU4CmwT/2R8cjSy645yv2qZGGyTqnm0k9Y14d+h+deAryNPzDZbO1GQOFkiDQm1fvyAQ olTvtEyF19jTZ0emJK0SO4xSLoZtwRUQBMDxoDN6FBmz5xYtzuuF9gI0cBprT/CODsry ul6RHIQU0Vo1w244Cs5Cx3XVBGITFLOO2RW9FrKozAADFoiD4uuP7GVxDTuNz0yO0SD1 s1ce3bAtVfJJkqorYKmi7H9fRqnwkW0nr4K5KGhxY3jLrka/126zd9GbgK6cCDZF9CHX eMSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708998781; x=1709603581; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hWGWJEv4BrNVulJ7dXLkoApOICGicAN+3bV0I2F6xKk=; b=U1pkoF+4Jw/9UyusAVcYc0Y6AamCrXKEp5G5dxdR1jILbEoriVZFfVRSWJEV1A5B2l I3Li1liJJaUr9tw1m9kdE08Xc+DXrkJMLny3NMXAw/lP8dhfPCHA9ytVA2JtgO+WyhVj BRWeMh7okB2YoI4JLE0jxai8uWbhfuCvbw9kdLh1N3IwPhESbYMykEffRR5oGbL7HNzS SU0jnB6jxroC9zkYjNJ9m2i6/m5vqLzdlmuybIt8rejL3kNfJV9Wkm1vsof5Wdy38Q+k GwKD4pdifuh0Vt7aGHrvGncp584HF7u/aQUOFBmX+7Q7/QkDduB3dOJCvaz1q0kBylEm XFBA== X-Forwarded-Encrypted: i=1; AJvYcCXSK6BVgEwt8/n/lBw2armOZhfwQKeff7gnmXGYv1CPdD+l6PqJNbgyouzx5zj4qxsBZdVF0678sbhNEJ7qzC3mgPhssY5ak52sE9yL X-Gm-Message-State: AOJu0Yxa+PFkBrR1Cg8oWOc0Nmb629o5Ewj/VyoiHVeOKF4vKoc//wnP 3r+wwMv4I1T1u/D0Z7+6bH+vLhHk/iPgFWvT0XjuuJhXA8dlI2diVU4+UNS5GCX+dok2JLspbSc BcE/iRdryUma3NiMENg0+QdEHpFwnA8pfoEPs X-Received: by 2002:a81:4f48:0:b0:607:8edd:b5f7 with SMTP id d69-20020a814f48000000b006078eddb5f7mr918240ywb.49.1708998781347; Mon, 26 Feb 2024 17:53:01 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240226080003.4094089-1-usama.anjum@collabora.com> In-Reply-To: <20240226080003.4094089-1-usama.anjum@collabora.com> From: "T.J. Mercier" Date: Mon, 26 Feb 2024 17:52:49 -0800 Message-ID: Subject: Re: [PATCH 1/2] selftests/dmabuf-heap: conform test to TAP format output To: Muhammad Usama Anjum Cc: Shuah Khan , kernel@collabora.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Feb 25, 2024 at 11:59=E2=80=AFPM Muhammad Usama Anjum wrote: > > Conform the layout, informational and status messages to TAP. No > functional change is intended other than the layout of output messages. > > Signed-off-by: Muhammad Usama Anjum > --- > .../selftests/dmabuf-heaps/dmabuf-heap.c | 194 +++++++----------- > 1 file changed, 77 insertions(+), 117 deletions(-) > > diff --git a/tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c b/tools/t= esting/selftests/dmabuf-heaps/dmabuf-heap.c > index 890a8236a8ba7..6e538e346cb8f 100644 > --- a/tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c > +++ b/tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c > @@ -15,6 +15,7 @@ > #include > #include > #include > +#include "../kselftest.h" > > #define DEVPATH "/dev/dma_heap" > > @@ -90,14 +91,13 @@ static int dmabuf_heap_open(char *name) > char buf[256]; > > ret =3D snprintf(buf, 256, "%s/%s", DEVPATH, name); > - if (ret < 0) { > - printf("snprintf failed!\n"); > - return ret; > - } > + if (ret < 0) > + ksft_exit_fail_msg("snprintf failed!\n"); > > fd =3D open(buf, O_RDWR); > if (fd < 0) > - printf("open %s failed!\n", buf); > + ksft_exit_fail_msg("open %s failed: %s\n", buf, strerror(= errno)); > + > return fd; > } > > @@ -140,7 +140,7 @@ static int dmabuf_sync(int fd, int start_stop) > > #define ONE_MEG (1024 * 1024) > > -static int test_alloc_and_import(char *heap_name) > +static void test_alloc_and_import(char *heap_name) > { > int heap_fd =3D -1, dmabuf_fd =3D -1, importer_fd =3D -1; > uint32_t handle =3D 0; > @@ -148,16 +148,12 @@ static int test_alloc_and_import(char *heap_name) > int ret; > > heap_fd =3D dmabuf_heap_open(heap_name); > - if (heap_fd < 0) > - return -1; > > - printf(" Testing allocation and importing: "); > + ksft_print_msg("Testing allocation and importing:\n"); > ret =3D dmabuf_heap_alloc(heap_fd, ONE_MEG, 0, &dmabuf_fd); > - if (ret) { > - printf("FAIL (Allocation Failed!)\n"); > - ret =3D -1; > - goto out; > - } > + if (ret) > + ksft_exit_fail_msg("FAIL (Allocation Failed!)\n"); > + > /* mmap and write a simple pattern */ > p =3D mmap(NULL, > ONE_MEG, > @@ -166,7 +162,7 @@ static int test_alloc_and_import(char *heap_name) > dmabuf_fd, > 0); > if (p =3D=3D MAP_FAILED) { > - printf("FAIL (mmap() failed)\n"); > + ksft_print_msg("FAIL (mmap() failed)\n"); > ret =3D -1; > goto out; > } I think you should just ksft_exit_fail_msg these too and get rid of out / not bother with manual cleanup if we're going to exit anyway. > @@ -179,31 +175,28 @@ static int test_alloc_and_import(char *heap_name) > importer_fd =3D open_vgem(); > if (importer_fd < 0) { > ret =3D importer_fd; > - printf("(Could not open vgem - skipping): "); > + ksft_test_result_skip("Could not open vgem\n"); > } else { > ret =3D import_vgem_fd(importer_fd, dmabuf_fd, &handle); > - if (ret < 0) { > - printf("FAIL (Failed to import buffer)\n"); > - goto out; > - } > + ksft_test_result(ret >=3D 0, "Import buffer\n"); > } > > ret =3D dmabuf_sync(dmabuf_fd, DMA_BUF_SYNC_START); > if (ret < 0) { > - printf("FAIL (DMA_BUF_SYNC_START failed!)\n"); > + ksft_print_msg("FAIL (DMA_BUF_SYNC_START failed!)\n"); > goto out; > } > > memset(p, 0xff, ONE_MEG); > ret =3D dmabuf_sync(dmabuf_fd, DMA_BUF_SYNC_END); > if (ret < 0) { > - printf("FAIL (DMA_BUF_SYNC_END failed!)\n"); > + ksft_print_msg("FAIL (DMA_BUF_SYNC_END failed!)\n"); > goto out; > } > > close_handle(importer_fd, handle); > - ret =3D 0; > - printf(" OK\n"); > + ksft_test_result_pass("%s\n", __func__); > + return; > out: > if (p) > munmap(p, ONE_MEG); > @@ -214,32 +207,29 @@ static int test_alloc_and_import(char *heap_name) > if (heap_fd >=3D 0) > close(heap_fd); > > - return ret; > + ksft_test_result_fail("%s\n", __func__); > } > > -static int test_alloc_zeroed(char *heap_name, size_t size) > +static void test_alloc_zeroed(char *heap_name, size_t size) > { > int heap_fd =3D -1, dmabuf_fd[32]; > int i, j, ret; > void *p =3D NULL; > char *c; > > - printf(" Testing alloced %ldk buffers are zeroed: ", size / 102= 4); > + ksft_print_msg("Testing alloced %ldk buffers are zeroed:\n", size= / 1024); > heap_fd =3D dmabuf_heap_open(heap_name); > - if (heap_fd < 0) > - return -1; > > /* Allocate and fill a bunch of buffers */ > for (i =3D 0; i < 32; i++) { > ret =3D dmabuf_heap_alloc(heap_fd, size, 0, &dmabuf_fd[i]= ); > - if (ret < 0) { > - printf("FAIL (Allocation (%i) failed)\n", i); > - goto out; > - } > + if (ret) > + ksft_exit_fail_msg("FAIL (Allocation (%i) failed)= \n", i); > + > /* mmap and fill with simple pattern */ > p =3D mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED= , dmabuf_fd[i], 0); > if (p =3D=3D MAP_FAILED) { > - printf("FAIL (mmap() failed!)\n"); > + ksft_print_msg("FAIL (mmap() failed!)\n"); > ret =3D -1; > goto out; > } > @@ -255,15 +245,13 @@ static int test_alloc_zeroed(char *heap_name, size_= t size) > /* Allocate and validate all buffers are zeroed */ > for (i =3D 0; i < 32; i++) { > ret =3D dmabuf_heap_alloc(heap_fd, size, 0, &dmabuf_fd[i]= ); > - if (ret < 0) { > - printf("FAIL (Allocation (%i) failed)\n", i); > - goto out; > - } > + if (ret < 0) > + ksft_exit_fail_msg("FAIL (Allocation (%i) failed)= \n", i); > > /* mmap and validate everything is zero */ > p =3D mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED= , dmabuf_fd[i], 0); > if (p =3D=3D MAP_FAILED) { > - printf("FAIL (mmap() failed!)\n"); > + ksft_print_msg("FAIL (mmap() failed!)\n"); > ret =3D -1; > goto out; > } > @@ -271,7 +259,7 @@ static int test_alloc_zeroed(char *heap_name, size_t = size) > c =3D (char *)p; > for (j =3D 0; j < size; j++) { > if (c[j] !=3D 0) { > - printf("FAIL (Allocated buffer not zeroed= @ %i)\n", j); > + ksft_print_msg("FAIL (Allocated buffer no= t zeroed @ %i)\n", j); > break; > } > } > @@ -283,8 +271,8 @@ static int test_alloc_zeroed(char *heap_name, size_t = size) > close(dmabuf_fd[i]); > > close(heap_fd); > - printf("OK\n"); > - return 0; > + ksft_test_result_pass("%s\n", __func__); > + return; > > out: > while (i > 0) { > @@ -292,7 +280,7 @@ static int test_alloc_zeroed(char *heap_name, size_t = size) > i--; > } > close(heap_fd); > - return ret; > + ksft_test_result_fail("%s\n", __func__); > } > > /* Test the ioctl version compatibility w/ a smaller structure then expe= cted */ > @@ -360,126 +348,98 @@ static int dmabuf_heap_alloc_newer(int fd, size_t = len, unsigned int flags, > return ret; > } > > -static int test_alloc_compat(char *heap_name) > +static void test_alloc_compat(char *heap_name) > { > - int heap_fd =3D -1, dmabuf_fd =3D -1; > - int ret; > + int ret, heap_fd =3D -1, dmabuf_fd =3D -1; > > heap_fd =3D dmabuf_heap_open(heap_name); > - if (heap_fd < 0) > - return -1; > > - printf(" Testing (theoretical)older alloc compat: "); > + ksft_print_msg("Testing (theoretical)older alloc compat:\n"); > ret =3D dmabuf_heap_alloc_older(heap_fd, ONE_MEG, 0, &dmabuf_fd); > - if (ret) { > - printf("FAIL (Older compat allocation failed!)\n"); > - ret =3D -1; > - goto out; > - } > - close(dmabuf_fd); > - printf("OK\n"); > + if (dmabuf_fd >=3D 0) > + close(dmabuf_fd); > + ksft_test_result(!ret, "dmabuf_heap_alloc_older\n"); > > - printf(" Testing (theoretical)newer alloc compat: "); > + ksft_print_msg("Testing (theoretical)newer alloc compat:\n"); > ret =3D dmabuf_heap_alloc_newer(heap_fd, ONE_MEG, 0, &dmabuf_fd); > - if (ret) { > - printf("FAIL (Newer compat allocation failed!)\n"); > - ret =3D -1; > - goto out; > - } > - printf("OK\n"); > -out: > if (dmabuf_fd >=3D 0) > close(dmabuf_fd); > - if (heap_fd >=3D 0) > - close(heap_fd); > + ksft_test_result(!ret, "dmabuf_heap_alloc_newer\n"); > > - return ret; > + close(heap_fd); > } > > -static int test_alloc_errors(char *heap_name) > +static void test_alloc_errors(char *heap_name) > { > int heap_fd =3D -1, dmabuf_fd =3D -1; > int ret; > > heap_fd =3D dmabuf_heap_open(heap_name); > - if (heap_fd < 0) > - return -1; > > - printf(" Testing expected error cases: "); > + ksft_print_msg("Testing expected error cases:\n"); > ret =3D dmabuf_heap_alloc(0, ONE_MEG, 0x111111, &dmabuf_fd); > - if (!ret) { > - printf("FAIL (Did not see expected error (invalid fd)!)\n= "); > - ret =3D -1; > - goto out; > - } > + ksft_test_result(ret, "Error expected on invalid fd\n"); > > ret =3D dmabuf_heap_alloc(heap_fd, ONE_MEG, 0x111111, &dmabuf_fd)= ; > - if (!ret) { > - printf("FAIL (Did not see expected error (invalid heap fl= ags)!)\n"); > - ret =3D -1; > - goto out; > - } > + ksft_test_result(ret, "Error expected on invalid heap flags\n"); > > ret =3D dmabuf_heap_alloc_fdflags(heap_fd, ONE_MEG, > ~(O_RDWR | O_CLOEXEC), 0, &dmabuf= _fd); > - if (!ret) { > - printf("FAIL (Did not see expected error (invalid fd flag= s)!)\n"); > - ret =3D -1; > - goto out; > - } > + ksft_test_result(ret, "Error expected on invalid heap flags\n"); > > - printf("OK\n"); > - ret =3D 0; > -out: > if (dmabuf_fd >=3D 0) > close(dmabuf_fd); > if (heap_fd >=3D 0) > close(heap_fd); > +} > > - return ret; > +static int numer_of_heaps(void) > +{ > + DIR *d =3D opendir(DEVPATH); > + struct dirent *dir; > + int heaps =3D 0; > + > + while ((dir =3D readdir(d))) { > + if (!strncmp(dir->d_name, ".", 2)) > + continue; > + if (!strncmp(dir->d_name, "..", 3)) > + continue; > + heaps++; > + } > + > + return heaps; > } > > int main(void) > { > - DIR *d; > struct dirent *dir; > - int ret =3D -1; > + DIR *d; > + > + ksft_print_header(); > > d =3D opendir(DEVPATH); > if (!d) { > - printf("No %s directory?\n", DEVPATH); > - return -1; > + ksft_print_msg("No %s directory?\n", DEVPATH); > + return KSFT_SKIP; > } > > - while ((dir =3D readdir(d)) !=3D NULL) { > + ksft_set_plan(9 * numer_of_heaps()); > + > + while ((dir =3D readdir(d))) { > if (!strncmp(dir->d_name, ".", 2)) > continue; > if (!strncmp(dir->d_name, "..", 3)) > continue; > > - printf("Testing heap: %s\n", dir->d_name); > - printf("=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); > - ret =3D test_alloc_and_import(dir->d_name); > - if (ret) > - break; > - > - ret =3D test_alloc_zeroed(dir->d_name, 4 * 1024); > - if (ret) > - break; > - > - ret =3D test_alloc_zeroed(dir->d_name, ONE_MEG); > - if (ret) > - break; > - > - ret =3D test_alloc_compat(dir->d_name); > - if (ret) > - break; > - > - ret =3D test_alloc_errors(dir->d_name); > - if (ret) > - break; > + ksft_print_msg("Testing heap: %s\n", dir->d_name); > + ksft_print_msg("=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D\n"); > + test_alloc_and_import(dir->d_name); > + test_alloc_zeroed(dir->d_name, 4 * 1024); > + test_alloc_zeroed(dir->d_name, ONE_MEG); > + test_alloc_compat(dir->d_name); > + test_alloc_errors(dir->d_name); > } > closedir(d); > > - return ret; > + ksft_finished(); > } > -- > 2.42.0 > >