Received: by 10.192.165.148 with SMTP id m20csp5331948imm; Wed, 9 May 2018 03:21:18 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoZ9ZLTzRsDbhJqxb3Th/uFx7bJXtFMImfxYE5JVJ1xJAfAhJkSm0v3uZQU4HAfJHRaYyn4 X-Received: by 2002:a65:4648:: with SMTP id k8-v6mr36464416pgr.47.1525861278835; Wed, 09 May 2018 03:21:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525861278; cv=none; d=google.com; s=arc-20160816; b=qElseJgd+SC90bJc5IxTtU46gUqdIkcFOVzq9/H11MPX2C7NO/ja6Mg1a5jiHDs4MP Vfs1xK7kg+VmPRNhXBOKEJRfA2twS4GJdrr7tXv4P5MBvjFmLmu2xWvWIhgAf6ZnuvjX TK2czPS6YtIvnhnz2sQBGtAKitztt94KV6/ZJBYhjFA1HvzFm+Ycl/Vx5fhoGWpqPbO2 gciGZZIk2geeVXNvHLW38mzYwWSAHKRayphU3ouaSKOOCRJLIFcUbnytlOtA4wMI4PQB qH/ujAjhxEkaBf58BoGo0qN9g8U5fmNB86f84z+fbtZhw7lz/Rzk1GaREY/Z07Qcqwde GVZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=2mG2oHzgbat77zGuc2k01eS9d5xOh9GQ6+q8lbGzWhY=; b=Rt9s7B2pP5DcyugPX1E4tVxukMkc+ce4Fl37cg2TS+/JGgzghDX91W8Wq3eDemuOy1 qfcVaMugc8zwtqxdBUgn8tzxwVojsWn62BzlD6YfRjLVWkdbZhlb9NwZI9xRykokKnXM djvmaZIn9joWBc68kPfvOL/Guvz9H+I7m+5yS67w5WNcBtLDMgVuY0dQ/iKeQkHs3N3p +NUNwN51A5/trVxO0VJpihIFcZBVf7MS4ZW6Oz3hD6yz5hVaJ8qHmGaz9tWEc2PO71VS RkjRln9J1l2EQmAekVuvFt14gHeE+xP/hp05337ZTqTfhUm7O6+m9NltJMstxp7kF9x1 NMkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bOX2wwC6; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s16-v6si9367037pgo.89.2018.05.09.03.21.04; Wed, 09 May 2018 03:21:18 -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; dkim=pass header.i=@linaro.org header.s=google header.b=bOX2wwC6; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934129AbeEIKTq (ORCPT + 99 others); Wed, 9 May 2018 06:19:46 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:42415 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932215AbeEIKTo (ORCPT ); Wed, 9 May 2018 06:19:44 -0400 Received: by mail-lf0-f65.google.com with SMTP id u21-v6so50165390lfu.9 for ; Wed, 09 May 2018 03:19:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=2mG2oHzgbat77zGuc2k01eS9d5xOh9GQ6+q8lbGzWhY=; b=bOX2wwC6Fw5RSfy73PSl7vbdC28AENzVb+uPeT1UuvWOPvvXz0JgqExInwxTrXxsTX 3xPhjcdRKNmV5gsEoFhueFcMOff+slACf6ryR6n4EmGEBxV4iQla7PSy7l9kD7rJ21uY kDEE4WBAXX1fiJ74iMfN4jTSEsTsPEXYOeJLY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=2mG2oHzgbat77zGuc2k01eS9d5xOh9GQ6+q8lbGzWhY=; b=pcto6J5PTkw/pd/m1RfeJoTdP3L0FbMZ/ESWgerjy/LUcaTiJgU6RVffN1h+5XQbYc EUo/Py5fGBAH/hrfjTCpwXVpaN53u4RwCAAHVeByBrUJzHWn2zENqDMYuqT4l7Cl6fed 8aOZRSn1+lWXa5km6pfK2k1y6F+RxYYWTlynCV5P3nSGdH0SBSN5W3uyiVLZ33jkE72W E5J4pL0QbkpC3wk+UdsEjeZ7wNWGdLDNfBUfFvMRTEl2zIre1ea/d6c1Pb7BYpT3HlnQ k52S7/p78LBAZ7xM5kDtI5LNMERjX+zmGUPgzZ8zvPLOHNM8V5Jlxs45HsR1sMX2XmnJ b+Gg== X-Gm-Message-State: ALKqPweg6H1KuIxave6/aomCDiGO45ol4CnSPxU0BC4Z5e4Ar47OlK2T ODEO3qY5UqVbghSq8A7yY0i9/g== X-Received: by 2002:a19:10e1:: with SMTP id 94-v6mr7814582lfq.145.1525861183260; Wed, 09 May 2018 03:19:43 -0700 (PDT) Received: from localhost.localdomain (c-2c3d70d5.07-21-73746f28.cust.bredbandsbolaget.se. [213.112.61.44]) by smtp.gmail.com with ESMTPSA id j9-v6sm2896541ljc.5.2018.05.09.03.19.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 May 2018 03:19:42 -0700 (PDT) Date: Wed, 9 May 2018 11:49:36 +0200 From: Anders Roxell To: "Shuah Khan (Samsung OSG)" Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] selftests: mqueue: delete RUN_TESTS and EMIT_TESTS overrides Message-ID: <20180509094936.GD10043@localhost.localdomain> References: <20180502211848.22404-1-shuah@kernel.org> <20180502211848.22404-5-shuah@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180502211848.22404-5-shuah@kernel.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-05-02 15:18, Shuah Khan (Samsung OSG) wrote: > 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) Reviewed-by: Anders Roxell > --- > 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 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Anders Roxell anders.roxell@linaro.org M: +46 709 71 42 85 | IRC: roxell