chore: remove skeleton build mode and stub #ifdef scaffolding
Drop the M0 no-deps skeleton preset and all VOICECAT_HAS_NET/AUDIO/OPUS/NS guards that it required. Every subsystem is fully implemented; the stub #else paths were dead code that added noise to every header and source file. - CMakePresets.json: remove skeleton configure/build/test entries - CMakeLists.txt (root/core/tests): remove VOICECAT_USE_VCPKG_DEPS option and guards; all targets now build unconditionally - 17 C++ source files: unwrap HAS_* guards, delete stub #else blocks - apm_processor.cpp: delete ApmPassthrough no-op class; create() always returns RnnoiseProcessor - 18 test files: remove HAS_* guards and stub int main() skip bodies - docs/building.md: remove skeleton from preset table and prose VOICECAT_HAS_LOOPBACK (Windows WASAPI loopback platform gate) unchanged. 29/29 ctest green. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -18,8 +18,6 @@
|
||||
*/
|
||||
#include <cstdio>
|
||||
|
||||
#ifdef VOICECAT_HAS_NET
|
||||
|
||||
#include <atomic>
|
||||
#include <chrono>
|
||||
#include <cmath>
|
||||
@@ -35,12 +33,8 @@
|
||||
#include "server.h"
|
||||
#include "db.h"
|
||||
|
||||
#ifdef VOICECAT_HAS_AUDIO
|
||||
#include "audio/audio_engine.h"
|
||||
#endif
|
||||
#ifdef VOICECAT_HAS_OPUS
|
||||
#include "codec/opus_codec.h"
|
||||
#endif
|
||||
|
||||
// ── Event tracking (same shape as test_m3_multistream.cpp) ──────────────────────
|
||||
|
||||
@@ -159,7 +153,6 @@ static void test_device_enumeration() {
|
||||
for (vc_device_kind kind : {VC_DEVICE_INPUT, VC_DEVICE_OUTPUT}) {
|
||||
vc_device_list dl{};
|
||||
vc_result r = vc_list_devices(c, kind, &dl);
|
||||
#ifdef VOICECAT_HAS_AUDIO
|
||||
CHECK(r == VC_OK);
|
||||
// Headless CI build agents may legitimately report zero devices — never assert
|
||||
// count > 0, only that the call itself succeeded and the list is well-formed.
|
||||
@@ -167,9 +160,6 @@ static void test_device_enumeration() {
|
||||
CHECK(dl.items[i].id != nullptr);
|
||||
CHECK(dl.items[i].name != nullptr);
|
||||
}
|
||||
#else
|
||||
CHECK(r == VC_ERR_NOT_IMPLEMENTED);
|
||||
#endif
|
||||
vc_free_device_list(&dl);
|
||||
vc_free_device_list(&dl); // idempotent — must not crash on a second call
|
||||
}
|
||||
@@ -179,7 +169,6 @@ static void test_device_enumeration() {
|
||||
}
|
||||
|
||||
// ── 4. Stereo playback mixer (white-box, no audio hardware needed) ──────────────
|
||||
#if defined(VOICECAT_HAS_AUDIO) && defined(VOICECAT_HAS_OPUS)
|
||||
static void test_stereo_mix() {
|
||||
voicecat::audio::AudioEngine engine;
|
||||
voicecat::audio::AudioParams p;
|
||||
@@ -245,7 +234,7 @@ static void test_stereo_mix() {
|
||||
// and mixes — asserting L != R across the frame. A mono-downmixed-then-upmixed bitstream would
|
||||
// have L == R. Mirrors test_stereo_mix but routes the encode side through the loopback
|
||||
// accumulator path that the fix touches (feed_loopback_for_test → on_loopback's accumulator).
|
||||
#if defined(VOICECAT_HAS_LOOPBACK) && defined(VOICECAT_HAS_OPUS)
|
||||
#if defined(VOICECAT_HAS_LOOPBACK)
|
||||
static void test_loopback_stereo_capture() {
|
||||
voicecat::audio::AudioEngine engine;
|
||||
voicecat::audio::AudioParams p;
|
||||
@@ -382,14 +371,12 @@ static void test_playout_resync() {
|
||||
engine.stop();
|
||||
std::printf("test_playout_resync: ok (energy=%lld)\n", static_cast<long long>(energy));
|
||||
}
|
||||
#endif // VOICECAT_HAS_AUDIO && VOICECAT_HAS_OPUS
|
||||
|
||||
// ── 5. Capture-frame accumulation (white-box, no audio hardware needed) ──────────
|
||||
// Regression for the capture-side analogue of the playback ring fix: miniaudio's capture
|
||||
// callback fires at the hardware period (commonly 480 samples on WASAPI shared mode), while
|
||||
// opus_encode() requires exactly frame_samples_ (960). Sub-frame chunks must be accumulated;
|
||||
// the callback must receive exactly 960-sample frames regardless of input chunk size.
|
||||
#ifdef VOICECAT_HAS_AUDIO
|
||||
static void test_capture_frame_accumulation() {
|
||||
voicecat::audio::AudioEngine engine;
|
||||
voicecat::audio::AudioParams p;
|
||||
@@ -436,7 +423,6 @@ static void test_capture_frame_accumulation() {
|
||||
engine.stop();
|
||||
std::printf("test_capture_frame_accumulation: ok (callbacks=%d)\n", call_count.load());
|
||||
}
|
||||
#endif // VOICECAT_HAS_AUDIO
|
||||
|
||||
// ── 2/3. VAD + PTT gate, through the real ABI against a real server ─────────────
|
||||
static void test_vad_and_ptt_gate() {
|
||||
@@ -601,7 +587,6 @@ static void test_vad_and_ptt_gate() {
|
||||
// downmix). Mirrors test_loopback_stereo_capture but routes through the mic capture
|
||||
// accumulator (feed_capture_for_test with channels=2) instead of the loopback path.
|
||||
// This is the headless CI test for the iOS stereo built-in mic feature (Part D).
|
||||
#if defined(VOICECAT_HAS_AUDIO) && defined(VOICECAT_HAS_OPUS)
|
||||
static void test_stereo_mic_capture() {
|
||||
voicecat::audio::AudioEngine engine;
|
||||
voicecat::audio::AudioParams p;
|
||||
@@ -674,7 +659,6 @@ static void test_stereo_mic_capture() {
|
||||
std::printf("test_stereo_mic_capture: ok (total_diff=%lld, seen_channels=%d)\n",
|
||||
static_cast<long long>(total_diff), seen_channels);
|
||||
}
|
||||
#endif
|
||||
|
||||
// ── 6. Stereo mic capture on a MONO channel (downmix safety) ──────────────────
|
||||
// A stereo mic (vc_set_capture_channels=2) can be enabled while on a mono channel. The mic
|
||||
@@ -683,7 +667,6 @@ static void test_stereo_mic_capture() {
|
||||
// opus_encode makes it read 2× the samples it should (wrong pitch / garbage). This mirrors that
|
||||
// fold and proves the result is a valid mono bitstream that decodes to the expected averaged
|
||||
// signal, rather than half-length junk.
|
||||
#if defined(VOICECAT_HAS_AUDIO) && defined(VOICECAT_HAS_OPUS)
|
||||
static void test_stereo_mic_mono_channel() {
|
||||
voicecat::codec::OpusParams mono_params;
|
||||
mono_params.stereo = false; // mono channel — encoder is mono
|
||||
@@ -727,11 +710,9 @@ static void test_stereo_mic_mono_channel() {
|
||||
std::printf("test_stereo_mic_mono_channel: ok (opus_len=%d, energy=%lld)\n",
|
||||
opus_len, static_cast<long long>(energy));
|
||||
}
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
test_device_enumeration();
|
||||
#if defined(VOICECAT_HAS_AUDIO) && defined(VOICECAT_HAS_OPUS)
|
||||
test_stereo_mix();
|
||||
#if defined(VOICECAT_HAS_LOOPBACK)
|
||||
test_loopback_stereo_capture();
|
||||
@@ -739,10 +720,7 @@ int main() {
|
||||
test_stereo_mic_capture();
|
||||
test_stereo_mic_mono_channel();
|
||||
test_playout_resync();
|
||||
#endif
|
||||
#ifdef VOICECAT_HAS_AUDIO
|
||||
test_capture_frame_accumulation();
|
||||
#endif
|
||||
test_vad_and_ptt_gate();
|
||||
|
||||
if (g_failures == 0) {
|
||||
@@ -752,12 +730,3 @@ int main() {
|
||||
std::printf("vad_ptt_devices: %d failure(s)\n", g_failures);
|
||||
return 1;
|
||||
}
|
||||
|
||||
#else // !VOICECAT_HAS_NET
|
||||
|
||||
int main() {
|
||||
std::printf("vad_ptt_devices: SKIP (VOICECAT_HAS_NET not defined)\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif // VOICECAT_HAS_NET
|
||||
|
||||
Reference in New Issue
Block a user