aboutsummaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
Diffstat (limited to 'unittests')
-rw-r--r--unittests/baseplatformtests.py1
-rw-r--r--unittests/platformagnostictests.py17
2 files changed, 18 insertions, 0 deletions
diff --git a/unittests/baseplatformtests.py b/unittests/baseplatformtests.py
index d83ef3f..9e55f6e 100644
--- a/unittests/baseplatformtests.py
+++ b/unittests/baseplatformtests.py
@@ -70,6 +70,7 @@ class BasePlatformTests(TestCase):
self.uninstall_command = get_backend_commands(self.backend)
# Test directories
self.common_test_dir = os.path.join(src_root, 'test cases/common')
+ self.python_test_dir = os.path.join(src_root, 'test cases/python')
self.rust_test_dir = os.path.join(src_root, 'test cases/rust')
self.vala_test_dir = os.path.join(src_root, 'test cases/vala')
self.framework_test_dir = os.path.join(src_root, 'test cases/frameworks')
diff --git a/unittests/platformagnostictests.py b/unittests/platformagnostictests.py
index 39965c6..fce115d 100644
--- a/unittests/platformagnostictests.py
+++ b/unittests/platformagnostictests.py
@@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+import json
import os
import tempfile
import subprocess
@@ -121,3 +122,19 @@ class PlatformAgnosticTests(BasePlatformTests):
'''))
subprocess.check_call(self.wrap_command + ['update-db'], cwd=testdir)
self.init(testdir, workdir=testdir)
+
+ def test_none_backend(self):
+ testdir = os.path.join(self.python_test_dir, '7 install path')
+
+ self.init(testdir, extra_args=['--backend=none'], override_envvars={'NINJA': 'absolutely false command'})
+ self.assertPathDoesNotExist(os.path.join(self.builddir, 'build.ninja'))
+
+ self.run_tests(inprocess=True, override_envvars={})
+
+ out = self._run(self.meson_command + ['install', f'--destdir={self.installdir}'], workdir=self.builddir)
+ self.assertNotIn('Only ninja backend is supported to rebuild the project before installation.', out)
+
+ with open(os.path.join(testdir, 'test.json'), 'rb') as f:
+ dat = json.load(f)
+ for i in dat['installed']:
+ self.assertPathExists(os.path.join(self.installdir, i['file']))