[PATCH 1/2] test: auto load elisp tests file in test_emacs if available

classic Classic list List threaded Threaded
6 messages Options
Dmitry Kurochkin Dmitry Kurochkin
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[PATCH 1/2] test: auto load elisp tests file in test_emacs if available

This allows us to simplify shell part of tests written in elisp.
---
 test/test-lib.sh |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/test/test-lib.sh b/test/test-lib.sh
index 8158328..0174e93 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -943,6 +943,12 @@ test_emacs () {
  test -z "$missing_dependencies" || return
 
  if [ -z "$EMACS_SERVER" ]; then
+ emacs_tests="$(basename $0).el"
+ if [ -f "$TEST_DIRECTORY/$emacs_tests" ]; then
+ load_emacs_tests="--eval '(load \"$emacs_tests\")'"
+ else
+ load_emacs_tests=
+ fi
  server_name="notmuch-test-suite-$$"
  # start a detached session with an emacs server
  # user's TERM is given to dtach which assumes a minimally
@@ -950,6 +956,7 @@ test_emacs () {
  TERM=$ORIGINAL_TERM dtach -n "$TEST_TMPDIR/emacs-dtach-socket.$$" \
  sh -c "stty rows 24 cols 80; exec '$TMP_DIRECTORY/run_emacs' \
  --no-window-system \
+ $load_emacs_tests \
  --eval '(setq server-name \"$server_name\")' \
  --eval '(server-start)' \
  --eval '(orphan-watchdog $$)'" || return
--
1.7.8.3

_______________________________________________
notmuch mailing list
[hidden email]
http://notmuchmail.org/mailman/listinfo/notmuch
Dmitry Kurochkin Dmitry Kurochkin
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[PATCH 2/2] test: remove explicit loading of elisp tests in emacs-address-cleaning

It is no longer needed, since elisp tests files are auto loaded now.
---
 test/emacs-address-cleaning |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/test/emacs-address-cleaning b/test/emacs-address-cleaning
index 51018fe..6ddde5c 100755
--- a/test/emacs-address-cleaning
+++ b/test/emacs-address-cleaning
@@ -4,15 +4,12 @@ test_description="emacs address cleaning"
 . test-lib.sh
 
 test_begin_subtest "notmuch-test-address-clean part 1"
-test_emacs_expect_t \
-    '(load "emacs-address-cleaning.el") (notmuch-test-address-cleaning-1)'
+test_emacs_expect_t '(notmuch-test-address-cleaning-1)'
 
 test_begin_subtest "notmuch-test-address-clean part 2"
-test_emacs_expect_t \
-    '(load "emacs-address-cleaning.el") (notmuch-test-address-cleaning-2)'
+test_emacs_expect_t '(notmuch-test-address-cleaning-2)'
 
 test_begin_subtest "notmuch-test-address-clean part 3"
-test_emacs_expect_t \
-    '(load "emacs-address-cleaning.el") (notmuch-test-address-cleaning-3)'
+test_emacs_expect_t '(notmuch-test-address-cleaning-3)'
 
 test_done
--
1.7.8.3

_______________________________________________
notmuch mailing list
[hidden email]
http://notmuchmail.org/mailman/listinfo/notmuch
David Edmondson David Edmondson
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [PATCH 1/2] test: auto load elisp tests file in test_emacs if available

In reply to this post by Dmitry Kurochkin
Nice idea, +1.

_______________________________________________
notmuch mailing list
[hidden email]
http://notmuchmail.org/mailman/listinfo/notmuch

attachment0 (203 bytes) Download Attachment
David Edmondson David Edmondson
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [PATCH 2/2] test: remove explicit loading of elisp tests in emacs-address-cleaning

In reply to this post by Dmitry Kurochkin
Obviously good, +1.

_______________________________________________
notmuch mailing list
[hidden email]
http://notmuchmail.org/mailman/listinfo/notmuch

attachment0 (203 bytes) Download Attachment
Dmitry Kurochkin Dmitry Kurochkin
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [PATCH 1/2] test: auto load elisp tests file in test_emacs if available

In reply to this post by Dmitry Kurochkin
Hi David.

I think this is a pretty simple change.  And there is one +1 for it.  So
I am going to remove the needs-review tag, please add it back if you
disagree.

Regards,
  Dmitry
_______________________________________________
notmuch mailing list
[hidden email]
http://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [PATCH 1/2] test: auto load elisp tests file in test_emacs if available

In reply to this post by Dmitry Kurochkin
On Sun, 29 Jan 2012 07:36:02 +0400, Dmitry Kurochkin <[hidden email]> wrote:
> This allows us to simplify shell part of tests written in elisp.

Pushed.
_______________________________________________
notmuch mailing list
[hidden email]
http://notmuchmail.org/mailman/listinfo/notmuch
Loading...