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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tests/fixtures/*.mp4 filter=lfs diff=lfs merge=lfs -text
51 changes: 47 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,19 @@ env:
CARGO_TERM_COLOR: always

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- run: cargo fmt -- --check
- run: cargo clippy -- -D warnings

test:
needs: lint
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
Expand All @@ -19,11 +31,42 @@ jobs:
- uses: actions/checkout@v4
with:
lfs: true

- name: Validate LFS fixtures
run: |
for f in tests/fixtures/*.mp4; do
[ ! -f "$f" ] && continue
size=$(wc -c < "$f")
if [ "$size" -lt 1000 ]; then
echo "ERROR: $f appears to be an LFS pointer (${size} bytes)"
exit 1
fi
done

- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- run: cargo fmt -- --check
- run: cargo clippy -- -D warnings

- name: Install ffmpeg (Ubuntu)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y ffmpeg

- name: Install ffmpeg (macOS)
if: runner.os == 'macOS'
run: brew install ffmpeg

- run: cargo test
- run: cargo build --release

test-deep:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install ffmpeg
run: sudo apt-get update && sudo apt-get install -y ffmpeg
- name: Run deep detection tests
run: cargo test -- --ignored
75 changes: 75 additions & 0 deletions tests/audio_detection.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
use assert_cmd::cargo_bin_cmd;
use predicates::prelude::*;

// --- Suno 2 (ID3 + Filename, MEDIUM) ---

#[test]
fn suno_2_detected_via_id3() {
cargo_bin_cmd!("aic")
.args(["--lang", "en", "check", "tests/fixtures/ai_suno_2.mp3"])
.assert()
.success()
.stdout(predicate::str::contains("ID3"))
.stdout(predicate::str::contains("suno"));
}

#[test]
fn suno_2_json_output() {
cargo_bin_cmd!("aic")
.args([
"--lang",
"en",
"--json",
"check",
"tests/fixtures/ai_suno_2.mp3",
])
.assert()
.success()
.stdout(predicate::str::contains("\"ai_generated\": true"))
.stdout(predicate::str::contains("suno"));
}

#[test]
fn suno_2_info_shows_id3_tags() {
cargo_bin_cmd!("aic")
.args(["--lang", "en", "info", "tests/fixtures/ai_suno_2.mp3"])
.assert()
.success()
.stdout(predicate::str::contains("ID3"));
}

// --- ElevenLabs (C2PA, HIGH) ---

#[test]
fn elevenlabs_detected_via_c2pa() {
cargo_bin_cmd!("aic")
.args(["--lang", "en", "check", "tests/fixtures/ai_elevenlabs.mp3"])
.assert()
.success()
.stdout(predicate::str::contains("C2PA"))
.stdout(predicate::str::contains("elevenlabs"));
}

#[test]
fn elevenlabs_json_output() {
cargo_bin_cmd!("aic")
.args([
"--lang",
"en",
"--json",
"check",
"tests/fixtures/ai_elevenlabs.mp3",
])
.assert()
.success()
.stdout(predicate::str::contains("\"ai_generated\": true"));
}

#[test]
fn elevenlabs_info_shows_c2pa() {
cargo_bin_cmd!("aic")
.args(["--lang", "en", "info", "tests/fixtures/ai_elevenlabs.mp3"])
.assert()
.success()
.stdout(predicate::str::contains("C2PA"));
}
Binary file added tests/fixtures/ai_elevenlabs.mp3
Binary file not shown.
Binary file added tests/fixtures/ai_flux_max.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/fixtures/ai_flux_pro.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/fixtures/ai_gptimage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/fixtures/ai_gptimage_1_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/fixtures/ai_ideogram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions tests/fixtures/ai_kling.mp4
Git LFS file not shown
3 changes: 3 additions & 0 deletions tests/fixtures/ai_kling_omni.mp4
Git LFS file not shown
3 changes: 3 additions & 0 deletions tests/fixtures/ai_kling_v3.mp4
Git LFS file not shown
3 changes: 3 additions & 0 deletions tests/fixtures/ai_ltx.mp4
Git LFS file not shown
Binary file added tests/fixtures/ai_midjourney_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/fixtures/ai_midjourney_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/fixtures/ai_midjourney_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/fixtures/ai_midjourney_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/fixtures/ai_nano_pro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions tests/fixtures/ai_seedance.mp4
Git LFS file not shown
Binary file added tests/fixtures/ai_seedream.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/fixtures/ai_seedream_4_5.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/fixtures/ai_seedream_v4.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/fixtures/ai_seedream_v5.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions tests/fixtures/ai_sora.mp4
Git LFS file not shown
3 changes: 3 additions & 0 deletions tests/fixtures/ai_sora_pro.mp4
Git LFS file not shown
Binary file added tests/fixtures/ai_suno_2.mp3
Binary file not shown.
3 changes: 3 additions & 0 deletions tests/fixtures/ai_vidu.mp4
Git LFS file not shown
3 changes: 3 additions & 0 deletions tests/fixtures/ai_wan.mp4
Git LFS file not shown
Loading
Loading