all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Francesc Rocher <francesc.rocher@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Testing issues for Ada/SPARK support in Babel
Date: Sun, 10 Mar 2024 19:44:30 +0100	[thread overview]
Message-ID: <CAKMo=hVMUWNmz-2gvjyeMB5V2x_DqxW9jrkNfeV+bY0_8iYHqA@mail.gmail.com> (raw)
In-Reply-To: <87cyskn7xa.fsf@localhost>

[-- Attachment #1: Type: text/plain, Size: 4144 bytes --]

Hi all,

I'm starting from scratch the set of tests for Ada/SPARK support in Babel.
I've prepared a file with the first example:

---8<--- testing/examples/ob-ada-spark-test-org ---8<---
* Simple tests
:PROPERTIES:
:ID:       778e63c2-2644-4a6f-8e7d-f956fa3d9241
:END:
#+name: hello-world
#+begin_src ada :unit hello_world :results silent
   with Ada.Text_IO;
   procedure Hello_World is
   begin
      Ada.Text_IO.Put_Line ("Hello world");
   end Hello_World;
#+end_src
---8<------8<------8<------8<------8<------8<---

Then in the file testing/test-ob-ada-spark.el I've defined the following
test:

(ert-deftest ob-ada-spark/hello-world ()
  "Test simple Hello world."
  (org-test-at-id "778e63c2-2644-4a6f-8e7d-f956fa3d9241"
    (org-babel-next-src-block)
    (should (equal "Hello world\n" (org-babel-execute-src-block)))))

When I execute the test form within Emacs with:

(add-to-list ' load-path (concat (file-name-directory (buffer-file-name))))
(require 'org-test)
(ert 'ob-ada-spark/hello-world)

it works fine, but when I run the test from the command line with

$ make BTEST_RE='ob-ada-spark.*' test-dirty

it fails because (org-babel-execute-src-block) returns nil:

Test ob-ada-spark/hello-world condition:
    (wrong-type-argument stringp nil)
   FAILED  1/1  ob-ada-spark/hello-world (0.002933 sec) at
../lisp/test-ob-ada-spark.el:40

Everything is in place, "make compile" issues no warning and required
programs are in PATH. I've tested other languages, e.g.

$ make BTEST_RE='ob-fortran.*' test-dirty
$ make BTEST_RE='ob-java/.*' test-dirty

and everything works fine .

Any idea?? How can I debug test execution from the command line?

BR,
-- Francesc Rocher


On Sun, Feb 25, 2024 at 11:36 AM Ihor Radchenko <yantar92@posteo.net> wrote:

> Francesc Rocher <francesc.rocher@gmail.com> writes:
>
> > If you still want to include it into the mainstream org-mode repository,
> > then I'll be more than happy
> > to contribute. If so, let me know what are the next steps and what kind
> of
> > test do you expect.
>
> Yes, we are interested to have Ada support in Org mode repository.
>
> Here is what you need to do:
>
> 1. Check our contributor instructions at
>    https://orgmode.org/worg/org-contribute.html#first-patch
>    In particular, pay attention to the ChangeLog entry format.
>    You also need FSF copyright assignment.
>    Don't worry to make mistakes - we will guide you through once you
>    submit patches.
>
> 2. https://github.com/rocher/ob-ada-spark/blob/main/ob-ada-spark.el
>    should go to lisp/ directory of Org repository.
>    Make sure to update the file header, updating the licence and stating
>    that it is now a part of Emacs.
>
> 3. You need to get rid of any external library dependencies (f.el)
>
> 4. https://github.com/rocher/ob-ada-spark/blob/main/ob-doc-Ada-SPARK.org
>    should go to
>    https://orgmode.org/worg/org-contrib/babel/languages/index.html
>    You will need to make a patch against https://git.sr.ht/~bzg/worg
>    Also, make sure to follow
>
> https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-template.org
>
> 5. You need to add tests to testing/lisp in Org repository.
>    You may use
>
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/testing/lisp/test-ob-java.el
>    as a reference.
>
> 6. It will be best if you continue maintaining ob-ada within Org mode
>    repository. If you are willing to, we will also give you write access
>    to the Org mode repository on savannah. We will provide instructions
>    later, when we reach this stage.
>    Note that we use Org mailing list to track bugs and discuss the
>    development. You do not have to be subscribed, we can forward
>    relevant email threads to your email inbox.
>
> If you have any questions, feel free to ask us.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>

[-- Attachment #2: Type: text/html, Size: 6426 bytes --]

  reply	other threads:[~2024-03-10 18:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-01  8:02 Ada/SPARK support in Babel Francesc Rocher
2021-12-07 10:01 ` Francesc Rocher
2023-12-17 14:17 ` Ihor Radchenko
2024-02-24 13:56   ` Bastien Guerry
2024-02-24 18:41     ` Francesc Rocher
2024-02-25 10:40       ` Ihor Radchenko
2024-03-10 18:44         ` Francesc Rocher [this message]
2024-03-12 12:00           ` Testing issues for " Ihor Radchenko
2024-05-13  8:10             ` Ihor Radchenko
2024-05-13 16:28               ` Francesc Rocher
2024-05-18  9:30                 ` Ihor Radchenko
2024-07-18  6:56                   ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKMo=hVMUWNmz-2gvjyeMB5V2x_DqxW9jrkNfeV+bY0_8iYHqA@mail.gmail.com' \
    --to=francesc.rocher@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.