Skip to content

Commit e674857

Browse files
committed
Test both duplicating and full-auto code paths
1 parent b9417dc commit e674857

File tree

11 files changed

+27
-16
lines changed

11 files changed

+27
-16
lines changed

.github/workflows/full-ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,12 @@ jobs:
281281
godot: "3.5.1-stable"
282282
postfix: ' (inventory)'
283283
build_args: '--features inventory'
284+
- rust: stable
285+
godot: "3.5.1-stable"
286+
postfix: ' (inventory)'
287+
# Limiting no-manual-register tests to stable as to not slow down CI too far -- if inventory is
288+
# working across all 3 Rust versions, this is likely to be as well.
289+
build_args: '--features inventory,no-manual-register'
284290
- rust: nightly
285291
godot: "3.5.1-stable"
286292
postfix: ' (nightly)'

check.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ function findGodot() {
6363
}
6464

6565
features="gdnative/async,gdnative/serde,gdnative/inventory"
66+
itest_toggled_features="no-manual-register"
6667
cmds=()
6768

6869
for arg in "${args[@]}"; do
@@ -81,6 +82,9 @@ for arg in "${args[@]}"; do
8182
cmds+=("cargo build --manifest-path test/Cargo.toml --features $features")
8283
cmds+=("cp target/debug/*gdnative_test* test/project/lib/")
8384
cmds+=("$godotBin --path test/project")
85+
cmds+=("cargo build --manifest-path test/Cargo.toml --features $features,$itest_toggled_features")
86+
cmds+=("cp target/debug/*gdnative_test* test/project/lib/")
87+
cmds+=("$godotBin --path test/project")
8488
;;
8589
doc)
8690
cmds+=("cargo doc --lib -p gdnative --no-deps --features $features")

test/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ type-tag-fallback = ["gdnative/type-tag-fallback"]
1616
custom-godot = ["gdnative/custom-godot"]
1717
ptrcall = ["gdnative/ptrcall"]
1818
inventory = ["gdnative/inventory"]
19+
no-manual-register = []
1920

2021
[dependencies]
2122
gdnative = { path = "../gdnative", features = ["gd-test", "serde", "async"] }

test/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,14 +236,14 @@ godot_itest! { test_from_instance_id {
236236
assert!(unsafe { Reference::try_from_instance_id(instance_id).is_none() });
237237
}}
238238

239-
#[cfg(not(feature = "inventory"))]
239+
#[cfg(not(feature = "no-manual-register"))]
240240
fn init(handle: InitHandle) {
241241
handle.add_class::<Foo>();
242242
handle.add_class::<OptionalArgs>();
243243
delegate_init(handle);
244244
}
245245

246-
#[cfg(feature = "inventory")]
246+
#[cfg(feature = "no-manual-register")]
247247
fn init(handle: InitHandle) {
248248
delegate_init(handle);
249249
}

test/src/test_as_arg.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ use gdnative::prelude::*;
44
use std::mem::MaybeUninit;
55
use std::ops::Deref;
66

7-
#[cfg(not(feature = "inventory"))]
7+
#[cfg(not(feature = "no-manual-register"))]
88
pub(crate) fn register(handle: InitHandle) {
99
handle.add_class::<MyNode>();
1010
}
1111

12-
#[cfg(feature = "inventory")]
12+
#[cfg(feature = "no-manual-register")]
1313
pub(crate) fn register(_handle: InitHandle) {}
1414

1515
pub(crate) fn run_tests() -> bool {

test/src/test_async.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ thread_local! {
1313
};
1414
}
1515

16-
#[cfg(not(feature = "inventory"))]
16+
#[cfg(not(feature = "no-manual-register"))]
1717
pub(crate) fn register(handle: InitHandle) {
1818
gdnative::tasks::register_runtime(&handle);
1919
gdnative::tasks::set_executor(EXECUTOR.with(|e| *e));
@@ -22,7 +22,7 @@ pub(crate) fn register(handle: InitHandle) {
2222
handle.add_class::<AsyncExecutorDriver>();
2323
}
2424

25-
#[cfg(feature = "inventory")]
25+
#[cfg(feature = "no-manual-register")]
2626
pub(crate) fn register(handle: InitHandle) {
2727
gdnative::tasks::register_runtime(&handle);
2828
gdnative::tasks::set_executor(EXECUTOR.with(|e| *e));

test/src/test_derive.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub(crate) fn run_tests() -> bool {
2626
status
2727
}
2828

29-
#[cfg(not(feature = "inventory"))]
29+
#[cfg(not(feature = "no-manual-register"))]
3030
pub(crate) fn register(handle: InitHandle) {
3131
handle.add_class::<MinimalDerive>();
3232
handle.add_class::<EmplacementOnly>();
@@ -40,7 +40,7 @@ pub(crate) fn register(handle: InitHandle) {
4040
handle.add_class::<MyVec>();
4141
}
4242

43-
#[cfg(feature = "inventory")]
43+
#[cfg(feature = "no-manual-register")]
4444
pub(crate) fn register(_handle: InitHandle) {}
4545

4646
// ----------------------------------------------------------------------------------------------------------------------------------------------

test/src/test_free_ub.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ pub(crate) fn run_tests() -> bool {
1010
status
1111
}
1212

13-
#[cfg(not(feature = "inventory"))]
13+
#[cfg(not(feature = "no-manual-register"))]
1414
pub(crate) fn register(handle: InitHandle) {
1515
handle.add_class::<Bar>();
1616
}
1717

18-
#[cfg(feature = "inventory")]
18+
#[cfg(feature = "no-manual-register")]
1919
pub(crate) fn register(_handle: InitHandle) {}
2020

2121
#[derive(NativeClass)]

test/src/test_generic_class.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ pub(crate) fn run_tests() -> bool {
77
true
88
}
99

10-
#[cfg(not(feature = "inventory"))]
10+
#[cfg(not(feature = "no-manual-register"))]
1111
pub(crate) fn register(handle: InitHandle) {
1212
handle.add_class::<IntOps>();
1313
handle.add_class::<StrOps>();
1414
}
1515

16-
#[cfg(feature = "inventory")]
16+
#[cfg(feature = "no-manual-register")]
1717
pub(crate) fn register(_handle: InitHandle) {}
1818

1919
#[derive(NativeClass)]

test/src/test_map_owned.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ pub(crate) fn run_tests() -> bool {
99
status
1010
}
1111

12-
#[cfg(not(feature = "inventory"))]
12+
#[cfg(not(feature = "no-manual-register"))]
1313
pub(crate) fn register(handle: InitHandle) {
1414
handle.add_class::<VecBuilder>();
1515
}
1616

17-
#[cfg(feature = "inventory")]
17+
#[cfg(feature = "no-manual-register")]
1818
pub(crate) fn register(_handle: InitHandle) {}
1919

2020
#[derive(NativeClass)]

0 commit comments

Comments
 (0)