Merge branch 'rust_tests' into 'master'
Rust tests See merge request Librem5/squeekboard!106
This commit is contained in:
@ -250,10 +250,6 @@
|
|||||||
|
|
||||||
#![doc(html_root_url = "https://docs.rs/bitflags/1.1.0")]
|
#![doc(html_root_url = "https://docs.rs/bitflags/1.1.0")]
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
#[macro_use]
|
|
||||||
extern crate std;
|
|
||||||
|
|
||||||
// Re-export libcore using an alias so that the macros can work without
|
// Re-export libcore using an alias so that the macros can work without
|
||||||
// requiring `extern crate core` downstream.
|
// requiring `extern crate core` downstream.
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
@ -467,8 +463,8 @@ macro_rules! __impl_bitflags {
|
|||||||
)+
|
)+
|
||||||
}
|
}
|
||||||
) => {
|
) => {
|
||||||
impl bitflags::_core::fmt::Debug for $BitFlags {
|
impl crate::bitflags::_core::fmt::Debug for $BitFlags {
|
||||||
fn fmt(&self, f: &mut bitflags::_core::fmt::Formatter) -> bitflags::_core::fmt::Result {
|
fn fmt(&self, f: &mut crate::bitflags::_core::fmt::Formatter) -> crate::bitflags::_core::fmt::Result {
|
||||||
// This convoluted approach is to handle #[cfg]-based flag
|
// This convoluted approach is to handle #[cfg]-based flag
|
||||||
// omission correctly. For example it needs to support:
|
// omission correctly. For example it needs to support:
|
||||||
//
|
//
|
||||||
@ -520,24 +516,24 @@ macro_rules! __impl_bitflags {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
impl bitflags::_core::fmt::Binary for $BitFlags {
|
impl crate::bitflags::_core::fmt::Binary for $BitFlags {
|
||||||
fn fmt(&self, f: &mut bitflags::_core::fmt::Formatter) -> bitflags::_core::fmt::Result {
|
fn fmt(&self, f: &mut crate::bitflags::_core::fmt::Formatter) -> crate::bitflags::_core::fmt::Result {
|
||||||
bitflags::_core::fmt::Binary::fmt(&self.bits, f)
|
crate::bitflags::_core::fmt::Binary::fmt(&self.bits, f)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
impl bitflags::_core::fmt::Octal for $BitFlags {
|
impl crate::bitflags::_core::fmt::Octal for $BitFlags {
|
||||||
fn fmt(&self, f: &mut bitflags::_core::fmt::Formatter) -> bitflags::_core::fmt::Result {
|
fn fmt(&self, f: &mut crate::bitflags::_core::fmt::Formatter) -> crate::bitflags::_core::fmt::Result {
|
||||||
bitflags::_core::fmt::Octal::fmt(&self.bits, f)
|
crate::bitflags::_core::fmt::Octal::fmt(&self.bits, f)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
impl bitflags::_core::fmt::LowerHex for $BitFlags {
|
impl crate::bitflags::_core::fmt::LowerHex for $BitFlags {
|
||||||
fn fmt(&self, f: &mut bitflags::_core::fmt::Formatter) -> bitflags::_core::fmt::Result {
|
fn fmt(&self, f: &mut crate::bitflags::_core::fmt::Formatter) -> crate::bitflags::_core::fmt::Result {
|
||||||
bitflags::_core::fmt::LowerHex::fmt(&self.bits, f)
|
crate::bitflags::_core::fmt::LowerHex::fmt(&self.bits, f)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
impl bitflags::_core::fmt::UpperHex for $BitFlags {
|
impl crate::bitflags::_core::fmt::UpperHex for $BitFlags {
|
||||||
fn fmt(&self, f: &mut bitflags::_core::fmt::Formatter) -> bitflags::_core::fmt::Result {
|
fn fmt(&self, f: &mut crate::bitflags::_core::fmt::Formatter) -> crate::bitflags::_core::fmt::Result {
|
||||||
bitflags::_core::fmt::UpperHex::fmt(&self.bits, f)
|
crate::bitflags::_core::fmt::UpperHex::fmt(&self.bits, f)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -593,11 +589,11 @@ macro_rules! __impl_bitflags {
|
|||||||
/// Convert from underlying bit representation, unless that
|
/// Convert from underlying bit representation, unless that
|
||||||
/// representation contains bits that do not correspond to a flag.
|
/// representation contains bits that do not correspond to a flag.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn from_bits(bits: $T) -> bitflags::_core::option::Option<$BitFlags> {
|
pub fn from_bits(bits: $T) -> crate::bitflags::_core::option::Option<$BitFlags> {
|
||||||
if (bits & !$BitFlags::all().bits()) == 0 {
|
if (bits & !$BitFlags::all().bits()) == 0 {
|
||||||
bitflags::_core::option::Option::Some($BitFlags { bits })
|
crate::bitflags::_core::option::Option::Some($BitFlags { bits })
|
||||||
} else {
|
} else {
|
||||||
bitflags::_core::option::Option::None
|
crate::bitflags::_core::option::Option::None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -671,7 +667,7 @@ macro_rules! __impl_bitflags {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl bitflags::_core::ops::BitOr for $BitFlags {
|
impl crate::bitflags::_core::ops::BitOr for $BitFlags {
|
||||||
type Output = $BitFlags;
|
type Output = $BitFlags;
|
||||||
|
|
||||||
/// Returns the union of the two sets of flags.
|
/// Returns the union of the two sets of flags.
|
||||||
@ -681,7 +677,7 @@ macro_rules! __impl_bitflags {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl bitflags::_core::ops::BitOrAssign for $BitFlags {
|
impl crate::bitflags::_core::ops::BitOrAssign for $BitFlags {
|
||||||
|
|
||||||
/// Adds the set of flags.
|
/// Adds the set of flags.
|
||||||
#[inline]
|
#[inline]
|
||||||
@ -690,7 +686,7 @@ macro_rules! __impl_bitflags {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl bitflags::_core::ops::BitXor for $BitFlags {
|
impl crate::bitflags::_core::ops::BitXor for $BitFlags {
|
||||||
type Output = $BitFlags;
|
type Output = $BitFlags;
|
||||||
|
|
||||||
/// Returns the left flags, but with all the right flags toggled.
|
/// Returns the left flags, but with all the right flags toggled.
|
||||||
@ -700,7 +696,7 @@ macro_rules! __impl_bitflags {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl bitflags::_core::ops::BitXorAssign for $BitFlags {
|
impl crate::bitflags::_core::ops::BitXorAssign for $BitFlags {
|
||||||
|
|
||||||
/// Toggles the set of flags.
|
/// Toggles the set of flags.
|
||||||
#[inline]
|
#[inline]
|
||||||
@ -709,7 +705,7 @@ macro_rules! __impl_bitflags {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl bitflags::_core::ops::BitAnd for $BitFlags {
|
impl crate::bitflags::_core::ops::BitAnd for $BitFlags {
|
||||||
type Output = $BitFlags;
|
type Output = $BitFlags;
|
||||||
|
|
||||||
/// Returns the intersection between the two sets of flags.
|
/// Returns the intersection between the two sets of flags.
|
||||||
@ -719,7 +715,7 @@ macro_rules! __impl_bitflags {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl bitflags::_core::ops::BitAndAssign for $BitFlags {
|
impl crate::bitflags::_core::ops::BitAndAssign for $BitFlags {
|
||||||
|
|
||||||
/// Disables all flags disabled in the set.
|
/// Disables all flags disabled in the set.
|
||||||
#[inline]
|
#[inline]
|
||||||
@ -728,7 +724,7 @@ macro_rules! __impl_bitflags {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl bitflags::_core::ops::Sub for $BitFlags {
|
impl crate::bitflags::_core::ops::Sub for $BitFlags {
|
||||||
type Output = $BitFlags;
|
type Output = $BitFlags;
|
||||||
|
|
||||||
/// Returns the set difference of the two sets of flags.
|
/// Returns the set difference of the two sets of flags.
|
||||||
@ -738,7 +734,7 @@ macro_rules! __impl_bitflags {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl bitflags::_core::ops::SubAssign for $BitFlags {
|
impl crate::bitflags::_core::ops::SubAssign for $BitFlags {
|
||||||
|
|
||||||
/// Disables all flags enabled in the set.
|
/// Disables all flags enabled in the set.
|
||||||
#[inline]
|
#[inline]
|
||||||
@ -747,7 +743,7 @@ macro_rules! __impl_bitflags {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl bitflags::_core::ops::Not for $BitFlags {
|
impl crate::bitflags::_core::ops::Not for $BitFlags {
|
||||||
type Output = $BitFlags;
|
type Output = $BitFlags;
|
||||||
|
|
||||||
/// Returns the complement of this set of flags.
|
/// Returns the complement of this set of flags.
|
||||||
@ -757,16 +753,16 @@ macro_rules! __impl_bitflags {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl bitflags::_core::iter::Extend<$BitFlags> for $BitFlags {
|
impl crate::bitflags::_core::iter::Extend<$BitFlags> for $BitFlags {
|
||||||
fn extend<T: bitflags::_core::iter::IntoIterator<Item=$BitFlags>>(&mut self, iterator: T) {
|
fn extend<T: crate::bitflags::_core::iter::IntoIterator<Item=$BitFlags>>(&mut self, iterator: T) {
|
||||||
for item in iterator {
|
for item in iterator {
|
||||||
self.insert(item)
|
self.insert(item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl bitflags::_core::iter::FromIterator<$BitFlags> for $BitFlags {
|
impl crate::bitflags::_core::iter::FromIterator<$BitFlags> for $BitFlags {
|
||||||
fn from_iter<T: bitflags::_core::iter::IntoIterator<Item=$BitFlags>>(iterator: T) -> $BitFlags {
|
fn from_iter<T: crate::bitflags::_core::iter::IntoIterator<Item=$BitFlags>>(iterator: T) -> $BitFlags {
|
||||||
let mut result = Self::empty();
|
let mut result = Self::empty();
|
||||||
result.extend(iterator);
|
result.extend(iterator);
|
||||||
result
|
result
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
#[macro_use]
|
#[macro_use]
|
||||||
mod bitflags;
|
mod bitflags;
|
||||||
|
|
||||||
mod imservice;
|
mod imservice;
|
||||||
|
|||||||
@ -73,6 +73,15 @@ rslib = static_library(
|
|||||||
rust_crate_type: 'staticlib'
|
rust_crate_type: 'staticlib'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
rstests = executable(
|
||||||
|
'rstests',
|
||||||
|
sources: ['lib.rs'],
|
||||||
|
rust_args: ['--test'],
|
||||||
|
install: false
|
||||||
|
)
|
||||||
|
|
||||||
|
test('rstests', rstests)
|
||||||
|
|
||||||
libsqueekboard = static_library('libsqueekboard',
|
libsqueekboard = static_library('libsqueekboard',
|
||||||
sources,
|
sources,
|
||||||
link_with: rslib,
|
link_with: rslib,
|
||||||
|
|||||||
Reference in New Issue
Block a user