summaryrefslogtreecommitdiffstats
path: root/python/mozbuild/mozbuild/test
diff options
context:
space:
mode:
Diffstat (limited to 'python/mozbuild/mozbuild/test')
-rw-r--r--python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/Cargo.toml18
-rw-r--r--python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/moz.build18
-rw-r--r--python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/shallow/Cargo.toml6
-rw-r--r--python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/the/depths/Cargo.toml9
-rw-r--r--python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/moz.build27
-rw-r--r--python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/rust1/Cargo.toml15
-rw-r--r--python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/rust1/moz.build4
-rw-r--r--python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/rust2/Cargo.toml15
-rw-r--r--python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/rust2/moz.build4
-rw-r--r--python/mozbuild/mozbuild/test/frontend/data/rust-library-dash-folding/Cargo.toml15
-rw-r--r--python/mozbuild/mozbuild/test/frontend/data/rust-library-dash-folding/moz.build18
-rw-r--r--python/mozbuild/mozbuild/test/frontend/data/rust-library-invalid-crate-type/Cargo.toml15
-rw-r--r--python/mozbuild/mozbuild/test/frontend/data/rust-library-invalid-crate-type/moz.build18
-rw-r--r--python/mozbuild/mozbuild/test/frontend/data/rust-library-name-mismatch/Cargo.toml12
-rw-r--r--python/mozbuild/mozbuild/test/frontend/data/rust-library-name-mismatch/moz.build18
-rw-r--r--python/mozbuild/mozbuild/test/frontend/data/rust-library-no-cargo-toml/moz.build18
-rw-r--r--python/mozbuild/mozbuild/test/frontend/data/rust-library-no-lib-section/Cargo.toml12
-rw-r--r--python/mozbuild/mozbuild/test/frontend/data/rust-library-no-lib-section/moz.build18
-rw-r--r--python/mozbuild/mozbuild/test/frontend/data/rust-library-no-profile-section/Cargo.toml12
-rw-r--r--python/mozbuild/mozbuild/test/frontend/data/rust-library-no-profile-section/moz.build18
-rw-r--r--python/mozbuild/mozbuild/test/frontend/data/rust-library-non-abort-panic/Cargo.toml14
-rw-r--r--python/mozbuild/mozbuild/test/frontend/data/rust-library-non-abort-panic/moz.build18
-rw-r--r--python/mozbuild/mozbuild/test/frontend/test_emitter.py73
23 files changed, 0 insertions, 395 deletions
diff --git a/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/Cargo.toml b/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/Cargo.toml
deleted file mode 100644
index 99d10b1a6..000000000
--- a/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/Cargo.toml
+++ /dev/null
@@ -1,18 +0,0 @@
-[package]
-name = "random-crate"
-version = "0.1.0"
-authors = [
- "Nobody <nobody@mozilla.org>",
-]
-
-[lib]
-crate-type = ["staticlib"]
-
-[dependencies]
-deep-crate = { version = "0.1.0", path = "the/depths" }
-
-[profile.dev]
-panic = "abort"
-
-[profile.release]
-panic = "abort"
diff --git a/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/moz.build b/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/moz.build
deleted file mode 100644
index 01b3a35a7..000000000
--- a/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/moz.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# Any copyright is dedicated to the Public Domain.
-# http://creativecommons.org/publicdomain/zero/1.0/
-
-@template
-def Library(name):
- '''Template for libraries.'''
- LIBRARY_NAME = name
-
-
-@template
-def RustLibrary(name):
- '''Template for Rust libraries.'''
- Library(name)
-
- IS_RUST_LIBRARY = True
-
-
-RustLibrary('random-crate')
diff --git a/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/shallow/Cargo.toml b/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/shallow/Cargo.toml
deleted file mode 100644
index c347f8c08..000000000
--- a/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/shallow/Cargo.toml
+++ /dev/null
@@ -1,6 +0,0 @@
-[package]
-name = "shallow-crate"
-version = "0.1.0"
-authors = [
- "Nobody <nobody@mozilla.org>",
-]
diff --git a/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/the/depths/Cargo.toml b/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/the/depths/Cargo.toml
deleted file mode 100644
index 10a4ded0a..000000000
--- a/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/the/depths/Cargo.toml
+++ /dev/null
@@ -1,9 +0,0 @@
-[package]
-name = "deep-crate"
-version = "0.1.0"
-authors = [
- "Nobody <nobody@mozilla.org>",
-]
-
-[dependencies]
-shallow-crate = { path = "../../shallow" }
diff --git a/python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/moz.build b/python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/moz.build
deleted file mode 100644
index b493ec5b5..000000000
--- a/python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/moz.build
+++ /dev/null
@@ -1,27 +0,0 @@
-# Any copyright is dedicated to the Public Domain.
-# http://creativecommons.org/publicdomain/zero/1.0/
-
-@template
-def Library(name):
- '''Template for libraries.'''
- LIBRARY_NAME = name
-
-
-@template
-def RustLibrary(name):
- '''Template for Rust libraries.'''
- Library(name)
-
- IS_RUST_LIBRARY = True
-
-Library('test')
-
-DIRS += [
- 'rust1',
- 'rust2',
-]
-
-USE_LIBS += [
- 'rust1',
- 'rust2',
-]
diff --git a/python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/rust1/Cargo.toml b/python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/rust1/Cargo.toml
deleted file mode 100644
index 9037d8f65..000000000
--- a/python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/rust1/Cargo.toml
+++ /dev/null
@@ -1,15 +0,0 @@
-[package]
-name = "rust1"
-version = "0.1.0"
-authors = [
- "Nobody <nobody@mozilla.org>",
-]
-
-[lib]
-crate-type = ["staticlib"]
-
-[profile.dev]
-panic = "abort"
-
-[profile.release]
-panic = "abort"
diff --git a/python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/rust1/moz.build b/python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/rust1/moz.build
deleted file mode 100644
index 7418cca65..000000000
--- a/python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/rust1/moz.build
+++ /dev/null
@@ -1,4 +0,0 @@
-# Any copyright is dedicated to the Public Domain.
-# http://creativecommons.org/publicdomain/zero/1.0/
-
-RustLibrary('rust1')
diff --git a/python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/rust2/Cargo.toml b/python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/rust2/Cargo.toml
deleted file mode 100644
index f2001895e..000000000
--- a/python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/rust2/Cargo.toml
+++ /dev/null
@@ -1,15 +0,0 @@
-[package]
-name = "rust2"
-version = "0.1.0"
-authors = [
- "Nobody <nobody@mozilla.org>",
-]
-
-[lib]
-crate-type = ["staticlib"]
-
-[profile.dev]
-panic = "abort"
-
-[profile.release]
-panic = "abort"
diff --git a/python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/rust2/moz.build b/python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/rust2/moz.build
deleted file mode 100644
index abd34e7db..000000000
--- a/python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/rust2/moz.build
+++ /dev/null
@@ -1,4 +0,0 @@
-# Any copyright is dedicated to the Public Domain.
-# http://creativecommons.org/publicdomain/zero/1.0/
-
-RustLibrary('rust2')
diff --git a/python/mozbuild/mozbuild/test/frontend/data/rust-library-dash-folding/Cargo.toml b/python/mozbuild/mozbuild/test/frontend/data/rust-library-dash-folding/Cargo.toml
deleted file mode 100644
index fa122b7ce..000000000
--- a/python/mozbuild/mozbuild/test/frontend/data/rust-library-dash-folding/Cargo.toml
+++ /dev/null
@@ -1,15 +0,0 @@
-[package]
-name = "random-crate"
-version = "0.1.0"
-authors = [
- "Nobody <nobody@mozilla.org>",
-]
-
-[lib]
-crate-type = ["staticlib"]
-
-[profile.dev]
-panic = "abort"
-
-[profile.release]
-panic = "abort"
diff --git a/python/mozbuild/mozbuild/test/frontend/data/rust-library-dash-folding/moz.build b/python/mozbuild/mozbuild/test/frontend/data/rust-library-dash-folding/moz.build
deleted file mode 100644
index 01b3a35a7..000000000
--- a/python/mozbuild/mozbuild/test/frontend/data/rust-library-dash-folding/moz.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# Any copyright is dedicated to the Public Domain.
-# http://creativecommons.org/publicdomain/zero/1.0/
-
-@template
-def Library(name):
- '''Template for libraries.'''
- LIBRARY_NAME = name
-
-
-@template
-def RustLibrary(name):
- '''Template for Rust libraries.'''
- Library(name)
-
- IS_RUST_LIBRARY = True
-
-
-RustLibrary('random-crate')
diff --git a/python/mozbuild/mozbuild/test/frontend/data/rust-library-invalid-crate-type/Cargo.toml b/python/mozbuild/mozbuild/test/frontend/data/rust-library-invalid-crate-type/Cargo.toml
deleted file mode 100644
index 26c653fde..000000000
--- a/python/mozbuild/mozbuild/test/frontend/data/rust-library-invalid-crate-type/Cargo.toml
+++ /dev/null
@@ -1,15 +0,0 @@
-[package]
-name = "random-crate"
-version = "0.1.0"
-authors = [
- "Nobody <nobody@mozilla.org>",
-]
-
-[lib]
-crate-type = ["dylib"]
-
-[profile.dev]
-panic = "abort"
-
-[profile.release]
-panic = "abort"
diff --git a/python/mozbuild/mozbuild/test/frontend/data/rust-library-invalid-crate-type/moz.build b/python/mozbuild/mozbuild/test/frontend/data/rust-library-invalid-crate-type/moz.build
deleted file mode 100644
index 01b3a35a7..000000000
--- a/python/mozbuild/mozbuild/test/frontend/data/rust-library-invalid-crate-type/moz.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# Any copyright is dedicated to the Public Domain.
-# http://creativecommons.org/publicdomain/zero/1.0/
-
-@template
-def Library(name):
- '''Template for libraries.'''
- LIBRARY_NAME = name
-
-
-@template
-def RustLibrary(name):
- '''Template for Rust libraries.'''
- Library(name)
-
- IS_RUST_LIBRARY = True
-
-
-RustLibrary('random-crate')
diff --git a/python/mozbuild/mozbuild/test/frontend/data/rust-library-name-mismatch/Cargo.toml b/python/mozbuild/mozbuild/test/frontend/data/rust-library-name-mismatch/Cargo.toml
deleted file mode 100644
index 41a9a7c8f..000000000
--- a/python/mozbuild/mozbuild/test/frontend/data/rust-library-name-mismatch/Cargo.toml
+++ /dev/null
@@ -1,12 +0,0 @@
-[package]
-name = "deterministic-crate"
-version = "0.1.0"
-authors = [
- "Nobody <nobody@mozilla.org>",
-]
-
-[profile.dev]
-panic = "abort"
-
-[profile.release]
-panic = "abort"
diff --git a/python/mozbuild/mozbuild/test/frontend/data/rust-library-name-mismatch/moz.build b/python/mozbuild/mozbuild/test/frontend/data/rust-library-name-mismatch/moz.build
deleted file mode 100644
index 01b3a35a7..000000000
--- a/python/mozbuild/mozbuild/test/frontend/data/rust-library-name-mismatch/moz.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# Any copyright is dedicated to the Public Domain.
-# http://creativecommons.org/publicdomain/zero/1.0/
-
-@template
-def Library(name):
- '''Template for libraries.'''
- LIBRARY_NAME = name
-
-
-@template
-def RustLibrary(name):
- '''Template for Rust libraries.'''
- Library(name)
-
- IS_RUST_LIBRARY = True
-
-
-RustLibrary('random-crate')
diff --git a/python/mozbuild/mozbuild/test/frontend/data/rust-library-no-cargo-toml/moz.build b/python/mozbuild/mozbuild/test/frontend/data/rust-library-no-cargo-toml/moz.build
deleted file mode 100644
index 01b3a35a7..000000000
--- a/python/mozbuild/mozbuild/test/frontend/data/rust-library-no-cargo-toml/moz.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# Any copyright is dedicated to the Public Domain.
-# http://creativecommons.org/publicdomain/zero/1.0/
-
-@template
-def Library(name):
- '''Template for libraries.'''
- LIBRARY_NAME = name
-
-
-@template
-def RustLibrary(name):
- '''Template for Rust libraries.'''
- Library(name)
-
- IS_RUST_LIBRARY = True
-
-
-RustLibrary('random-crate')
diff --git a/python/mozbuild/mozbuild/test/frontend/data/rust-library-no-lib-section/Cargo.toml b/python/mozbuild/mozbuild/test/frontend/data/rust-library-no-lib-section/Cargo.toml
deleted file mode 100644
index a20b19c62..000000000
--- a/python/mozbuild/mozbuild/test/frontend/data/rust-library-no-lib-section/Cargo.toml
+++ /dev/null
@@ -1,12 +0,0 @@
-[package]
-name = "random-crate"
-version = "0.1.0"
-authors = [
- "Nobody <nobody@mozilla.org>",
-]
-
-[profile.dev]
-panic = "abort"
-
-[profile.release]
-panic = "abort"
diff --git a/python/mozbuild/mozbuild/test/frontend/data/rust-library-no-lib-section/moz.build b/python/mozbuild/mozbuild/test/frontend/data/rust-library-no-lib-section/moz.build
deleted file mode 100644
index 01b3a35a7..000000000
--- a/python/mozbuild/mozbuild/test/frontend/data/rust-library-no-lib-section/moz.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# Any copyright is dedicated to the Public Domain.
-# http://creativecommons.org/publicdomain/zero/1.0/
-
-@template
-def Library(name):
- '''Template for libraries.'''
- LIBRARY_NAME = name
-
-
-@template
-def RustLibrary(name):
- '''Template for Rust libraries.'''
- Library(name)
-
- IS_RUST_LIBRARY = True
-
-
-RustLibrary('random-crate')
diff --git a/python/mozbuild/mozbuild/test/frontend/data/rust-library-no-profile-section/Cargo.toml b/python/mozbuild/mozbuild/test/frontend/data/rust-library-no-profile-section/Cargo.toml
deleted file mode 100644
index 2700849db..000000000
--- a/python/mozbuild/mozbuild/test/frontend/data/rust-library-no-profile-section/Cargo.toml
+++ /dev/null
@@ -1,12 +0,0 @@
-[package]
-name = "random-crate"
-version = "0.1.0"
-authors = [
- "Nobody <nobody@mozilla.org>",
-]
-
-[lib]
-crate-type = ["staticlib"]
-
-[profile.release]
-panic = "abort"
diff --git a/python/mozbuild/mozbuild/test/frontend/data/rust-library-no-profile-section/moz.build b/python/mozbuild/mozbuild/test/frontend/data/rust-library-no-profile-section/moz.build
deleted file mode 100644
index 01b3a35a7..000000000
--- a/python/mozbuild/mozbuild/test/frontend/data/rust-library-no-profile-section/moz.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# Any copyright is dedicated to the Public Domain.
-# http://creativecommons.org/publicdomain/zero/1.0/
-
-@template
-def Library(name):
- '''Template for libraries.'''
- LIBRARY_NAME = name
-
-
-@template
-def RustLibrary(name):
- '''Template for Rust libraries.'''
- Library(name)
-
- IS_RUST_LIBRARY = True
-
-
-RustLibrary('random-crate')
diff --git a/python/mozbuild/mozbuild/test/frontend/data/rust-library-non-abort-panic/Cargo.toml b/python/mozbuild/mozbuild/test/frontend/data/rust-library-non-abort-panic/Cargo.toml
deleted file mode 100644
index ccdd06243..000000000
--- a/python/mozbuild/mozbuild/test/frontend/data/rust-library-non-abort-panic/Cargo.toml
+++ /dev/null
@@ -1,14 +0,0 @@
-[package]
-name = "random-crate"
-version = "0.1.0"
-authors = [
- "Nobody <nobody@mozilla.org>",
-]
-
-[lib]
-crate-type = ["staticlib"]
-
-[profile.dev]
-panic = "unwind"
-
-[profile.release]
diff --git a/python/mozbuild/mozbuild/test/frontend/data/rust-library-non-abort-panic/moz.build b/python/mozbuild/mozbuild/test/frontend/data/rust-library-non-abort-panic/moz.build
deleted file mode 100644
index d3896decc..000000000
--- a/python/mozbuild/mozbuild/test/frontend/data/rust-library-non-abort-panic/moz.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# Any copyright is dedicated to the Public Domain.
-# http://creativecommons.org/publicdomain/zero/1.0/
-
-@template
-def Library(name):
- '''Template for libraries.'''
- LIBRARY_NAME = name
-
-
-@template
-def RustLibrary(name):
- '''Template for Rust libraries.'''
- Library(name)
-
- IS_RUST_LIBRARY = True
-
-
-RustLibrary('random-crate') \ No newline at end of file
diff --git a/python/mozbuild/mozbuild/test/frontend/test_emitter.py b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
index 6ac4e0aac..191727381 100644
--- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
@@ -31,7 +31,6 @@ from mozbuild.frontend.data import (
LinkageMultipleRustLibrariesError,
LocalInclude,
Program,
- RustLibrary,
SdkFiles,
SharedLibrary,
SimpleProgram,
@@ -1021,78 +1020,6 @@ class TestEmitterBasic(unittest.TestCase):
'Only source directory paths allowed in FINAL_TARGET_PP_FILES:'):
self.read_topsrcdir(reader)
- def test_rust_library_no_cargo_toml(self):
- '''Test that defining a RustLibrary without a Cargo.toml fails.'''
- reader = self.reader('rust-library-no-cargo-toml')
- with self.assertRaisesRegexp(SandboxValidationError,
- 'No Cargo.toml file found'):
- self.read_topsrcdir(reader)
-
- def test_rust_library_name_mismatch(self):
- '''Test that defining a RustLibrary that doesn't match Cargo.toml fails.'''
- reader = self.reader('rust-library-name-mismatch')
- with self.assertRaisesRegexp(SandboxValidationError,
- 'library.*does not match Cargo.toml-defined package'):
- self.read_topsrcdir(reader)
-
- def test_rust_library_no_lib_section(self):
- '''Test that a RustLibrary Cargo.toml with no [lib] section fails.'''
- reader = self.reader('rust-library-no-lib-section')
- with self.assertRaisesRegexp(SandboxValidationError,
- 'Cargo.toml for.* has no \\[lib\\] section'):
- self.read_topsrcdir(reader)
-
- def test_rust_library_no_profile_section(self):
- '''Test that a RustLibrary Cargo.toml with no [profile] section fails.'''
- reader = self.reader('rust-library-no-profile-section')
- with self.assertRaisesRegexp(SandboxValidationError,
- 'Cargo.toml for.* has no \\[profile\\.dev\\] section'):
- self.read_topsrcdir(reader)
-
- def test_rust_library_invalid_crate_type(self):
- '''Test that a RustLibrary Cargo.toml has a permitted crate-type.'''
- reader = self.reader('rust-library-invalid-crate-type')
- with self.assertRaisesRegexp(SandboxValidationError,
- 'crate-type.* is not permitted'):
- self.read_topsrcdir(reader)
-
- def test_rust_library_non_abort_panic(self):
- '''Test that a RustLibrary Cargo.toml has `panic = "abort" set'''
- reader = self.reader('rust-library-non-abort-panic')
- with self.assertRaisesRegexp(SandboxValidationError,
- 'does not specify `panic = "abort"`'):
- self.read_topsrcdir(reader)
-
- def test_rust_library_dash_folding(self):
- '''Test that on-disk names of RustLibrary objects convert dashes to underscores.'''
- reader = self.reader('rust-library-dash-folding',
- extra_substs=dict(RUST_TARGET='i686-pc-windows-msvc'))
- objs = self.read_topsrcdir(reader)
-
- self.assertEqual(len(objs), 1)
- lib = objs[0]
- self.assertIsInstance(lib, RustLibrary)
- self.assertRegexpMatches(lib.lib_name, "random_crate")
- self.assertRegexpMatches(lib.import_name, "random_crate")
- self.assertRegexpMatches(lib.basename, "random-crate")
-
- def test_multiple_rust_libraries(self):
- '''Test that linking multiple Rust libraries throws an error'''
- reader = self.reader('multiple-rust-libraries',
- extra_substs=dict(RUST_TARGET='i686-pc-windows-msvc'))
- with self.assertRaisesRegexp(LinkageMultipleRustLibrariesError,
- 'Cannot link multiple Rust libraries'):
- self.read_topsrcdir(reader)
-
- def test_crate_dependency_path_resolution(self):
- '''Test recursive dependencies resolve with the correct paths.'''
- reader = self.reader('crate-dependency-path-resolution',
- extra_substs=dict(RUST_TARGET='i686-pc-windows-msvc'))
- objs = self.read_topsrcdir(reader)
-
- self.assertEqual(len(objs), 1)
- self.assertIsInstance(objs[0], RustLibrary)
-
def test_android_res_dirs(self):
"""Test that ANDROID_RES_DIRS works properly."""
reader = self.reader('android-res-dirs')