feat: add integration test framework and rack/grid command support
This commit is contained in:
committed by
Loic Coenen (aider)
parent
9fda1b2669
commit
e6e0a47749
35
client/tests/test_integration.c
Normal file
35
client/tests/test_integration.c
Normal file
@@ -0,0 +1,35 @@
|
||||
#define TESTING 1
|
||||
#include "carla_host.h"
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
printf("=== Integration test (requires JACK server) ===\n");
|
||||
|
||||
/* Fail if no JACK server */
|
||||
if (carla_init_jack() != 0) {
|
||||
fprintf(stderr, "FAIL: cannot initialise Carla/JACK – is the JACK server running?\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Verify handle is now non‑NULL */
|
||||
CarlaHostHandle h = carla_get_handle();
|
||||
assert(h != NULL);
|
||||
|
||||
/* Test connection tracking without loading a real plugin.
|
||||
carla_test_add_connection adds a fake connection entry. */
|
||||
int ret = carla_test_add_connection(0, "test:out", "looper:in");
|
||||
assert(ret == 0);
|
||||
assert(carla_test_connection_count() == 1);
|
||||
|
||||
/* Disconnect plugin ID 0 – should clear the list */
|
||||
ret = carla_disconnect_plugin(0);
|
||||
assert(ret == 0);
|
||||
assert(carla_test_connection_count() == 0);
|
||||
|
||||
carla_cleanup_jack();
|
||||
|
||||
printf("PASS: all integration tests passed (with JACK server).\n");
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user