Enable linux tests (#12493)
Note: - We have disabled all tests that rely on Postgres in the Linux CI. We only really need to test these once, and as macOS is our team's primary platform, we'll only enable them on macOS for local reproduction. - We have disabled all tests that rely on the font metrics. We standardized on Zed Mono in many fonts, but our CoreText Text System and Cosmic Text System proved to be very different in effect. We should revisit if we decide to standardize our text system across platforms (e.g. using Harfbuzz everywhere) - Extended the condition timeout significantly. Our CI machines are slow enough that this is causing spurious errors in random tests. Release Notes: - N/A --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
parent
066cdc2297
commit
10d3ad4e33
22 changed files with 107 additions and 52 deletions
|
@ -143,21 +143,28 @@ impl Boundary {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::{font, TestAppContext, TestDispatcher, TextRun, WindowTextSystem, WrapBoundary};
|
||||
use crate::{font, TestAppContext, TestDispatcher};
|
||||
#[cfg(target_os = "macos")]
|
||||
use crate::{TextRun, WindowTextSystem, WrapBoundary};
|
||||
use rand::prelude::*;
|
||||
|
||||
#[test]
|
||||
fn test_wrap_line() {
|
||||
let dispatcher = TestDispatcher::new(StdRng::seed_from_u64(0));
|
||||
let cx = TestAppContext::new(dispatcher, None);
|
||||
cx.text_system()
|
||||
.add_fonts(vec![std::fs::read(
|
||||
"../../assets/fonts/zed-mono/zed-mono-extended.ttf",
|
||||
)
|
||||
.unwrap()
|
||||
.into()])
|
||||
.unwrap();
|
||||
let id = cx.text_system().font_id(&font("Zed Mono")).unwrap();
|
||||
|
||||
cx.update(|cx| {
|
||||
let text_system = cx.text_system().clone();
|
||||
let mut wrapper = LineWrapper::new(
|
||||
text_system.font_id(&font("Courier")).unwrap(),
|
||||
px(16.),
|
||||
text_system.platform_text_system.clone(),
|
||||
);
|
||||
let mut wrapper =
|
||||
LineWrapper::new(id, px(16.), text_system.platform_text_system.clone());
|
||||
assert_eq!(
|
||||
wrapper
|
||||
.wrap_line("aa bbb cccc ddddd eeee", px(72.))
|
||||
|
@ -213,8 +220,11 @@ mod tests {
|
|||
}
|
||||
|
||||
// For compatibility with the test macro
|
||||
#[cfg(target_os = "macos")]
|
||||
use crate as gpui;
|
||||
|
||||
// These seem to vary wildly based on the the text system.
|
||||
#[cfg(target_os = "macos")]
|
||||
#[crate::test]
|
||||
fn test_wrap_shaped_line(cx: &mut TestAppContext) {
|
||||
cx.update(|cx| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue