From patchwork Fri Nov 9 19:12:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Engestrom X-Patchwork-Id: 10676505 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9D2F313AD for ; Fri, 9 Nov 2018 19:13:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DB0B2F0EE for ; Fri, 9 Nov 2018 19:13:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 81EE12F0F1; Fri, 9 Nov 2018 19:13:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 32D782F0EE for ; Fri, 9 Nov 2018 19:13:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 250566E011; Fri, 9 Nov 2018 19:13:19 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6E4C86E011 for ; Fri, 9 Nov 2018 19:13:18 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Nov 2018 11:13:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,484,1534834800"; d="scan'208";a="248479024" Received: from mblaszko-mobl2.ger.corp.intel.com (HELO eengestr-dev.ger.corp.intel.com) ([10.252.30.138]) by orsmga004.jf.intel.com with ESMTP; 09 Nov 2018 11:13:17 -0800 From: Eric Engestrom To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm] tests: skip drmdevice test if the machine doesn't have any drm device Date: Fri, 9 Nov 2018 19:12:47 +0000 Message-Id: <20181109191247.10716-1-eric.engestrom@intel.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Organization: Intel Corp UK X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Error message was invalid too, negative values aren't the number of devices, they're errno error codes. Signed-off-by: Eric Engestrom Reviewed-by: Daniel Stone --- This fixes the Gitlab CI; goes from: https://gitlab.freedesktop.org/mesa/drm/-/jobs/42061 to: https://gitlab.freedesktop.org/eric/libdrm/-/jobs/42099 --- tests/drmdevice.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/drmdevice.c b/tests/drmdevice.c index cdf6e8deaf121899bcbc..f1c1cd3a0338d912f60c 100644 --- a/tests/drmdevice.c +++ b/tests/drmdevice.c @@ -115,8 +115,9 @@ main(void) max_devices = drmGetDevices2(0, NULL, 0); if (max_devices <= 0) { - printf("drmGetDevices2() has returned %d\n", max_devices); - return -1; + printf("drmGetDevices2() has not found any devices (errno=%d)\n", + -max_devices); + return 77; } printf("--- Devices reported %d ---\n", max_devices);