From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Harald_J=c3=b6rg?= Newsgroups: gmane.emacs.devel Subject: Re: Perl and Emacs: Developing tests for progmodes Date: Thu, 3 Sep 2020 22:00:22 +0200 Message-ID: References: <935d77f8-72c4-16fd-f9d6-39ba965e99e8@posteo.de> <83h7sevk6g.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37178"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 Cc: stefankangas@gmail.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Sep 03 22:01:28 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kDvQG-0009Yy-At for ged-emacs-devel@m.gmane-mx.org; Thu, 03 Sep 2020 22:01:28 +0200 Original-Received: from localhost ([::1]:35094 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDvQF-0000FM-BR for ged-emacs-devel@m.gmane-mx.org; Thu, 03 Sep 2020 16:01:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36408) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDvPK-0008Dh-2n for emacs-devel@gnu.org; Thu, 03 Sep 2020 16:00:30 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:34037) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDvPH-0005Pd-K3 for emacs-devel@gnu.org; Thu, 03 Sep 2020 16:00:29 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 5CC9D2400FB for ; Thu, 3 Sep 2020 22:00:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1599163225; bh=70JKUu5fQfVFRnRTd9IRF8pXwudQLdB04bcsUtiYNQY=; h=Subject:To:Cc:From:Autocrypt:Date:From; b=ISLQncW8XuOASONVydH4z69SmLIT1oP7j72OjyQkyWF9baFOqjers1ECDeTEOKt2t xAnUMhhY0IBYauW54ijT/BubvnrPARCPZh5pJH50+32je1/BZyM7k2IDXLe5NlkFaF iZe+k+ChMqgMFYSaaSp3Djup+d+hV4R/J+4jfpWeWRJU49AQa2nuwktfF9yxP9xxUs dte7kObfFXngyQY11dRm8tYiysP73I827dHpeJjdgTY7PBY35EyYdld47DnDKOGxCz R3+mSDoF8BlocyJxESpPEutE6NHWgPubEQI8pgki5yyNtZYR+NqCcLrbOG4mHcnsai cdk8CSwmz61bQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4BjBVw3bvTz6tmK; Thu, 3 Sep 2020 22:00:24 +0200 (CEST) Autocrypt: addr=haj@posteo.de; keydata= mQINBF0DVrIBEAC7TRlIilBg/5Dx7R2rV4FBDEavbyMT2cS2wWyksh7JA8e17LNmTdakf+Bm u6C2m6+frolteYRlkreoyAg0fj/5tDw/s5dJDw3tM0b+m/pj2HcwTSRpQSEy5lBiCg11E6Mt F9UngCfkGtJzu8PBWXc1RDQVBwRn5MZbpMZZatE8NOq9AA3Yg6sY11Ez3xIvYU2R7a4OSxmc RJV2+dhdQ4oOTBIGQ2urQSU81kyRtkx+/Yh8WefMrk9nF3nzYziLS53euCAXyzklwYmD6Li3 XSu7wYp5fISky9DK6DPFK7h4RXEL4GFAhy31ehrVnNTcGRohM1Dm9BV9dwXkwlaeT3q0X+nE SXVqPDHtv748bXNIg2WVCZ0WgShcA46XVlSE9Fm+w0HI/1m1L4BaMmQ7gyK5dEchbhxohkk0 AqC3hEJ4ULRidrsCoCWGMFKiOIb9rjeC00vhrUkVJDkPWEGLXjhnRQykb6cESko0rPrSDLqX 9YqaNQ6KO9Un6uogE7YnXYg35EXJ8ORdX257IbXNbFVpgM8FFsl48WV3Pl9WNdADhnnOrz3O wzyK58i/BTsnjVX8ghbWkQcPQ2Kprt+4YR2trEi7TM5Uqzzrg0vp7Oe/9KZBxdxCE67thV7h ElW3CHb4q6o31b4cFmLbtFesSy+hnUU4UymgHgi/hvhxioBxIQARAQABtBxIYXJhbGQgSsO2 cmcgPGhhakBwb3N0ZW8uZGU+iQJOBBMBCAA4FiEEIpYEZLQynxF8Q17KN4XzzzqAcpsFAl0D VrICGwMFCwkIBwIGFQgJCgsCBBYCAwECHgECF4AACgkQN In-Reply-To: <83h7sevk6g.fsf@gnu.org> Content-Language: en-US Received-SPF: pass client-ip=185.67.36.66; envelope-from=haj@posteo.de; helo=mout02.posteo.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/03 16:00:25 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -44 X-Spam_score: -4.5 X-Spam_bar: ---- X-Spam_report: (-4.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-2.403, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:254504 Archived-At: On 9/3/20 7:34 PM, Eli Zaretskii wrote: >> From: Harald Jörg >> Date: Thu, 3 Sep 2020 15:42:47 +0200 >> Cc: Stefan Kangas , >> Stefan Monnier >> >> To solve this, we could: >> >> - Split the tests into two and manually copy over tests where this >> makes sense or: >> >> - Split the tests into a "common" set plus two sets for the specific >> modes (how would the files be named in that case?) or: >> >> - Keep all tests in one file and tag the individual tests. >> >> Are there any similar cases in the set of Emacs packages, or >> conventions how to do it? > > Don't perl-mode and cperl-mode live on 2 separate files? They do. > We generally > have a structure under test/ that mirrors the file hierarchy of the > sources being tested, so it would be natural to have 2 separate files, > test/lisp/progmodes/perl-mode-tests.el and > test/lisp/progmodes/cperl-mode-tests.el. Such was my understanding of test/file-organization.org, too. > Does that answer your question? Not really: As far as I understand, Stefan Monnier augmented the first version of cperl-mode-tests.el so that it is also applicable for perl-mode.el (commit 7a7847d7ad5). So, a (not-yet-existing) perl-mode-tests.el would just (let ((cperl-test-mode #'perl-mode)) and then run the tests in cperl-mode-tests.pl. For that to work, the tests in cperl-mode-tests.el need to co-operate. My recent test written for (Bug#16368) calls a function which is only available in cperl-mode, and the tests for (Bug#10483) exercise cperl-mode's indentation by calling `cperl-indent-exp' and expect cperl-mode's indentation results. The simple approach from above would then either give false negative results (whenever perl-mode runs against cperl-mode's expectations) or just run the same test twice (when the test explicitly calls a cperl-mode function). Adding a line (skip-unless (eq cperl-test-mode #'cperl-mode)), as suggested by Stefan Monnier, will do the trick, and will allow me to continue chasing old bugs or even add new bugs, eerm, features. -- Cheers, haj