Skip to content

Commit

Permalink
tests: Update code.nes so -Werror can be passed
Browse files Browse the repository at this point in the history
Update the underlying code.nes test data so it uses a tighter
configuration for NROM which in turn frees nasm from complaining about
empty segments. This makes room to allo for -Werror so we catch warnings
that might appear in the future.

Signed-off-by: Miquel Sabaté Solà <[email protected]>
  • Loading branch information
mssola committed Jan 13, 2025
1 parent 5f48de6 commit 52bab47
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 29 deletions.
22 changes: 2 additions & 20 deletions lib/xixanta/src/assembler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1958,12 +1958,7 @@ mod tests {
offset: 0,
fill: Some(0x00),
section_type: SectionType::Header,
segments: vec![Segment {
name: String::from("HEADER"),
len: 0,
offset: 0,
bundles: vec![],
}],
segments: vec![Segment::from("HEADER")],
},
Mapping {
name: String::from("ROM0"),
Expand All @@ -1972,20 +1967,7 @@ mod tests {
offset: 0,
fill: None,
section_type: SectionType::PrgRom,
segments: vec![
Segment {
name: String::from("ONE"),
len: 0,
offset: 0,
bundles: vec![],
},
Segment {
name: String::from("TWO"),
len: 0,
offset: 0,
bundles: vec![],
},
],
segments: vec![Segment::from("ONE"), Segment::from("TWO")],
},
]
}
Expand Down
15 changes: 6 additions & 9 deletions scripts/test-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,23 @@
set -ex

pushd tests

rm -rf out/
mkdir -p out/

if [ ! -d code.nes ]; then
tar xzvf code.nes.tar.gz
fi

rm -rf code.nes
tar xzf code.nes.tar.gz
popd

cargo build

./target/debug/nasm -c nrom65 -o tests/out/sprite.nes tests/code.nes/basics/sprite.s
./target/debug/nasm -c nrom -Werror -o tests/out/sprite.nes tests/code.nes/basics/sprite.s
diff tests/out/sprite.nes tests/code.nes/out/basics/sprite.nes

./target/debug/nasm -c unrom -o tests/out/chr-ram.nes tests/code.nes/basics/chr-ram.s
./target/debug/nasm -c unrom -Werror -o tests/out/chr-ram.nes tests/code.nes/basics/chr-ram.s
diff tests/out/chr-ram.nes tests/code.nes/out/basics/chr-ram.nes

./target/debug/nasm -c nrom65 -o tests/out/flicker.nes tests/code.nes/basics/flicker.s
./target/debug/nasm -c nrom -Werror -o tests/out/flicker.nes tests/code.nes/basics/flicker.s
diff tests/out/flicker.nes tests/code.nes/out/basics/flicker.nes

./target/debug/nasm -c nrom65 -o tests/out/space.nes tests/code.nes/space/src/space.s
./target/debug/nasm -c nrom -Werror -o tests/out/space.nes tests/code.nes/space/src/space.s
diff tests/out/space.nes tests/code.nes/out/space/space.nes
Binary file modified tests/code.nes.tar.gz
Binary file not shown.

0 comments on commit 52bab47

Please sign in to comment.