Merge lp:~vibhavp/ubuntu/raring/libiptcdata/add-autopkgtest into lp:ubuntu/raring/libiptcdata

Proposed by Vibhav Pant
Status: Merged
Merged at revision: 12
Proposed branch: lp:~vibhavp/ubuntu/raring/libiptcdata/add-autopkgtest
Merge into: lp:ubuntu/raring/libiptcdata
Diff against target: 82 lines (+59/-0)
4 files modified
debian/changelog (+7/-0)
debian/tests/build (+35/-0)
debian/tests/control (+2/-0)
debian/tests/sample.jpeg.base64 (+15/-0)
To merge this branch: bzr merge lp:~vibhavp/ubuntu/raring/libiptcdata/add-autopkgtest
Reviewer Review Type Date Requested Status
Martin Pitt Approve
Review via email: mp+150504@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

To make this a bit more palatable for forwarding to Debian, could we use a more neutral test image? Perhaps also one which doesn't have any foreign trademark/copyright? E. g. you could just create a very simple 10x10 pixel jpg in gimp with a checkerboard pattern.

32 +# the sample epub is taken from:
33 +# http://code.google.com/p/epub-samples/wiki/SamplesListing

That looks like copy&paste error.

+ iptc_data_save(iptc, &buf, &bufsize);

If you are doing this already, any chance to validate what it writes into buf? That ought to be a predictable value after all?

Thank you!

review: Needs Fixing
13. By Vibhav Pant

Rewrite tests, replace sample jpeg with Tux logo

14. By Vibhav Pant

Fix compiler warnings

15. By Vibhav Pant

Attribute author for tux logo.

Revision history for this message
Martin Pitt (pitti) wrote :

34 +# the sample epub is taken from:
35 +# http://code.google.com/p/epub-samples/wiki/SamplesListing

Needs to go, and be replaced with proper attribution for tux.jpg. Putting it in the changelog is not enough, as that's not easy to find when you just look at the icon. Best would be to add a separate tux.jpeg.README.

But again, to avoid any potential license violation, it would really be better and easier to create a 10x10 dummy jpg in gimp.

58 + assert(buf != NULL);
59 +
60 +

For merging these lines should be removed, they are useless.

review: Needs Fixing
Revision history for this message
Martin Pitt (pitti) wrote :

Also, running this in a VM gives:

adt-run: trace: & ubtree0t-build: - - - - - - - - - - results - - - - - - - - - -
ubtree0t-build FAIL status: 134, stderr: libiptcdata_test: libiptcdata_test....
adt-run: trace: & ubtree0t-build: - - - - - - - - - - stderr - - - - - - - - - -
libiptcdata_test: libiptcdata_test.c:11: main: Assertion `iptc_jpeg_read_ps3(file, buf, sizeof(buf)) == 0' failed.
Aborted (core dumped)

I cannot believe that this works for you when merely running debian/tests/build, as the path would be wrong (it should use $MYDIR for the file name). Please test the scripts before submitting.

16. By Vibhav Pant

The JPEG used here for testing is a dummy 10x10 image created in GIMP.

17. By Vibhav Pant

Add sample.jpeg to debian/source/include-binaries, fix directory path for sample jpeg.

18. By Vibhav Pant

Add sample.jpeg

Revision history for this message
Martin Pitt (pitti) wrote :

This passes in a VM now, thanks!

32 +# the sample epub is taken from:
33 +# http://code.google.com/p/epub-samples/wiki/SamplesListing

This bit still needs to go, but that can be done during merging.

review: Approve
19. By Vibhav Pant

Remove epub line from comment header

Revision history for this message
Vibhav Pant (vibhavp) wrote :

@pitti: I think I accidently misundeerstood you. I thought you were quoting the ebook-tools comment where the file source was benig linked.
Ive removed it from headers (silly me). Thanks!

Revision history for this message
Martin Pitt (pitti) wrote :

Sorry, this produces an unbuildable source. This is still dpkg source v1, so you cannot include binary files into debian/. You either need to uuencode it (and decode in the test), or include it as a textual representation in the C file itself, or convert the source package to v3.

review: Needs Fixing
20. By Vibhav Pant

Remove binary files, add support for uuencode

21. By Vibhav Pant

Add path in tests/build, add test-dep for sharutils.

22. By Vibhav Pant

Correct typo

23. By Vibhav Pant

Output and read in $WORKDIR, not $MYDIR

Revision history for this message
Martin Pitt (pitti) wrote :

Passes now, thanks!

review: Approve
Revision history for this message
Martin Pitt (pitti) wrote :

Note that this is missing XS-Testsuite:, I added this during merging. So for forwarding to Debian please use the merged commit.

Revision history for this message
Martin Pitt (pitti) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2012-06-25 15:50:06 +0000
3+++ debian/changelog 2013-03-01 10:26:22 +0000
4@@ -1,3 +1,10 @@
5+libiptcdata (1.0.4-3ubuntu1) raring; urgency=low
6+
7+ * Add simple autopkgtest to package.
8+ - The JPEG used here for testing is a dummy 10x10 image created in GIMP.
9+
10+ -- Vibhav Pant <vibhavp@ubuntu.com> Tue, 26 Feb 2013 14:02:51 +0530
11+
12 libiptcdata (1.0.4-3) unstable; urgency=low
13
14 * Incorporate patch for docbook manpage generation from Sebastian
15
16=== added directory 'debian/tests'
17=== added file 'debian/tests/build'
18--- debian/tests/build 1970-01-01 00:00:00 +0000
19+++ debian/tests/build 2013-03-01 10:26:22 +0000
20@@ -0,0 +1,35 @@
21+#!/bin/sh
22+# autopkgtest check: Build and run a program against libiptcdata, to verify that
23+# the headers and pkg-config file are installed correctly
24+# (C) 2013 Vibhav Pant
25+# Author: Vibhav Pant <vibhavp@ubuntu.com>
26+
27+set -e
28+
29+MYDIR=$(dirname $(readlink -f $0))
30+WORKDIR=$(mktemp -d)
31+trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
32+cd $WORKDIR
33+cat <<EOF > libiptcdata_test.c
34+#include <libiptcdata/iptc-jpeg.h>
35+#include <stdio.h>
36+#include <assert.h>
37+
38+int main(void)
39+{
40+ unsigned char buf[256*256];
41+ FILE *file;
42+
43+ file = fopen("$WORKDIR/sample.jpeg", "r");
44+ assert(iptc_jpeg_read_ps3(file, buf, sizeof(buf)) == 0);
45+ assert(buf != NULL);
46+ return 0;
47+}
48+EOF
49+
50+gcc -o libiptcdata_test libiptcdata_test.c -liptcdata -Wall -Werror
51+echo "build: OK"
52+uudecode $MYDIR/sample.jpeg.base64 -o $WORKDIR/sample.jpeg
53+[ -x libiptcdata_test ]
54+./libiptcdata_test
55+echo "run: OK"
56
57=== added file 'debian/tests/control'
58--- debian/tests/control 1970-01-01 00:00:00 +0000
59+++ debian/tests/control 2013-03-01 10:26:22 +0000
60@@ -0,0 +1,2 @@
61+Tests: build
62+Depends: libiptcdata0-dev, build-essential, sharutils
63
64=== added file 'debian/tests/sample.jpeg.base64'
65--- debian/tests/sample.jpeg.base64 1970-01-01 00:00:00 +0000
66+++ debian/tests/sample.jpeg.base64 2013-03-01 10:26:22 +0000
67@@ -0,0 +1,15 @@
68+begin-base64 664 sample.jpeg
69+/9j/4AAQSkZJRgABAQEASABIAAD//gATQ3JlYXRlZCB3aXRoIEdJTVD/2wBD
70+AAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsL
71+EBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQU
72+FBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBT/
73+wgARCAAKAAoDAREAAhEBAxEB/8QAFgABAQEAAAAAAAAAAAAAAAAAAgMI/8QA
74+FAEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEAMQAAAByoUCE//EABcQAQEB
75+AQAAAAAAAAAAAAAAAAACEjH/2gAIAQEAAQUCbpXX/8QAFBEBAAAAAAAAAAAA
76+AAAAAAAAIP/aAAgBAwEBPwEf/8QAFBEBAAAAAAAAAAAAAAAAAAAAIP/aAAgB
77+AgEBPwEf/8QAFhAAAwAAAAAAAAAAAAAAAAAAABAx/9oACAEBAAY/Aiv/xAAa
78+EAACAgMAAAAAAAAAAAAAAAAAARARIWGR/9oACAEBAAE/IU6N3pg8f//aAAwD
79+AQACAAMAAAAQgk//xAAUEQEAAAAAAAAAAAAAAAAAAAAg/9oACAEDAQE/EB//
80+xAAUEQEAAAAAAAAAAAAAAAAAAAAg/9oACAECAQE/EB//xAAaEAEBAAIDAAAA
81+AAAAAAAAAAABEQAQQWGh/9oACAEBAAE/EEVFHrAyerCBCF41/9k=
82+====

Subscribers

People subscribed via source and target branches

to all changes: