Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/cli-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
cargo +1.94.0 build --bin termcade --locked --target "$RUST_TARGET"
binary="target/$RUST_TARGET/debug/termcade"
[ "$RUNNER_OS" != Windows ] || binary+=.exe
python3 scripts/test_rust_cli.py --binary "$binary" --wasm target/wasm32-wasip1/release/termcade_probe_fixture.wasm --expected-version "$VERSION"
python3 tests/test_rust_cli.py --binary "$binary" --wasm target/wasm32-wasip1/release/termcade_probe_fixture.wasm --expected-version "$VERSION"
- name: Build release archive
env:
RELEASE_PLATFORM: ${{ matrix.platform }}
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ games/*/build/
*.tcade
# …except the starter pack, embedded in the Rust binary. These committed
# content assets come from termcade-games; ABI-v1 packages remain compatible.
!internal/starter/packs/*.tcade
!src/assets/starter/packs/*.tcade
!crates/plugin/testdata/legacy-starters/*.tcade
game.wasm

Expand Down
2 changes: 1 addition & 1 deletion crates/manifest/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ fn package_rejects_extra_duplicate_nested_encrypted_nonregular_corrupt_and_overs

#[test]
fn original_bundled_go_packages_still_parse_and_install_without_changing_guest_bytes() {
let packs = Path::new(env!("CARGO_MANIFEST_DIR")).join("../../internal/starter/packs");
let packs = Path::new(env!("CARGO_MANIFEST_DIR")).join("../../src/assets/starter/packs");
let destination = tempfile::tempdir().unwrap();
let mut names = Vec::new();
for entry in fs::read_dir(packs).unwrap() {
Expand Down
2 changes: 1 addition & 1 deletion crates/plugin/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ async fn legacy_go_starter_fixtures_run_in_the_rust_host_at_every_density() {

#[tokio::test]
async fn current_starters_run_in_the_rust_host_at_every_density() {
check_game_packages("../../internal/starter/packs").await;
check_game_packages("../../src/assets/starter/packs").await;
}

async fn check_game_packages(relative: &str) {
Expand Down
2 changes: 1 addition & 1 deletion crates/registry/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ async fn errors_and_metadata_are_bounded_and_terminal_safe() {
}
#[tokio::test]
async fn package_digest_length_identity_and_requirements_are_verified() {
let raw = include_bytes!("../../../internal/starter/packs/asteroid.tcade").to_vec();
let raw = include_bytes!("../../../src/assets/starter/packs/asteroid.tcade").to_vec();
let package = termcade_manifest::Package::read(&raw).unwrap();
let m = package.manifest;
let resolution = json!({"id":m.game.id,"version":m.game.version,"size":raw.len(),"sha256":format!("{:x}",Sha256::digest(&raw)),"abi":m.requirements.abi,"width":m.requirements.width,"height":m.requirements.height});
Expand Down
2 changes: 1 addition & 1 deletion scripts/check_archives.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ def main():
desired=next(target for system,arch,ext,target in MATRIX if host_archive().name==f'termcade_{system}_{arch}.{ext}')
assert identity['target']==desired,'native target mismatch'
fixture=Path(os.environ.get('CARGO_TARGET_DIR','target'))/'wasm32-wasip1/release/termcade_probe_fixture.wasm'
subprocess.run(['python3','scripts/test_rust_cli.py','--binary',str(binary),'--wasm',str(fixture),'--expected-version',version],check=True)
subprocess.run(['python3','tests/test_rust_cli.py','--binary',str(binary),'--wasm',str(fixture),'--expected-version',version],check=True)
print(f'{len(expected)} native archives, exact checksums, source identity and CLI journeys verified')
if __name__=='__main__':main()
8 changes: 4 additions & 4 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cargo build --locked --release --target wasm32-wasip1 --manifest-path crates/plu
cargo build --locked --release --target wasm32-wasip1 --manifest-path crates/plugin/testdata/hang-rust/Cargo.toml
cargo test --workspace --all-targets --locked
cargo build --bin termcade --locked
python3 scripts/test_rust_cli.py --binary "${CARGO_TARGET_DIR:-target}/debug/termcade" --wasm "${CARGO_TARGET_DIR:-target}/wasm32-wasip1/release/termcade_probe_fixture.wasm" --expected-version "${VERSION:-dev}"
python3 scripts/test_installer.py
python3 -m pip install --disable-pip-version-check --no-cache-dir --require-hashes --target .artifacts/pty-python -r scripts/test-requirements.txt
PYTHONPATH=.artifacts/pty-python python3 scripts/test_rust_tui.py --binary "${CARGO_TARGET_DIR:-target}/debug/termcade" --wasm "${CARGO_TARGET_DIR:-target}/wasm32-wasip1/release/termcade_probe_fixture.wasm"
python3 tests/test_rust_cli.py --binary "${CARGO_TARGET_DIR:-target}/debug/termcade" --wasm "${CARGO_TARGET_DIR:-target}/wasm32-wasip1/release/termcade_probe_fixture.wasm" --expected-version "${VERSION:-dev}"
python3 tests/test_installer.py
python3 -m pip install --disable-pip-version-check --no-cache-dir --require-hashes --target .artifacts/pty-python -r tests/requirements.txt
PYTHONPATH=.artifacts/pty-python python3 tests/test_rust_tui.py --binary "${CARGO_TARGET_DIR:-target}/debug/termcade" --wasm "${CARGO_TARGET_DIR:-target}/wasm32-wasip1/release/termcade_probe_fixture.wasm"
File renamed without changes.
6 changes: 3 additions & 3 deletions src/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ pub fn seed_at(base: &Path) -> Result<()> {
fs::create_dir_all(base)?;
let mut changed = false;
for raw in [
include_bytes!("../internal/starter/packs/asteroid.tcade").as_slice(),
include_bytes!("../internal/starter/packs/tetris.tcade").as_slice(),
include_bytes!("../internal/starter/packs/brickough.tcade").as_slice(),
include_bytes!("assets/starter/packs/asteroid.tcade").as_slice(),
include_bytes!("assets/starter/packs/tetris.tcade").as_slice(),
include_bytes!("assets/starter/packs/brickough.tcade").as_slice(),
] {
let pkg = Package::read(raw)?;
if seeded.contains(&pkg.manifest.game.id) {
Expand Down
7 changes: 3 additions & 4 deletions src/ui/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,9 @@ async fn rust_guest_plays_pauses_finishes_and_queues_a_run_once() {
#[tokio::test]
async fn standard_playfield_fits_80_by_24_in_every_pixel_style_and_pause_can_sign_in() {
let (mut app, _dir, _rx) = app();
let package = termcade_manifest::Package::read(include_bytes!(
"../../internal/starter/packs/tetris.tcade"
))
.unwrap();
let package =
termcade_manifest::Package::read(include_bytes!("../assets/starter/packs/tetris.tcade"))
.unwrap();
for shape in [
CellShape::half(),
CellShape::quadrant(),
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading