mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Don't run proc-macro-srv tests on the rust-analyzer repo
proc-macro ABI breakage still affects the tests when a new stable version releases. Ideally we'd still be able to run the tests on the rust-analyzer repo without having to update the proc-macro ABI, but for now just to unblock CI we will ignore them here, as they are still run in upstream.
This commit is contained in:
parent
5b49745d00
commit
f57cd838d8
6 changed files with 26 additions and 23 deletions
|
@ -2,10 +2,10 @@
|
|||
|
||||
#[macro_use]
|
||||
mod utils;
|
||||
use expect_test::expect;
|
||||
use paths::AbsPathBuf;
|
||||
use utils::*;
|
||||
|
||||
use expect_test::expect;
|
||||
|
||||
#[test]
|
||||
fn test_derive_empty() {
|
||||
assert_expand("DeriveEmpty", r#"struct S;"#, expect![[r#"SUBTREE $"#]]);
|
||||
|
@ -157,10 +157,3 @@ fn list_test_macros() {
|
|||
DeriveError [CustomDerive]"#]]
|
||||
.assert_eq(&res);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_version_check() {
|
||||
let path = AbsPathBuf::assert(fixtures::proc_macro_test_dylib_path());
|
||||
let info = proc_macro_api::read_dylib_info(&path).unwrap();
|
||||
assert!(info.version.1 >= 50);
|
||||
}
|
||||
|
|
|
@ -1,15 +1,9 @@
|
|||
//! utils used in proc-macro tests
|
||||
|
||||
use crate::dylib;
|
||||
use crate::ProcMacroSrv;
|
||||
use expect_test::Expect;
|
||||
use std::str::FromStr;
|
||||
|
||||
pub mod fixtures {
|
||||
pub fn proc_macro_test_dylib_path() -> std::path::PathBuf {
|
||||
proc_macro_test::PROC_MACRO_TEST_LOCATION.into()
|
||||
}
|
||||
}
|
||||
use crate::{dylib, proc_macro_test_dylib_path, ProcMacroSrv};
|
||||
|
||||
fn parse_string(code: &str) -> Option<crate::abis::TestTokenStream> {
|
||||
// This is a bit strange. We need to parse a string into a token stream into
|
||||
|
@ -30,7 +24,7 @@ pub fn assert_expand_attr(macro_name: &str, ra_fixture: &str, attr_args: &str, e
|
|||
}
|
||||
|
||||
fn assert_expand_impl(macro_name: &str, input: &str, attr: Option<&str>, expect: Expect) {
|
||||
let path = fixtures::proc_macro_test_dylib_path();
|
||||
let path = proc_macro_test_dylib_path();
|
||||
let expander = dylib::Expander::new(&path).unwrap();
|
||||
let fixture = parse_string(input).unwrap();
|
||||
let attr = attr.map(|attr| parse_string(attr).unwrap().into_subtree());
|
||||
|
@ -40,7 +34,7 @@ fn assert_expand_impl(macro_name: &str, input: &str, attr: Option<&str>, expect:
|
|||
}
|
||||
|
||||
pub(crate) fn list() -> Vec<String> {
|
||||
let dylib_path = fixtures::proc_macro_test_dylib_path();
|
||||
let dylib_path = proc_macro_test_dylib_path();
|
||||
let mut srv = ProcMacroSrv::default();
|
||||
let res = srv.list_macros(&dylib_path).unwrap();
|
||||
res.into_iter().map(|(name, kind)| format!("{} [{:?}]", name, kind)).collect()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue