Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add opt-in compatibility tests #10

Merged
merged 35 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
3b6bc91
Try some things out
fasterthanlime Jul 23, 2024
ab0803b
compatibility misatch check
fasterthanlime Jul 23, 2024
8be5a81
alright
fasterthanlime Jul 23, 2024
cb74d9d
Coloring
fasterthanlime Jul 23, 2024
7e2197b
Looks good
fasterthanlime Jul 23, 2024
9c51e7b
box
fasterthanlime Jul 23, 2024
568d4ed
Box box box
fasterthanlime Jul 23, 2024
458a918
Sfaety things
fasterthanlime Jul 23, 2024
b2df448
comma
fasterthanlime Jul 23, 2024
7213929
Lots more tests
fasterthanlime Jul 23, 2024
ce4e44e
Install nightly I suppose
fasterthanlime Jul 23, 2024
327500d
Introduce node.js test runner
fasterthanlime Jul 23, 2024
f92e082
tests refinement
fasterthanlime Jul 23, 2024
bea77ff
Better box rendering
fasterthanlime Jul 23, 2024
7797e3d
Use rust test runner
fasterthanlime Jul 23, 2024
13fef1e
Prettier formatting
fasterthanlime Jul 23, 2024
0797a65
Fix tests on mac/windows mayhaps?
fasterthanlime Jul 23, 2024
b43719b
Add target dir to library path for Linux
fasterthanlime Jul 23, 2024
c6abd28
Print summary
fasterthanlime Jul 23, 2024
9900066
some fixes
fasterthanlime Jul 23, 2024
76f101e
Mh
fasterthanlime Jul 23, 2024
640e7c1
allow some tests to fail on linux
fasterthanlime Jul 23, 2024
5e34f2b
exit codes
fasterthanlime Jul 23, 2024
81a9839
Box drawing (again)
fasterthanlime Jul 23, 2024
73e89c3
eprintln
fasterthanlime Jul 23, 2024
7094c11
more DX
fasterthanlime Jul 23, 2024
d3491e9
Tentative windows impl
fasterthanlime Jul 23, 2024
f1601fd
printf debugging aw yiss
fasterthanlime Jul 23, 2024
bf46f35
in a thread?? I knew DLL initializers were limited
fasterthanlime Jul 23, 2024
c6b0aff
Simpler window check
fasterthanlime Jul 23, 2024
98c503b
welp, no safety for windows
fasterthanlime Jul 23, 2024
d801db9
windows get macro'd out
fasterthanlime Jul 23, 2024
ac0c545
no doc comment
fasterthanlime Jul 23, 2024
f8cc6cd
Allow windows tests to fail
fasterthanlime Jul 23, 2024
b7ba170
Maybe we just got lucky on unixes?
fasterthanlime Jul 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,11 @@ jobs:
toolchain: stable
profile: minimal
override: true
- name: Run cargo command
- name: Add nightly
run: rustup toolchain add nightly
- name: Run tests runner
run: |
cargo run --manifest-path test-crates/bin/Cargo.toml
cd tests/
cargo run
shell: bash
continue-on-error: ${{ matrix.os == 'windows-latest' }}
- name: Run cargo command (release)
run: |
cargo run --manifest-path test-crates/bin/Cargo.toml --release
continue-on-error: ${{ matrix.os == 'windows-latest' }}
- name: Run cargo command (release with SOPRINTLN=1)
if: matrix.os != 'windows-latest'
run: |
export SOPRINTLN=1
cargo run --manifest-path test-crates/bin/Cargo.toml --release
15 changes: 13 additions & 2 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,16 @@
check:
cargo hack --each-feature --exclude-all-features clippy --manifest-path rubicon/Cargo.toml

test:
SOPRINTLN=1 cargo run --manifest-path test-crates/bin/Cargo.toml
test *args:
#!/usr/bin/env bash -eux
BIN_CHANNEL="${BIN_CHANNEL:-stable}"
BIN_FLAGS="${BIN_FLAGS:-}"

SOPRINTLN=1 cargo "+${BIN_CHANNEL}" build --manifest-path test-crates/samplebin/Cargo.toml ${BIN_FLAGS}

export DYLD_LIBRARY_PATH=$(rustc "+stable" --print sysroot)/lib
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$(rustc "+nightly" --print sysroot)/lib
export LD_LIBRARY_PATH=$(rustc "+stable" --print sysroot)/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(rustc "+nightly" --print sysroot)/lib

./test-crates/samplebin/target/debug/samplebin {{args}}
69 changes: 69 additions & 0 deletions rubicon/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions rubicon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,15 @@ keywords = ["ffi", "thread-local"]
crate-type = ["dylib"]

[dependencies]
ctor = { version = "0.2.8", optional = true }
libc = { version = "0.2.155", optional = true }
paste = { version = "1.0.15", optional = true }

[build-dependencies]
rustc_version = { version = "0.4.0", optional = true }

[features]
default = []
export-globals = ["dep:paste"]
import-globals = ["dep:paste"]
export-globals = ["dep:paste", "dep:rustc_version"]
import-globals = ["dep:paste", "dep:rustc_version", "dep:ctor", "dep:libc"]
ctor = ["dep:ctor"]
14 changes: 14 additions & 0 deletions rubicon/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
fn main() {
#[cfg(any(feature = "export-globals", feature = "import-globals"))]
{
use std::env;

// Get the Rust compiler version and set it as an environment variable.
let rustc_version = rustc_version::version().unwrap();
println!("cargo:rustc-env=RUBICON_RUSTC_VERSION={}", rustc_version);

// Pass the target triple.
let target = env::var("TARGET").unwrap();
println!("cargo:rustc-env=RUBICON_TARGET_TRIPLE={}", target);
}
}
Loading
Loading