Skip to content

Commit d9bd66f

Browse files
committed
Move itest runner into itest::framework module
1 parent 7981d80 commit d9bd66f

37 files changed

+145
-128
lines changed

godot-macros/src/itest.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub fn attribute_itest(input_decl: Declaration) -> ParseResult<TokenStream> {
5454
return bad_signature(&func);
5555
}
5656
} else {
57-
quote! { __unused_context: &crate::TestContext }
57+
quote! { __unused_context: &crate::framework::TestContext }
5858
};
5959

6060
let body = &func.body;
@@ -64,7 +64,7 @@ pub fn attribute_itest(input_decl: Declaration) -> ParseResult<TokenStream> {
6464
#body
6565
}
6666

67-
::godot::sys::plugin_add!(__GODOT_ITEST in crate; crate::RustTestCase {
67+
::godot::sys::plugin_add!(__GODOT_ITEST in crate::framework; crate::framework::RustTestCase {
6868
name: #test_name_str,
6969
skipped: #skipped,
7070
focused: #focused,

itest/rust/src/array_test.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
55
*/
66

7-
use crate::{expect_panic, itest};
87
use godot::prelude::*;
98

9+
use crate::framework::{expect_panic, itest};
10+
1011
#[itest]
1112
fn array_default() {
1213
assert_eq!(VariantArray::default().len(), 0);

itest/rust/src/base_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
55
*/
66

7-
use crate::itest;
7+
use crate::framework::itest;
88
use godot::prelude::*;
99

1010
#[itest(skip)]

itest/rust/src/basis_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use godot::builtin::inner::InnerBasis;
88
use godot::builtin::math::assert_eq_approx;
99
use godot::builtin::{real, Basis, EulerOrder, RealConv, ToVariant, VariantOperator, Vector3};
1010

11-
use crate::itest;
11+
use crate::framework::itest;
1212

1313
const TEST_BASIS: Basis = Basis::from_rows(
1414
Vector3::new(0.942155, -0.270682, 0.197677),

itest/rust/src/builtin_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
55
*/
66

7-
use crate::itest;
7+
use crate::framework::itest;
88
use godot::builtin::inner::*;
99
use godot::prelude::*;
1010

itest/rust/src/callable_test.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ use godot::builtin::{varray, Callable, ToVariant, Variant};
99
use godot::engine::Object;
1010
use godot::obj::{Gd, Share};
1111
use godot::prelude::GodotString;
12-
use godot::test::itest;
12+
13+
use crate::framework::itest;
1314

1415
#[derive(GodotClass)]
1516
#[class(init, base=RefCounted)]

itest/rust/src/codegen_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// This file tests the presence, naming and accessibility of generated symbols.
88
// Functionality is only tested on a superficial level (to make sure general FFI mechanisms work).
99

10-
use crate::itest;
10+
use crate::framework::itest;
1111
use godot::builtin::inner::{InnerColor, InnerString};
1212
use godot::engine::{FileAccess, HttpRequest, HttpRequestVirtual, Image};
1313
use godot::prelude::*;

itest/rust/src/color_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
55
*/
66

7-
use crate::itest;
7+
use crate::framework::itest;
88
use godot::builtin::{Color, ColorChannelOrder};
99

1010
#[itest]

itest/rust/src/derive_variant/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use std::fmt::Debug;
88

9-
use crate::itest;
9+
use crate::framework::itest;
1010
use crate::variant_test::roundtrip;
1111
use godot::bind::FromVariant;
1212
use godot::bind::ToVariant;

itest/rust/src/dictionary_test.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66

77
use std::collections::{HashMap, HashSet};
88

9-
use crate::{expect_panic, itest};
109
use godot::builtin::{dict, varray, Dictionary, FromVariant, ToVariant, Variant};
1110
use godot::obj::Share;
1211

12+
use crate::framework::{expect_panic, itest};
13+
1314
#[itest]
1415
fn dictionary_default() {
1516
assert_eq!(Dictionary::default().len(), 0);

0 commit comments

Comments
 (0)