* [PATCH] Unit-test for Please add support for dlangs packagemanager to ob-C.el
@ 2022-10-01 22:05 Christian Köstlin
2022-10-02 2:47 ` Max Nikulin
2023-09-01 11:50 ` Ihor Radchenko
0 siblings, 2 replies; 7+ messages in thread
From: Christian Köstlin @ 2022-10-01 22:05 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1.1: Type: text/plain, Size: 51 bytes --]
Aforementioned unit-test.
Kind regards,
Christian
[-- Attachment #1.2: Type: text/html, Size: 108 bytes --]
[-- Attachment #2: 0002-testing-lisp-test-ob-C.el-Add-test-for-dub-support-i.patch --]
[-- Type: application/octet-stream, Size: 1658 bytes --]
From 58204f551ff8d4eea928f127e9707117f952d47b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20K=C3=B6stlin?= <christian.koestlin@gmail.com>
Date: Sat, 1 Oct 2022 23:55:02 +0200
Subject: [PATCH 2/2] testing/lisp/test-ob-C.el: Add test for dub support in
ob-C.el
TINYPATCH
---
testing/examples/ob-C-test.org | 8 ++++++++
testing/lisp/test-ob-C.el | 6 ++++++
2 files changed, 14 insertions(+)
diff --git a/testing/examples/ob-C-test.org b/testing/examples/ob-C-test.org
index c7a96f665..aa7945d1a 100644
--- a/testing/examples/ob-C-test.org
+++ b/testing/examples/ob-C-test.org
@@ -174,3 +174,11 @@ std::cout << "\"line 1\"\n";
std::cout << "\"line 2\"\n";
std::cout << "\"line 3\"\n";
#+end_src
+
+* Dub tests
+:PROPERTIES:
+:ID: 81E17302-BE76-4E2A-93CA-0A7E121CB7C2
+:END:
+#+begin_src D :dependencies '(mir-algorithm=3.16.2) :imports "mir.combinatorics" :results pp
+ foreach (p; ['a', 'b', 'c'].permutations) { p.write(", "); }
+#+end_src
diff --git a/testing/lisp/test-ob-C.el b/testing/lisp/test-ob-C.el
index b6dbed8e3..0c0f6c8d7 100644
--- a/testing/lisp/test-ob-C.el
+++ b/testing/lisp/test-ob-C.el
@@ -192,5 +192,11 @@
"\"line 1\"\n\"line 2\"\n\"line 3\"\n"
(org-babel-execute-src-block))))))
+(ert-deftest ob-D/dub-basics ()
+ (if (executable-find "dub") (org-test-at-id
+ "81E17302-BE76-4E2A-93CA-0A7E121CB7C2" (org-babel-next-src-block 1)
+ (should (equal "abc, bac, cab, acb, bca, cba, "
+ (org-babel-execute-src-block))))))
+
(provide 'test-ob-C)
;;; test-ob-C.el ends here
--
2.37.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] Unit-test for Please add support for dlangs packagemanager to ob-C.el
2022-10-01 22:05 [PATCH] Unit-test for Please add support for dlangs packagemanager to ob-C.el Christian Köstlin
@ 2022-10-02 2:47 ` Max Nikulin
2022-10-02 7:29 ` Ihor Radchenko
2023-09-01 11:50 ` Ihor Radchenko
1 sibling, 1 reply; 7+ messages in thread
From: Max Nikulin @ 2022-10-02 2:47 UTC (permalink / raw)
To: emacs-orgmode; +Cc: Christian Köstlin
On 02/10/2022 05:05, Christian Köstlin wrote:
> Aforementioned unit-test.
> +(ert-deftest ob-D/dub-basics ()
> + (if (executable-find "dub") (org-test-at-id
> + "81E17302-BE76-4E2A-93CA-0A7E121CB7C2" (org-babel-next-src-block 1)
> + (should (equal "abc, bac, cab, acb, bca, cba, "
> + (org-babel-execute-src-block))))))
I am unsure concerning general policy related to org-babel test, so the
following is rather discussion than a direct request to change the test.
Is there a way to avoid dependency on remote resources? My concern is
test results affected by network issues. In addition, more required 3rd
party tools means less probability that a developer after modification
of generic babel code noticed that the changes break D backend because
missing tool on the development machine. I have no idea how much efforts
is required to create a mock for isolated environment.
Another point is that missed dub binary is not reflected in test report.
If `skip-unless' feature of ert is available in Emacs-26 then it should
be used.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Unit-test for Please add support for dlangs packagemanager to ob-C.el
2022-10-02 2:47 ` Max Nikulin
@ 2022-10-02 7:29 ` Ihor Radchenko
[not found] ` <CAG741+aejhxeGf9hwW5i2tw_yokbudO8tPsh0h5Fjcp+PXduJQ@mail.gmail.com>
2022-10-18 19:46 ` tbanelwebmin
0 siblings, 2 replies; 7+ messages in thread
From: Ihor Radchenko @ 2022-10-02 7:29 UTC (permalink / raw)
To: Max Nikulin; +Cc: emacs-orgmode, Christian Köstlin
Max Nikulin <manikulin@gmail.com> writes:
> I am unsure concerning general policy related to org-babel test, so the
> following is rather discussion than a direct request to change the test.
>
> Is there a way to avoid dependency on remote resources? My concern is
> test results affected by network issues. In addition, more required 3rd
> party tools means less probability that a developer after modification
> of generic babel code noticed that the changes break D backend because
> missing tool on the development machine. I have no idea how much efforts
> is required to create a mock for isolated environment.
Tests must not rely on remote resources.
However, it does not mean that we cannot test remote resources in Org
tests. One simply needs to mock the url-retrieve or whatever function is
used to retrieve remove resource.
> Another point is that missed dub binary is not reflected in test report.
> If `skip-unless' feature of ert is available in Emacs-26 then it should
> be used.
The current approach to optional binaries is throwing
'missing-test-dependency error when the binary is not available.
--
Ihor Radchenko,
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Unit-test for Please add support for dlangs packagemanager to ob-C.el
2022-10-01 22:05 [PATCH] Unit-test for Please add support for dlangs packagemanager to ob-C.el Christian Köstlin
2022-10-02 2:47 ` Max Nikulin
@ 2023-09-01 11:50 ` Ihor Radchenko
1 sibling, 0 replies; 7+ messages in thread
From: Ihor Radchenko @ 2023-09-01 11:50 UTC (permalink / raw)
To: Christian Köstlin; +Cc: emacs-orgmode
Christian Köstlin <christian.koestlin@gmail.com> writes:
> Subject: [PATCH 2/2] testing/lisp/test-ob-C.el: Add test for dub support in
> ob-C.el
Canceled, due to no response.
See https://list.orgmode.org/orgmode/CAG741+bUT_Yt3PdLuVpMNH7vo-bb3n1iiynf2Cime1LW=214NQ@mail.gmail.com/
--
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>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-09-01 11:50 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-01 22:05 [PATCH] Unit-test for Please add support for dlangs packagemanager to ob-C.el Christian Köstlin
2022-10-02 2:47 ` Max Nikulin
2022-10-02 7:29 ` Ihor Radchenko
[not found] ` <CAG741+aejhxeGf9hwW5i2tw_yokbudO8tPsh0h5Fjcp+PXduJQ@mail.gmail.com>
[not found] ` <8735c5zhth.fsf@localhost>
[not found] ` <CAG741+ZsxPOwNP190x=t=QrAJSM5s-GTFowRaNs07PnMd03OzA@mail.gmail.com>
[not found] ` <87h70lw1k4.fsf@localhost>
[not found] ` <CAG741+aNbNKqK_w6=+OYNWJSV+3bY_=QO3hzhs8ztC6Opit3vA@mail.gmail.com>
2022-10-04 4:56 ` Ihor Radchenko
2022-10-18 19:46 ` tbanelwebmin
2022-10-19 8:07 ` Ihor Radchenko
2023-09-01 11:50 ` Ihor Radchenko
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.