Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests do not work with --no-default-features #75

Closed
ignatenkobrain opened this issue Jul 6, 2018 · 1 comment
Closed

tests do not work with --no-default-features #75

ignatenkobrain opened this issue Jul 6, 2018 · 1 comment
Labels

Comments

@ignatenkobrain
Copy link
Collaborator

⋊> ~/t/config-rs on master ◦ cargo test --no-default-features --no-fail-fast                                                                                                                               16:08:20
   Compiling config v0.9.0 (file:///home/brain/tmp/config-rs)
error[E0599]: no variant named `Toml` found for type `config::FileFormat` in the current scope
 --> tests/merge.rs:7:41
  |
7 |     c.merge(File::new("tests/Settings", FileFormat::Toml))
  |                                         ^^^^^^^^^^^^^^^^ variant not found in `config::FileFormat`

error[E0599]: no variant named `Toml` found for type `config::FileFormat` in the current scope
 --> tests/errors.rs:7:41
  |
7 |     c.merge(File::new("tests/Settings", FileFormat::Toml))
  |                                         ^^^^^^^^^^^^^^^^ variant not found in `config::FileFormat`

error[E0599]: no variant named `Json` found for type `config::FileFormat` in the current scope
  --> tests/datetime.rs:15:13
   |
15 |             FileFormat::Json,
   |             ^^^^^^^^^^^^^^^^ variant not found in `config::FileFormat`

error[E0599]: no variant named `Yaml` found for type `config::FileFormat` in the current scope
 --> tests/file.rs:8:53
  |
8 |     let res = c.merge(File::new("tests/NoSettings", FileFormat::Yaml).required(false));
  |                                                     ^^^^^^^^^^^^^^^^ variant not found in `config::FileFormat`

error[E0599]: no variant named `Yaml` found for type `config::FileFormat` in the current scope
  --> tests/file.rs:16:53
   |
16 |     let res = c.merge(File::new("tests/NoSettings", FileFormat::Yaml));
   |                                                     ^^^^^^^^^^^^^^^^ variant not found in `config::FileFormat`

error[E0599]: no variant named `Toml` found for type `config::FileFormat` in the current scope
  --> tests/errors.rs:16:59
   |
16 |     let res = c.merge(File::new("tests/Settings-invalid", FileFormat::Toml));
   |                                                           ^^^^^^^^^^^^^^^^ variant not found in `config::FileFormat`

error[E0599]: no variant named `Yaml` found for type `config::FileFormat` in the current scope
  --> tests/datetime.rs:22:13
   |
22 |             FileFormat::Yaml,
   |             ^^^^^^^^^^^^^^^^ variant not found in `config::FileFormat`

error[E0599]: no variant named `Toml` found for type `config::FileFormat` in the current scope
  --> tests/datetime.rs:29:13
   |
29 |             FileFormat::Toml,
   |             ^^^^^^^^^^^^^^^^ variant not found in `config::FileFormat`

error[E0599]: no variant named `Hjson` found for type `config::FileFormat` in the current scope
  --> tests/datetime.rs:38:13
   |
38 |             FileFormat::Hjson,
   |             ^^^^^^^^^^^^^^^^^ variant not found in `config::FileFormat`

error[E0599]: no variant named `Toml` found for type `config::FileFormat` in the current scope
  --> tests/merge.rs:10:52
   |
10 |     c.merge(File::new("tests/Settings-production", FileFormat::Toml))
   |                                                    ^^^^^^^^^^^^^^^^ variant not found in `config::FileFormat`

error[E0599]: no variant named `Ini` found for type `config::FileFormat` in the current scope
  --> tests/datetime.rs:45:13
   |
45 |             FileFormat::Ini,
   |             ^^^^^^^^^^^^^^^ variant not found in `config::FileFormat`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0599`.
error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0599`.
error: Could not compile `config`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `config`.
warning: build failed, waiting for other jobs to finish...
error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0599`.
error: Could not compile `config`.
warning: build failed, waiting for other jobs to finish...
error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0599`.
error: Could not compile `config`.
warning: build failed, waiting for other jobs to finish...
error[E0599]: no variant named `Hjson` found for type `config::FileFormat` in the current scope
  --> tests/file_hjson.rs:35:41
   |
35 |     c.merge(File::new("tests/Settings", FileFormat::Hjson))
   |                                         ^^^^^^^^^^^^^^^^^ variant not found in `config::FileFormat`

error[E0599]: no variant named `Ini` found for type `config::FileFormat` in the current scope
  --> tests/file_ini.rs:28:41
   |
28 |     c.merge(File::new("tests/Settings", FileFormat::Ini))
   |                                         ^^^^^^^^^^^^^^^ variant not found in `config::FileFormat`

error[E0599]: no variant named `Ini` found for type `config::FileFormat` in the current scope
  --> tests/file_ini.rs:56:59
   |
56 |     let res = c.merge(File::new("tests/Settings-invalid", FileFormat::Ini));
   |                                                           ^^^^^^^^^^^^^^^ variant not found in `config::FileFormat`

error[E0599]: no variant named `Hjson` found for type `config::FileFormat` in the current scope
  --> tests/file_hjson.rs:68:59
   |
68 |     let res = c.merge(File::new("tests/Settings-invalid", FileFormat::Hjson));
   |                                                           ^^^^^^^^^^^^^^^^^ variant not found in `config::FileFormat`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0599`.
error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0599`.
error[E0599]: no variant named `Toml` found for type `config::FileFormat` in the current scope
  --> tests/get.rs:32:41
   |
32 |     c.merge(File::new("tests/Settings", FileFormat::Toml))
   |                                         ^^^^^^^^^^^^^^^^ variant not found in `config::FileFormat`

error: Could not compile `config`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `config`.
warning: build failed, waiting for other jobs to finish...
error[E0599]: no variant named `Toml` found for type `config::FileFormat` in the current scope
  --> tests/file_toml.rs:43:41
   |
43 |     c.merge(File::new("tests/Settings", FileFormat::Toml))
   |                                         ^^^^^^^^^^^^^^^^ variant not found in `config::FileFormat`

error[E0599]: no variant named `Toml` found for type `config::FileFormat` in the current scope
  --> tests/file_toml.rs:78:59
   |
78 |     let res = c.merge(File::new("tests/Settings-invalid", FileFormat::Toml));
   |                                                           ^^^^^^^^^^^^^^^^ variant not found in `config::FileFormat`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0599`.
error: Could not compile `config`.
warning: build failed, waiting for other jobs to finish...
error: aborting due to previous error

For more information about this error, try `rustc --explain E0599`.
error: Could not compile `config`.

To learn more, run the command again with --verbose.

It would be nice if you could guard those tests by #[cfg()]

@mehcode mehcode added the bug label Jul 6, 2018
@mehcode
Copy link
Owner

mehcode commented Sep 26, 2018

Fixed it for now. Definitely could use better core test coverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants