10 lines
574 B
JavaScript
10 lines
574 B
JavaScript
// Emit a host test translation unit using the actual production C functions.
|
|||
|
|
// Usage: node tests/ble-wifi-host.cjs | cc -x c -std=c11 -Wall -Wextra -Werror \
|
||
|
|
// -fsanitize=address,undefined -o /tmp/ble-wifi-test -
|
||
|
|
const fs = require('node:fs');
|
||
|
|
const path = require('node:path');
|
||
|
|
const source = fs.readFileSync(path.join(__dirname, '../main/ble_wifi.c'), 'utf8');
|
||
|
|
const harness = fs.readFileSync(path.join(__dirname, 'ble-wifi-host.c'), 'utf8');
|
||
|
|
process.stdout.write(harness.replace('/* PRODUCTION_SOURCE */',
|
||
|
|
source.replace(/^#include[^\n]*$/gm, '') + '\n'));
|