aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrun_tests.py22
-rw-r--r--test cases/common/6 linkshared/installed_files.txt2
2 files changed, 24 insertions, 0 deletions
diff --git a/run_tests.py b/run_tests.py
index 93f9640..475eaae 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -30,6 +30,27 @@ if True: # Currently we have only one backend.
test_commands = [ninja_command, 'test']
install_commands = [ninja_command, 'install']
+def validate_install(srcdir, installdir):
+ info_file = os.path.join(srcdir, 'installed_files.txt')
+ expected = {}
+ found = {}
+ if os.path.exists(info_file):
+ for line in open(info_file):
+ expected[line.strip()] = True
+ for root, dirs, files in os.walk(installdir):
+ for fname in files:
+ found_name = os.path.join(root, fname)[len(installdir)+1:]
+ found[found_name] = True
+ print(found)
+ expected = set(expected)
+ found = set(found)
+ missing = expected - found
+ for fname in missing:
+ raise RuntimeError('Expected file %s missing.' % fname)
+ extra = found - expected
+ for fname in extra:
+ raise RuntimeError('Found extra file %s.' % fname)
+
def run_test(testdir, should_succeed=True):
shutil.rmtree(test_build_dir)
shutil.rmtree(install_dir)
@@ -57,6 +78,7 @@ def run_test(testdir, should_succeed=True):
pi.wait()
if pi.returncode != 0:
raise RuntimeError('Running install failed.')
+ validate_install(testdir, install_dir)
def gather_tests(testdir):
tests = [t.replace('\\', '/').split('/', 2)[2] for t in glob(os.path.join(testdir, '*'))]
diff --git a/test cases/common/6 linkshared/installed_files.txt b/test cases/common/6 linkshared/installed_files.txt
new file mode 100644
index 0000000..cabfd81
--- /dev/null
+++ b/test cases/common/6 linkshared/installed_files.txt
@@ -0,0 +1,2 @@
+bin/prog
+lib/libmylib.so