From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 64429 invoked by alias); 28 Apr 2016 05:00:58 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 64414 invoked by uid 89); 28 Apr 2016 05:00:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=HX-Received-From:134, HX-Received-From:4830, HX-Received-From:2001, HX-HELO:eggs.gnu.org X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 28 Apr 2016 05:00:47 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ave4A-0005Ju-Uj for gdb-patches@sourceware.org; Thu, 28 Apr 2016 01:00:46 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38562) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ave4A-0005Jo-RI; Thu, 28 Apr 2016 01:00:42 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3473 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1ave4A-0005RK-67; Thu, 28 Apr 2016 01:00:42 -0400 Date: Thu, 28 Apr 2016 05:00:00 -0000 Message-Id: <83inz2xr82.fsf@gnu.org> From: Eli Zaretskii To: Tom Tromey CC: gdb-patches@sourceware.org In-reply-to: <1461789279-15996-4-git-send-email-tom@tromey.com> (message from Tom Tromey on Wed, 27 Apr 2016 14:34:34 -0600) Subject: Re: [PATCH v2 3/8] Add self-test framework to gdb Reply-to: Eli Zaretskii References: <1461789279-15996-1-git-send-email-tom@tromey.com> <1461789279-15996-4-git-send-email-tom@tromey.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-IsSubscribed: yes X-SW-Source: 2016-04/txt/msg00629.txt.bz2 > From: Tom Tromey > Cc: Tom Tromey > Date: Wed, 27 Apr 2016 14:34:34 -0600 > > I wanted to unit test the Rust lexer, so I added a simple unit testing > command to gdb. > > The intent is that self tests will only be compiled into gdb in > development mode. In release mode they simply won't exist. So, this > exposes $development to C code as GDB_SELF_TEST. > > In development mode, test functions are registered with the self test > module. A test function is just a function that does some checks, and > aborts on failure. I chose this rather than something fancier because > I think any such failure will require debugging anyhow. > > Then this adds a new "maint selftest" command which invokes the test > functions, and a new dejagnu test case that invokes it. > > 2016-04-27 Tom Tromey > > * NEWS: Add "maint selftest" entry. > * selftest.h: New file. > * selftest.c: New file. > * maint.c: Include selftest.h. > (maintenance_selftest): New function. > (_initialize_maint_cmds): Add "maint selftest" command. > * configure.ac (GDB_SELF_TEST): Maybe define. > * config.in, configure: Rebuild. > * Makefile.in (SFILES): Add selftest.c. > (COMMON_OBS): Add selftest.o. > > 2016-04-26 Tom Tromey > > * gdb.texinfo (Maintenance Commands): Document "maint selftest". > > 2016-04-26 Tom Tromey > > * gdb.gdb/unittest.exp: New file. OK for the documentation parts. Thanks.