From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110596 invoked by alias); 28 Apr 2016 10:28:22 -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 110577 invoked by uid 89); 28 Apr 2016 10:28:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:sk:11.2016 X-HELO: mail-pa0-f43.google.com Received: from mail-pa0-f43.google.com (HELO mail-pa0-f43.google.com) (209.85.220.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 28 Apr 2016 10:28:11 +0000 Received: by mail-pa0-f43.google.com with SMTP id iv1so30639688pac.2 for ; Thu, 28 Apr 2016 03:28:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=FXtlilLhrc1QLMqlbzJi6IHN4qImPKCDrlsaYPX0Um8=; b=Bzhs2MQJuURnd2CcyrD/m9FTAHXhh5GmLJV8zC9zVVybE2sP86zvFAHxbkb+0PXG6o qPMQ78XpmMZxHaXRvYrzo4W0aCas0cXifs1d2Shb2ZFODpjCDsiKmRjtYk0NwF4kcv4+ Ym97w04AUGRo0MmIaOXFVU0JQP+IBR38tjeHO9yQAacStTUU+Uc0m8QrUHE9nqOD0Rcg cXTdK8lzRkqKVc2b0a2xI2wuG85b2O2IPg4zAuRsUdBGYEY63LpTa46ZWkgVR8uaX4V6 eeYHYFeHFv+CD33qwcphFpLbPM8fK/XeHZLdaHrCdLQEH6KWjL6UeTYBc5RC9mOZfdhw vfag== X-Gm-Message-State: AOPr4FXXdOId77/kLyWvYvh0I8fklAuxJ189yoloRDHJNMDo1DSrkC7ASWaXaWALtvtcaA== X-Received: by 10.66.153.209 with SMTP id vi17mr19250640pab.0.1461839289357; Thu, 28 Apr 2016 03:28:09 -0700 (PDT) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id dr4sm14003049pac.11.2016.04.28.03.28.06 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 28 Apr 2016 03:28:08 -0700 (PDT) From: Yao Qi To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v2 3/8] Add self-test framework to gdb References: <1461789279-15996-1-git-send-email-tom@tromey.com> <1461789279-15996-4-git-send-email-tom@tromey.com> Date: Thu, 28 Apr 2016 10:28:00 -0000 In-Reply-To: <1461789279-15996-4-git-send-email-tom@tromey.com> (Tom Tromey's message of "Wed, 27 Apr 2016 14:34:34 -0600") Message-ID: <86wpnido3w.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-04/txt/msg00632.txt.bz2 Tom Tromey writes: Hi Tom, this framework is sufficient in current needs, but I'd like to think more about it because it is a framework, and more and more tests may use it in the future. > 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. In this framework, all unit tests are running in one GDB instance, so: - if one test fails, the following tests won't be run, even they are from different modules, - tests may change the GDB state, and the following tests may be affected, I'd like the framework to only run tests from one module in one gdb instance, restart gdb after they are finished, and continue running tests from other modules. For example, we have registered three self tests in different modules, register_self_test (rust_lex_tests); register_self_test (breakpoint_tests); register_self_test (linespec_tests); In gdb.gdb/unittest.exp, we can get the list of self tests from different modules via command "maint info selftest", like $ (gdb) maint info selftest rust_lex_tests breakpoint_tests linespec_tests and the output can be saved in $list_of_tests, start a fresh gdb every time, and execute these tests one by one, like foreach test $list_of_tests { gdb_start gdb_test "maint selftest $test" "Ran $decimal unit tests" gdb_exit } --=20 Yao (=E9=BD=90=E5=B0=A7)