Convert rustc_serialize
integration tests to unit tests.
Because (a) the vast majority of compiler tests are unit tests, and (b) this works better with `unused_crate_dependencies`.
This commit is contained in:
parent
8121958fda
commit
e2320b32c5
5 changed files with 16 additions and 14 deletions
|
@ -155,3 +155,6 @@ impl_read_signed_leb128!(read_i32_leb128, i32);
|
||||||
impl_read_signed_leb128!(read_i64_leb128, i64);
|
impl_read_signed_leb128!(read_i64_leb128, i64);
|
||||||
impl_read_signed_leb128!(read_i128_leb128, i128);
|
impl_read_signed_leb128!(read_i128_leb128, i128);
|
||||||
impl_read_signed_leb128!(read_isize_leb128, isize);
|
impl_read_signed_leb128!(read_isize_leb128, isize);
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests;
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
// FIXME
|
use super::*;
|
||||||
#![allow(unused_crate_dependencies)]
|
use crate::Decoder;
|
||||||
|
use crate::opaque::{MAGIC_END_BYTES, MemDecoder};
|
||||||
use rustc_serialize::Decoder;
|
|
||||||
use rustc_serialize::leb128::*;
|
|
||||||
use rustc_serialize::opaque::{MAGIC_END_BYTES, MemDecoder};
|
|
||||||
|
|
||||||
macro_rules! impl_test_unsigned_leb128 {
|
macro_rules! impl_test_unsigned_leb128 {
|
||||||
($test_name:ident, $write_fn_name:ident, $read_fn_name:ident, $int_ty:ident) => {
|
($test_name:ident, $write_fn_name:ident, $read_fn_name:ident, $int_ty:ident) => {
|
|
@ -3,8 +3,6 @@
|
||||||
// tidy-alphabetical-start
|
// tidy-alphabetical-start
|
||||||
#![allow(internal_features)]
|
#![allow(internal_features)]
|
||||||
#![allow(rustc::internal)]
|
#![allow(rustc::internal)]
|
||||||
// FIXME
|
|
||||||
#![allow(unused_crate_dependencies)]
|
|
||||||
#![cfg_attr(test, feature(test))]
|
#![cfg_attr(test, feature(test))]
|
||||||
#![doc(
|
#![doc(
|
||||||
html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/",
|
html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/",
|
||||||
|
@ -18,6 +16,10 @@
|
||||||
#![feature(rustdoc_internals)]
|
#![feature(rustdoc_internals)]
|
||||||
// tidy-alphabetical-end
|
// tidy-alphabetical-end
|
||||||
|
|
||||||
|
// Allows macros to refer to this crate as `::rustc_serialize`.
|
||||||
|
#[cfg(test)]
|
||||||
|
extern crate self as rustc_serialize;
|
||||||
|
|
||||||
pub use self::serialize::{Decodable, Decoder, Encodable, Encoder};
|
pub use self::serialize::{Decodable, Decoder, Encodable, Encoder};
|
||||||
|
|
||||||
mod serialize;
|
mod serialize;
|
||||||
|
|
|
@ -451,3 +451,6 @@ impl<'a> Decodable<MemDecoder<'a>> for IntEncodedWithFixedSize {
|
||||||
IntEncodedWithFixedSize(u64::from_le_bytes(bytes))
|
IntEncodedWithFixedSize(u64::from_le_bytes(bytes))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests;
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
#![allow(rustc::internal)]
|
|
||||||
// FIXME
|
|
||||||
#![allow(unused_crate_dependencies)]
|
|
||||||
|
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
|
|
||||||
use rustc_macros::{Decodable_NoContext, Encodable_NoContext};
|
use rustc_macros::{Decodable_NoContext, Encodable_NoContext};
|
||||||
use rustc_serialize::opaque::{FileEncoder, MemDecoder};
|
|
||||||
use rustc_serialize::{Decodable, Encodable};
|
use crate::opaque::{FileEncoder, MemDecoder};
|
||||||
|
use crate::{Decodable, Encodable};
|
||||||
|
|
||||||
#[derive(PartialEq, Clone, Debug, Encodable_NoContext, Decodable_NoContext)]
|
#[derive(PartialEq, Clone, Debug, Encodable_NoContext, Decodable_NoContext)]
|
||||||
struct Struct {
|
struct Struct {
|
Loading…
Add table
Add a link
Reference in a new issue