Received: by 10.192.165.148 with SMTP id m20csp1109227imm; Wed, 2 May 2018 14:20:37 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqCmw+ZFMfifvjxArg/c2evbC5rn8HC9IeL0Ghe5TElUMoZcT9qQGdy9u3tUYDMDgG3do/e X-Received: by 2002:a17:902:7582:: with SMTP id j2-v6mr3631345pll.65.1525296037832; Wed, 02 May 2018 14:20:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525296037; cv=none; d=google.com; s=arc-20160816; b=QXL0KTtaUixIeZij6ztkYdji+CLpv0D23WXwFCeE+4Xl26VkUY7NZBq7QUPnsBFImo p3zGqng9pZRnwgTmbY2VUpAkcJtb0T+BdvOekAg5rkmonDFNdq0HmfMqly213v2VQLP6 pO3GD7Fj5IR80TU6hX4D6++Fp2n6JPUf+eAjjWeQLsfBi/ygit7Inh5d0+zoyzJ4YVk8 zZgFWM4oIfrrYGiSFvM1L+BjNjsqx8O1FhzXvVFnLbj79goJhuBV1vo9aFAZzaG+NXTW +6QZdEGiqtjzZFjX4WYpP2DxzfwlafIEKtXm3Ey5fBhwI9ogBBjuFJH5dj5zS4ACDkgv 7mMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=1Z81EZys5tLuT9zvYlMKQTSGEk91LRRR97rReqL3Q34=; b=BfOtll2/CyCuqyh6JNlLWUb/X5wB8u8ejPyV6M8Z4ryszkxKUCAddkpixMr8oWbfo5 gpMESW/xvBwCYet5JiXh25ASKj9oEDCLecdE2IIIN6Ym1BU9NWo7yTfsoexXm+35/sO8 X0qXPBPTXgGJvFpYMHjaXSIJQRH56d2Klmocz/kk+kec7Pa3Oq0XM4E5cGf5C7upyF11 ssyJnC1Cj79+s+5JaeogdXKAv+G7KajQQP+Lph4QFo0KMxJeRmnD/lAvdC0hfdffNyXA xMMK4xPxpONzMt46zhIcg419FOX16YLLAOgw5qxg+2qkLup2jGj8ZLTE2iCGgvGWyVnv aoPw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 68-v6si12263568pla.452.2018.05.02.14.20.23; Wed, 02 May 2018 14:20:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752062AbeEBVTt (ORCPT + 99 others); Wed, 2 May 2018 17:19:49 -0400 Received: from mailout.easymail.ca ([64.68.200.34]:53286 "EHLO mailout.easymail.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751935AbeEBVTo (ORCPT ); Wed, 2 May 2018 17:19:44 -0400 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id 2E31D4197A; Wed, 2 May 2018 21:19:44 +0000 (UTC) Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo03-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6hFkOcjlJcNO; Wed, 2 May 2018 21:19:44 +0000 (UTC) Received: from localhost.localdomain (c-24-9-64-241.hsd1.co.comcast.net [24.9.64.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id 1518141AF3; Wed, 2 May 2018 21:19:39 +0000 (UTC) From: "Shuah Khan (Samsung OSG)" To: shuah@kernel.org Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] selftests: mqueue: delete RUN_TESTS and EMIT_TESTS overrides Date: Wed, 2 May 2018 15:18:48 -0600 Message-Id: <20180502211848.22404-5-shuah@kernel.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180502211848.22404-1-shuah@kernel.org> References: <20180502211848.22404-1-shuah@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Delete RUN_TESTS and EMIT_TESTS overrides and use common defines in lib.mk. The overrides are in place to call mq_open_tests with queue name argument. The change to delete overrides is coupled with a change to mq_open_tests to use default queue name when it is called without one. Signed-off-by: Shuah Khan (Samsung OSG) --- tools/testing/selftests/mqueue/Makefile | 12 +---------- tools/testing/selftests/mqueue/mq_open_tests.c | 29 +++++++++++++------------- 2 files changed, 16 insertions(+), 25 deletions(-) diff --git a/tools/testing/selftests/mqueue/Makefile b/tools/testing/selftests/mqueue/Makefile index 743d3f9e5918..8a58055fc1f5 100644 --- a/tools/testing/selftests/mqueue/Makefile +++ b/tools/testing/selftests/mqueue/Makefile @@ -1,17 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 CFLAGS += -O2 LDLIBS = -lrt -lpthread -lpopt + TEST_GEN_PROGS := mq_open_tests mq_perf_tests include ../lib.mk - -override define RUN_TESTS - @$(OUTPUT)/mq_open_tests /test1 || echo "selftests: mq_open_tests [FAIL]" - @$(OUTPUT)/mq_perf_tests || echo "selftests: mq_perf_tests [FAIL]" -endef - -override define EMIT_TESTS - echo "./mq_open_tests /test1 || echo \"selftests: mq_open_tests [FAIL]\"" - echo "./mq_perf_tests || echo \"selftests: mq_perf_tests [FAIL]\"" -endef - diff --git a/tools/testing/selftests/mqueue/mq_open_tests.c b/tools/testing/selftests/mqueue/mq_open_tests.c index e0a74bd207a5..677140aa25fd 100644 --- a/tools/testing/selftests/mqueue/mq_open_tests.c +++ b/tools/testing/selftests/mqueue/mq_open_tests.c @@ -53,6 +53,7 @@ int saved_def_msgs, saved_def_msgsize, saved_max_msgs, saved_max_msgsize; int cur_def_msgs, cur_def_msgsize, cur_max_msgs, cur_max_msgsize; FILE *def_msgs, *def_msgsize, *max_msgs, *max_msgsize; char *queue_path; +char *default_queue_path = "/test1"; mqd_t queue = -1; static inline void __set(FILE *stream, int value, char *err_msg); @@ -238,27 +239,27 @@ int main(int argc, char *argv[]) struct mq_attr attr, result; if (argc != 2) { - fprintf(stderr, "Must pass a valid queue name\n\n"); - fprintf(stderr, usage, argv[0]); - exit(1); - } + printf("Using Default queue path - %s\n", default_queue_path); + queue_path = default_queue_path; + } else { /* * Although we can create a msg queue with a non-absolute path name, * unlink will fail. So, if the name doesn't start with a /, add one * when we save it. */ - if (*argv[1] == '/') - queue_path = strdup(argv[1]); - else { - queue_path = malloc(strlen(argv[1]) + 2); - if (!queue_path) { - perror("malloc()"); - exit(1); + if (*argv[1] == '/') + queue_path = strdup(argv[1]); + else { + queue_path = malloc(strlen(argv[1]) + 2); + if (!queue_path) { + perror("malloc()"); + exit(1); + } + queue_path[0] = '/'; + queue_path[1] = 0; + strcat(queue_path, argv[1]); } - queue_path[0] = '/'; - queue_path[1] = 0; - strcat(queue_path, argv[1]); } if (getuid() != 0) { -- 2.14.1