unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] test: simplify T360-symbol-hiding, use nm instead of objdump
@ 2014-09-10  6:41 David Bremner
  2014-09-10 10:04 ` Tomi Ollila
  2014-09-13  8:07 ` David Bremner
  0 siblings, 2 replies; 3+ messages in thread
From: David Bremner @ 2014-09-10  6:41 UTC (permalink / raw)
  To: notmuch

After yet another variation in objdump output caused this test to fail
(on a Debian port, no less), I decided whatever putative benefit we
get from looking at the object files instead of the library isn't
worth the maintenence headache.

This version uses nm -P. nm -P should be portable, and fixed format.
It purposely doesn't use the -D argument, since that is non-POSIX and
nm on GNU/Linux seems do the right thing without it.

It still won't work out of the box on e.g. Mac OS/X. I think the right
thing to do there is to move some more configuration information into
sh.config.
---
 test/T360-symbol-hiding.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/T360-symbol-hiding.sh b/test/T360-symbol-hiding.sh
index 636ec91..8fc4bdf 100755
--- a/test/T360-symbol-hiding.sh
+++ b/test/T360-symbol-hiding.sh
@@ -26,7 +26,7 @@ test_begin_subtest 'checking output'
 test_expect_equal "$result" "$output"
 
 test_begin_subtest 'comparing existing to exported symbols'
-objdump -t $TEST_DIRECTORY/../lib/*.o | awk '$4 == ".text" && $6 ~ "^notmuch" {print $6}' | sort | uniq > ACTUAL
+nm -P $TEST_DIRECTORY/../lib/libnotmuch.so | awk '$2 == "T" && $1 ~ "^notmuch" {print $1}' | sort | uniq > ACTUAL
 sed -n 's/[[:blank:]]*\(notmuch_[^;]*\);/\1/p' $TEST_DIRECTORY/../notmuch.sym | sort | uniq > EXPORTED
 test_expect_equal_file EXPORTED ACTUAL
 
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] test: simplify T360-symbol-hiding, use nm instead of objdump
  2014-09-10  6:41 [PATCH] test: simplify T360-symbol-hiding, use nm instead of objdump David Bremner
@ 2014-09-10 10:04 ` Tomi Ollila
  2014-09-13  8:07 ` David Bremner
  1 sibling, 0 replies; 3+ messages in thread
From: Tomi Ollila @ 2014-09-10 10:04 UTC (permalink / raw)
  To: David Bremner, notmuch

On Wed, Sep 10 2014, David Bremner <david@tethera.net> wrote:

> After yet another variation in objdump output caused this test to fail
> (on a Debian port, no less), I decided whatever putative benefit we
> get from looking at the object files instead of the library isn't
> worth the maintenence headache.
>
> This version uses nm -P. nm -P should be portable, and fixed format.
> It purposely doesn't use the -D argument, since that is non-POSIX and
> nm on GNU/Linux seems do the right thing without it.
>
> It still won't work out of the box on e.g. Mac OS/X. I think the right
> thing to do there is to move some more configuration information into
> sh.config.

LGTM.

Tomi

> ---
>  test/T360-symbol-hiding.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/test/T360-symbol-hiding.sh b/test/T360-symbol-hiding.sh
> index 636ec91..8fc4bdf 100755
> --- a/test/T360-symbol-hiding.sh
> +++ b/test/T360-symbol-hiding.sh
> @@ -26,7 +26,7 @@ test_begin_subtest 'checking output'
>  test_expect_equal "$result" "$output"
>  
>  test_begin_subtest 'comparing existing to exported symbols'
> -objdump -t $TEST_DIRECTORY/../lib/*.o | awk '$4 == ".text" && $6 ~ "^notmuch" {print $6}' | sort | uniq > ACTUAL
> +nm -P $TEST_DIRECTORY/../lib/libnotmuch.so | awk '$2 == "T" && $1 ~ "^notmuch" {print $1}' | sort | uniq > ACTUAL
>  sed -n 's/[[:blank:]]*\(notmuch_[^;]*\);/\1/p' $TEST_DIRECTORY/../notmuch.sym | sort | uniq > EXPORTED
>  test_expect_equal_file EXPORTED ACTUAL
>  
> -- 
> 2.1.0
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] test: simplify T360-symbol-hiding, use nm instead of objdump
  2014-09-10  6:41 [PATCH] test: simplify T360-symbol-hiding, use nm instead of objdump David Bremner
  2014-09-10 10:04 ` Tomi Ollila
@ 2014-09-13  8:07 ` David Bremner
  1 sibling, 0 replies; 3+ messages in thread
From: David Bremner @ 2014-09-13  8:07 UTC (permalink / raw)
  To: notmuch

David Bremner <david@tethera.net> writes:

> After yet another variation in objdump output caused this test to fail
> (on a Debian port, no less), I decided whatever putative benefit we
> get from looking at the object files instead of the library isn't
> worth the maintenence headache.
>
> This version uses nm -P. nm -P should be portable, and fixed format.
> It purposely doesn't use the -D argument, since that is non-POSIX and
> nm on GNU/Linux seems do the right thing without it.

pushed to master

d

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-09-13  8:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-10  6:41 [PATCH] test: simplify T360-symbol-hiding, use nm instead of objdump David Bremner
2014-09-10 10:04 ` Tomi Ollila
2014-09-13  8:07 ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).