integration-test-macros: Use absolute path to `IntegrationTest`

Macros shouldn't require importing additional symbols which are used in
their generated code. They should use the absolute paths instead.
pull/544/head
Michal Rostecki 3 years ago
parent 113e3ef018
commit bb7b760706

@ -10,7 +10,7 @@ pub fn integration_test(_attr: TokenStream, item: TokenStream) -> TokenStream {
let expanded = quote! {
#item
inventory::submit!(IntegrationTest {
inventory::submit!(crate::tests::IntegrationTest {
name: concat!(module_path!(), "::", #name_str),
test_fn: #name,
});

@ -1,4 +1,4 @@
use super::{integration_test, IntegrationTest};
use super::integration_test;
use aya::include_bytes_aligned;
use object::{Object, ObjectSymbol};

@ -13,7 +13,7 @@ use log::warn;
use crate::tests::kernel_version;
use super::{integration_test, IntegrationTest};
use super::integration_test;
const MAX_RETRIES: u32 = 100;
const RETRY_DURATION_MS: u64 = 10;

@ -4,7 +4,7 @@ use std::collections::HashMap;
use aya::include_bytes_aligned;
use aya_obj::{generated::bpf_insn, Object, ProgramSection};
use super::{integration_test, IntegrationTest};
use super::integration_test;
#[integration_test]
fn run_with_rbpf() {

@ -4,7 +4,7 @@ use tempfile::TempDir;
use aya::{maps::Array, programs::TracePoint, BpfLoader, Btf, Endianness};
use super::{integration_test, IntegrationTest};
use super::integration_test;
// In the tests below we often use values like 0xAAAAAAAA or -0x7AAAAAAA. Those values have no
// special meaning, they just have "nice" bit patterns that can be helpful while debugging.

@ -5,7 +5,7 @@ use aya::{
};
use log::info;
use super::{integration_test, kernel_version, IntegrationTest};
use super::{integration_test, kernel_version};
#[integration_test]
fn xdp() {

Loading…
Cancel
Save