From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Eric Schulte" Newsgroups: gmane.emacs.devel Subject: Re: testing framework and package.el Date: Mon, 04 Oct 2010 11:22:53 -0600 Message-ID: <87zkutub2q.fsf@gmail.com> References: <87tyladfnf.fsf@gmx.de> <4CA5DBA2.4050102@fastmail.net> <87tyl5i737.fsf@gmx.de> <4CA86026.1020000@fastmail.net> <87vd5jvw1q.fsf@gmx.de> <4CA9F483.8020000@fastmail.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1286213126 19953 80.91.229.12 (4 Oct 2010 17:25:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 4 Oct 2010 17:25:26 +0000 (UTC) Cc: Sebastian Rose , Stefan Monnier , emacs-devel Mailinglist To: Christian Ohler Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 04 19:25:24 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P2omw-0008Pb-M0 for ged-emacs-devel@m.gmane.org; Mon, 04 Oct 2010 19:25:22 +0200 Original-Received: from localhost ([127.0.0.1]:57521 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P2omw-0004Ye-3Z for ged-emacs-devel@m.gmane.org; Mon, 04 Oct 2010 13:25:22 -0400 Original-Received: from [140.186.70.92] (port=60788 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P2okg-0003KL-DI for emacs-devel@gnu.org; Mon, 04 Oct 2010 13:23:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P2okc-0005RD-CN for emacs-devel@gnu.org; Mon, 04 Oct 2010 13:23:02 -0400 Original-Received: from mail-gy0-f169.google.com ([209.85.160.169]:38189) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P2okc-0005R0-8h for emacs-devel@gnu.org; Mon, 04 Oct 2010 13:22:58 -0400 Original-Received: by gyf3 with SMTP id 3so1623207gyf.0 for ; Mon, 04 Oct 2010 10:22:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=9PDBT/y/StLFE28GwJWU1+wgOg+qWWCdIYgVRkKPEQQ=; b=lNBCdaT2ebpAX7k9dBTxouyOdYh7mSXbY3xpHm0bm4QYwkFC/rTnbGoDgp8w34D74h DU4jIUPuZYqmPMINPn7Itid3oAvJ9NeehDuJBizhsAa1aPr8RKOTdIWt6sNzKUnzaRRi pkxC/8O/lsr3uejqTAgwQDw7h8G0rIWbkE96s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=Y1Y8ATJT8Ch1B1c5wblBuLr2ZUbu5c5eRR/MTkWhmY+Zehd78ZDVE70AapPruyGFQY iJ1cYm9g9PS8EVNh2nUldfI6hF1TjIaIsT2AjygugBsApOLus/6jJGx/DfUCZ9bniXgs 9mw54v+r67EyjjCVNDIYjmYcdreR6m0N2w394= Original-Received: by 10.231.147.131 with SMTP id l3mr10564014ibv.74.1286212977255; Mon, 04 Oct 2010 10:22:57 -0700 (PDT) Original-Received: from roll (adaptive.cs.unm.edu [64.106.21.179]) by mx.google.com with ESMTPS id g31sm5162116ibh.22.2010.10.04.10.22.55 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 04 Oct 2010 10:22:56 -0700 (PDT) In-Reply-To: <4CA9F483.8020000@fastmail.net> (Christian Ohler's message of "Tue, 05 Oct 2010 01:06:35 +0930") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.90 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:131326 Archived-At: Christian Ohler writes: > On 4/10/10 6:22, Sebastian Rose wrote: >> A structure like that could be enforced later >> if needed. We will start with a very small project. I want to make it >> easy to jump to the test-file for a given source-file and execute tests >> for current defun automatically. This could be done based on such a >> structure (i.e. conventions). >> >> I guess reading more of ERT's code I'll find other ways to find the file >> a certain test (or tests matching a selector) is defined. > I just started experimenting with a directory layout where ERT's code > is in lisp/emacs-lisp/*.el and the tests are in > test/lisp/emacs-lisp/*.el. It is indeed very clumsy to jump back and > forth between the tests and the code under test. (Putting the tests > in test/emacs-lisp/*.el would make no difference.) > > I suspect it would be easier if the convention was that a file > /some/path/foo.el had its tests in /some/path/test/foo.el. The > convention of having a top-level src/ and test/ split makes sense in > Java because of its package file layout and visibility rules, but > Emacs Lisp has no such constraints. Has anyone else thought about the > pros and cons of these different conventions? Is there a deep reason > why Emacs currently has test/ as a separate top-level directory? > I've been working with Sebastian on a branch of the Org-mode repository which includes a test suite [1]. Included in this setup is some functionality for jumping between e-lisp files and their related test files. This uses an old utility I wrote long ago [2] which allows the definition of "jumping" functions defined using a simple schema. In the org-mode repository the tests and elisp are organized as elisp file in /lisp/org-foo.el related tests can be in either of the following /testing/lisp/test-org-foo.el /testing/lisp/org-foo.el/test.el /testing/lisp/org-foo.el/tests.el the following is used to define our jumping function in this setup [3]. Maybe this would be helpful for navigating the Emacs tests as well. Cheers -- Eric Footnotes: [1] http://repo.or.cz/w/org-mode.git/shortlog/refs/heads/combined-testing [2] http://github.com/eschulte/jump.el I was just learning elisp when I wrote this, so please don't judge me by the code :) [3] example jump schema --8<---------------cut here---------------start------------->8--- ;;; Navigation Functions (defjump 'org-test-jump '(("lisp/\\1.el" . "testing/lisp/test-\\1.el") ("lisp/\\1.el" . "testing/lisp/\\1.el/test.*.el") ("contrib/lisp/\\1.el" . "testing/contrib/lisp/test-\\1.el") ("contrib/lisp/\\1.el" . "testing/contrib/lisp/\\1.el/test.*.el") ("testing/lisp/test-\\1.el" . "lisp/\\1.el") ("testing/lisp/\\1.el" . "lisp/\\1.el/test.*.el") ("testing/contrib/lisp/test-\\1.el" . "contrib/lisp/\\1.el") ("testing/contrib/lisp/test-\\1.el" . "contrib/lisp/\\1.el/test.*.el")) (concat org-base-dir "/") "Jump between org-mode files and their tests.") --8<---------------cut here---------------end--------------->8---