[game-data-packager] 09/11: Add autopkgtests

Simon McVittie smcv at debian.org
Sun Dec 31 16:59:27 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch master
in repository game-data-packager.

commit e7548e08659428ade53963e1533c5c872b227c26
Author: Simon McVittie <smcv at debian.org>
Date:   Sun Dec 31 15:38:16 2017 +0000

    Add autopkgtests
    
    Signed-off-by: Simon McVittie <smcv at debian.org>
---
 debian/changelog               | 1 +
 debian/tests/check-equivalence | 1 +
 debian/tests/check-syntax      | 1 +
 debian/tests/control           | 7 +++++++
 debian/tests/deb               | 1 +
 debian/tests/hashed-file       | 1 +
 debian/tests/integration       | 1 +
 debian/tests/rpm               | 1 +
 debian/tests/umod              | 1 +
 tests/deb.py                   | 6 ++++++
 tests/hashed_file.py           | 5 +++++
 tests/rpm.py                   | 6 ++++++
 tests/umod.py                  | 6 ++++++
 tools/check_equivalence.py     | 4 ++++
 tools/check_syntax.py          | 5 +++++
 15 files changed, 47 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index ab19552..2e0b8bf 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -26,6 +26,7 @@ game-data-packager (56) UNRELEASED; urgency=medium
       files from which the template was produced are not available [smcv]
     - Skip memory-hungry check_equivalence.py during Debian package build
       [smcv]
+    - Add autopkgtests [smcv]
   * Internal changes:
     - Declare compliance with Debian Policy 4.1.3 [smcv]
     - Use debhelper compat level 11 [smcv]
diff --git a/debian/tests/check-equivalence b/debian/tests/check-equivalence
new file mode 120000
index 0000000..c0336d3
--- /dev/null
+++ b/debian/tests/check-equivalence
@@ -0,0 +1 @@
+../../tools/check_equivalence.py
\ No newline at end of file
diff --git a/debian/tests/check-syntax b/debian/tests/check-syntax
new file mode 120000
index 0000000..a161d94
--- /dev/null
+++ b/debian/tests/check-syntax
@@ -0,0 +1 @@
+../../tools/check_syntax.py
\ No newline at end of file
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..fb8d9e2
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,7 @@
+Tests: check-equivalence
+Depends: game-data-packager
+Restrictions: allow-stderr, x-gdp-memory-hungry
+
+Tests: check-syntax deb hashed-file integration rpm umod
+Depends: game-data-packager
+Restrictions: allow-stderr
diff --git a/debian/tests/deb b/debian/tests/deb
new file mode 120000
index 0000000..168009c
--- /dev/null
+++ b/debian/tests/deb
@@ -0,0 +1 @@
+../../tests/deb.py
\ No newline at end of file
diff --git a/debian/tests/hashed-file b/debian/tests/hashed-file
new file mode 120000
index 0000000..6406115
--- /dev/null
+++ b/debian/tests/hashed-file
@@ -0,0 +1 @@
+../../tests/hashed_file.py
\ No newline at end of file
diff --git a/debian/tests/integration b/debian/tests/integration
new file mode 120000
index 0000000..3b9cad0
--- /dev/null
+++ b/debian/tests/integration
@@ -0,0 +1 @@
+../../tests/integration.py
\ No newline at end of file
diff --git a/debian/tests/rpm b/debian/tests/rpm
new file mode 120000
index 0000000..d61d19d
--- /dev/null
+++ b/debian/tests/rpm
@@ -0,0 +1 @@
+../../tests/rpm.py
\ No newline at end of file
diff --git a/debian/tests/umod b/debian/tests/umod
new file mode 120000
index 0000000..91773d7
--- /dev/null
+++ b/debian/tests/umod
@@ -0,0 +1 @@
+../../tests/umod.py
\ No newline at end of file
diff --git a/tests/deb.py b/tests/deb.py
index d9fe984..104f29f 100644
--- a/tests/deb.py
+++ b/tests/deb.py
@@ -15,8 +15,14 @@
 # You can find the GPL license text on a Debian system under
 # /usr/share/common-licenses/GPL-2.
 
+import os
+import sys
 import unittest
 
+if 'GDP_UNINSTALLED' not in os.environ:
+    sys.path.insert(0, '/usr/share/game-data-packager')
+    sys.path.insert(0, '/usr/share/games/game-data-packager')
+
 from game_data_packager.data import (PackageRelation)
 from game_data_packager.packaging.deb import (DebPackaging)
 
diff --git a/tests/hashed_file.py b/tests/hashed_file.py
index efe71bc..972e1b8 100755
--- a/tests/hashed_file.py
+++ b/tests/hashed_file.py
@@ -16,9 +16,14 @@
 # /usr/share/common-licenses/GPL-2.
 
 import hashlib
+import os
 import sys
 import unittest
 
+if 'GDP_UNINSTALLED' not in os.environ:
+    sys.path.insert(0, '/usr/share/game-data-packager')
+    sys.path.insert(0, '/usr/share/games/game-data-packager')
+
 from game_data_packager.command_line import (TerminalProgress)
 from game_data_packager.data import (HashedFile)
 
diff --git a/tests/rpm.py b/tests/rpm.py
index 4b301d8..c372d7c 100644
--- a/tests/rpm.py
+++ b/tests/rpm.py
@@ -15,8 +15,14 @@
 # You can find the GPL license text on a Debian system under
 # /usr/share/common-licenses/GPL-2.
 
+import os
+import sys
 import unittest
 
+if 'GDP_UNINSTALLED' not in os.environ:
+    sys.path.insert(0, '/usr/share/game-data-packager')
+    sys.path.insert(0, '/usr/share/games/game-data-packager')
+
 from game_data_packager.data import (PackageRelation)
 from game_data_packager.packaging.rpm import (RpmPackaging)
 
diff --git a/tests/umod.py b/tests/umod.py
index 7dac520..9ee5016 100755
--- a/tests/umod.py
+++ b/tests/umod.py
@@ -16,9 +16,15 @@
 # /usr/share/common-licenses/GPL-2.
 
 import io
+import os
 import struct
+import sys
 import unittest
 
+if 'GDP_UNINSTALLED' not in os.environ:
+    sys.path.insert(0, '/usr/share/game-data-packager')
+    sys.path.insert(0, '/usr/share/games/game-data-packager')
+
 from game_data_packager.unpack.umod import Umod
 
 HELLO_TXT = b'Hello, world!\n'
diff --git a/tools/check_equivalence.py b/tools/check_equivalence.py
index 820c555..e348bb8 100755
--- a/tools/check_equivalence.py
+++ b/tools/check_equivalence.py
@@ -23,6 +23,10 @@ import time
 import yaml
 from contextlib import suppress
 
+if 'GDP_UNINSTALLED' not in os.environ:
+    sys.path.insert(0, '/usr/share/game-data-packager')
+    sys.path.insert(0, '/usr/share/games/game-data-packager')
+
 from game_data_packager.game import (load_games, load_game)
 from game_data_packager.util import ascii_safe
 
diff --git a/tools/check_syntax.py b/tools/check_syntax.py
index 3832f9b..9270b85 100755
--- a/tools/check_syntax.py
+++ b/tools/check_syntax.py
@@ -16,8 +16,13 @@
 # /usr/share/common-licenses/GPL-2.
 
 import os
+import sys
 import yaml
 
+if 'GDP_UNINSTALLED' not in os.environ:
+    sys.path.insert(0, '/usr/share/game-data-packager')
+    sys.path.insert(0, '/usr/share/games/game-data-packager')
+
 from game_data_packager.game import load_games
 from game_data_packager.util import ascii_safe
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/game-data-packager.git



More information about the Pkg-games-commits mailing list