aboutsummaryrefslogtreecommitdiff
path: root/munit.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-09-17 18:06:38 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2016-10-08 07:34:39 -0400
commit9fdec2d23f5209148da6279d8b3893dfbc682af3 (patch)
tree8af5bd9fded85417fab260a5437a024043fb4e2a /munit.py
parentcd6d5a642de41ccec5c934d5a6de074599f54436 (diff)
downloadmeson-9fdec2d23f5209148da6279d8b3893dfbc682af3.zip
meson-9fdec2d23f5209148da6279d8b3893dfbc682af3.tar.gz
meson-9fdec2d23f5209148da6279d8b3893dfbc682af3.tar.bz2
Created a file to run unit test suite with.
Diffstat (limited to 'munit.py')
-rwxr-xr-xmunit.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/munit.py b/munit.py
new file mode 100755
index 0000000..f2651d8
--- /dev/null
+++ b/munit.py
@@ -0,0 +1,40 @@
+#!/usr/bin/env python3
+# Copyright 2016 The Meson development team
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+# http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import unittest, os, shutil
+import subprocess
+
+class LinuxlikeTests(unittest.TestCase):
+
+ def setUp(self):
+ super().setUp()
+ src_root = os.path.split(__file__)[0]
+ self.meson_command = [os.path.join(src_root, 'meson.py')]
+ self.ninja_command = ['ninja']
+ self.common_test_dir = os.path.join(src_root, 'test cases/common')
+ self.builddir = 'unittestdir' # fixme to be unique
+ os.mkdir(self.builddir)
+
+ def tearDown(self):
+ shutil.rmtree(self.builddir)
+ super().tearDown()
+
+ def test_simple(self):
+ testdir = os.path.join(self.common_test_dir, '1 trivial')
+ subprocess.check_call(self.meson_command + [testdir, self.builddir])
+ subprocess.check_call(self.ninja_command, cwd=self.builddir)
+
+if __name__ == '__main__':
+ unittest.main()