speaker-verification
audio
nemotron
tyger
experimental
File size: 1,078 Bytes
0efd0f1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""Offline unit contracts, with machine-readable results for the English report."""
import json,time,unittest
from pathlib import Path

MODULES=['test_audio_input','test_shared_turn','test_speaker_names','test_speaker_session','test_speaker_turns',
    'test_identity','test_speaker_teacher','test_bridge','test_performance',
    'speaker_v2.test_predictor','speaker_v4.test_v4','speaker_v5.test_v5','speaker_live.test_playback']

def main():
    suite=unittest.defaultTestLoader.loadTestsFromNames(MODULES)
    result=unittest.TextTestRunner(verbosity=1).run(suite)
    report={'finished':time.time(),'modules':MODULES,'tests':result.testsRun,'failures':len(result.failures),
        'errors':len(result.errors),'skipped':len(result.skipped),'passed':result.wasSuccessful(),
        'network_or_physical_microphone_used':False}
    path=Path(__file__).parent/'logs/unit-checks.json';path.parent.mkdir(exist_ok=True)
    path.write_text(json.dumps(report,indent=2));print(json.dumps(report))
    if not result.wasSuccessful():raise SystemExit(1)

if __name__=='__main__':main()