Skip to content

Commit 38e41e5

Browse files
authored
Merge pull request #208 from madsmtm/refactor-tests
Refactor assembly and UI tests
2 parents 06c4264 + d8a975f commit 38e41e5

File tree

96 files changed

+276
-199
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+276
-199
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ jobs:
149149
CXXFLAGS: ${{ matrix.cflags }}
150150
ASMFLAGS: ${{ matrix.cflags }}
151151
LDFLAGS: ${{ matrix.cflags }}
152-
HOSTARGS: --no-default-features --features std --features ${{ matrix.runtime || 'apple' }}
153152
ARGS: --no-default-features --features std --features ${{ matrix.runtime || 'apple' }} ${{ matrix.args }}
154153
# Use --no-fail-fast, except with dinghy
155154
TESTARGS: ${{ matrix.dinghy && ' ' || '--no-fail-fast' }} ${{ matrix.test-args }}
@@ -373,8 +372,8 @@ jobs:
373372
if: ${{ matrix.ui }}
374373
uses: actions-rs/cargo@v1
375374
with:
376-
command: test
377-
args: ${{ env.ARGS }} ${{ env.TESTARGS }} -ptests --features tests/ui --tests ui
375+
command: run
376+
args: --features=run --bin test-ui
378377
env:
379378
# Allow warnings
380379
RUSTFLAGS: "-C debuginfo=0"
@@ -412,7 +411,7 @@ jobs:
412411
run:
413412
export HOST_TARGET=$(rustc -vV | grep host | cut -f2 -d' ')
414413

415-
cargo run ${{ env.HOSTARGS }} --features assembly --target=$HOST_TARGET test_assembly ${{ env.ARGS }}
414+
cargo run --target=$HOST_TARGET --features=run --bin test-assembly -- ${{ env.ARGS }}
416415

417416
- name: Launch XCode Simulator
418417
if: matrix.dinghy

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ members = [
88
"block2",
99
"block-sys",
1010
"tests",
11-
"tests/assembly/*",
11+
"test-assembly",
12+
"test-assembly/crates/*",
13+
"test-ui",
1214
]
1315
resolver = "2"

test-assembly/Cargo.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[package]
2+
name = "test-assembly"
3+
version = "0.1.0"
4+
edition = "2021"
5+
publish = false
6+
7+
repository = "https://github.com/madsmtm/objc2"
8+
license = "MIT"
9+
10+
build = "build.rs"
11+
12+
[features]
13+
run = ["cargo_metadata"]
14+
15+
[dependencies]
16+
cargo_metadata = { version = "0.14", optional = true }

test-assembly/build.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
use std::env;
2+
3+
fn main() {
4+
println!("cargo:rerun-if-changed=build.rs");
5+
println!("cargo:rustc-env=TARGET={}", env::var("TARGET").unwrap());
6+
}

0 commit comments

Comments
 (0)