From patchwork Mon May 18 13:37:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Morton X-Patchwork-Id: 6429421 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A65C4C0432 for ; Mon, 18 May 2015 13:37:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A34AC20443 for ; Mon, 18 May 2015 13:37:42 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A545720437 for ; Mon, 18 May 2015 13:37:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ED12A720AD; Mon, 18 May 2015 06:37:40 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 200DE720AD for ; Mon, 18 May 2015 06:37:39 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 18 May 2015 06:37:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,453,1427785200"; d="scan'208";a="495059486" Received: from djmorton-linux.isw.intel.com ([10.102.226.153]) by FMSMGA003.fm.intel.com with ESMTP; 18 May 2015 06:37:37 -0700 From: Derek Morton To: intel-gfx@lists.freedesktop.org Date: Mon, 18 May 2015 14:37:31 +0100 Message-Id: <1431956251-26746-1-git-send-email-derek.j.morton@intel.com> X-Mailer: git-send-email 1.9.1 Cc: thomas.wood@intel.com Subject: [Intel-gfx] [PATCH i-g-t] lib/igt_core.c: Flag the test as failing after a segfault X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP fatal_signal_handler() was trapping fatal errors but not flagging the test as failing or setting an exit code. The result was that the test would return Ok or Skipped depending on what the other subtests did even though one of the subtests had segfaulted. Signed-off-by: Derek Morton --- lib/igt_core.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/igt_core.c b/lib/igt_core.c index 8a1a249..b29f7e3 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -1433,8 +1433,15 @@ static void fatal_sig_handler(int sig) igt_assert_eq(write(STDERR_FILENO, ".\n", 2), 2); } - if (in_subtest && crash_signal(sig)) + if (in_subtest && crash_signal(sig)) { + /* Linux standard to return exit code as 128 + signal */ + if (!failed_one) + igt_exitcode = 128 + sig; + + failed_one = true; + exit_subtest("CRASH"); + } break; }