build(ncm): 宿主交叉适配层 + 全量测试补跑(M8)
- 新增 build_ncm_cross_host.sh:同构 HOME 复用容器脚本,串起 sdk/vendor/host-mbedtls/core/tests/ncm - libs_common.sh 工具链路径改为 MEOW_R3PROII_ROOT/$HOME 可覆盖,容器默认不变 - build_mbedtls.sh 递归清理 library/ 与 3rdparty/ 旧对象,修宿主/mipsel 混架构归档 - test_ncm_core.c 改用 $TMPDIR,Termux /tmp 不可写不再导致 store/cache/tag 用例失败 - REPORT §40:构建/测试/热更结果(ncm md5 1bbd2a55…,Music du 前后恒定)
This commit is contained in:
1 parent
2c69070cc4
commit
7d4906828d
5 files changed
+226
-10
No files matched your search
@@ -4,7 +4,7 @@
|
||||
* 缓存 LRU、设备键/cookie 加解密、二维码矩阵、以及
|
||||
* 网络接口(unikey 实拿 / 轮询 801 / 无凭据错误处理)。
|
||||
* 网络不可用时网络项按 SKIP 处理,不判失败;内部逻辑错才 FAIL。
|
||||
* 用法:test_ncm_core [data_dir](缺省 /tmp/ncm_test)
|
||||
* 用法:test_ncm_core [data_dir](缺省 $TMPDIR/ncm_test,未设则 /tmp/ncm_test)
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -87,7 +87,11 @@ static void test_crypto(void) {
|
||||
static void test_store_cookie(void) {
|
||||
printf("== store/device/cookie ==\n");
|
||||
ncm_store_t st;
|
||||
ncm_store_init(&st, NULL); /* env MEOW_DATA_DIR 或 /tmp */
|
||||
/* 不传 NULL:默认回退 /tmp(Termux 不可写 → deviceId 需持久化、机器密钥需落盘,都会失败) */
|
||||
const char *tmpbase = getenv("TMPDIR");
|
||||
char sdir[256];
|
||||
snprintf(sdir, sizeof sdir, "%s/ncm_store_test", (tmpbase && tmpbase[0]) ? tmpbase : "/tmp");
|
||||
ncm_store_init(&st, sdir);
|
||||
char id1[NCM_STORE_ID_MAX], id2[NCM_STORE_ID_MAX];
|
||||
ncm_store_get_device_id(&st, id1);
|
||||
ncm_store_get_device_id(&st, id2);
|
||||
@@ -108,10 +112,13 @@ static void test_store_cookie(void) {
|
||||
static void test_cache(void) {
|
||||
printf("== cache ==\n");
|
||||
ncm_cache_t c;
|
||||
char dir[] = "/tmp/ncm_cache_test";
|
||||
/* Termux /tmp 不可写:跟随 $TMPDIR(与 test_cache_actual_naming / tag、cache 单测一致) */
|
||||
const char *tmpbase = getenv("TMPDIR");
|
||||
char dir[256];
|
||||
snprintf(dir, sizeof dir, "%s/ncm_cache_test", (tmpbase && tmpbase[0]) ? tmpbase : "/tmp");
|
||||
/* 清空目录(须在 init 前:init 会建 songs/covers 子目录,rm -rf 会一并删掉) */
|
||||
{
|
||||
char cmd[128];
|
||||
char cmd[320];
|
||||
snprintf(cmd, sizeof cmd, "rm -rf %s; mkdir -p %s", dir, dir);
|
||||
if (system(cmd) != 0) { /* best-effort */ }
|
||||
}
|
||||
@@ -193,9 +200,11 @@ static void make_flac_bytes(unsigned char *buf, size_t *len, int bps)
|
||||
static void test_cache_tag(void) {
|
||||
printf("== cache tag embed + scan (M5) ==\n");
|
||||
ncm_cache_t c;
|
||||
char dir[] = "/tmp/ncm_tag_cache";
|
||||
const char *tmpbase = getenv("TMPDIR");
|
||||
char dir[256];
|
||||
snprintf(dir, sizeof dir, "%s/ncm_tag_cache", (tmpbase && tmpbase[0]) ? tmpbase : "/tmp");
|
||||
{
|
||||
char cmd[160];
|
||||
char cmd[320];
|
||||
snprintf(cmd, sizeof cmd, "rm -rf %s; mkdir -p %s", dir, dir);
|
||||
if (system(cmd) != 0) { /* best-effort */ }
|
||||
}
|
||||
@@ -762,7 +771,10 @@ static void test_json_unescape(void) {
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
const char *data_dir = (argc > 1) ? argv[1] : "/tmp/ncm_test";
|
||||
const char *tmpbase = getenv("TMPDIR");
|
||||
char def_dir[256];
|
||||
snprintf(def_dir, sizeof def_dir, "%s/ncm_test", (tmpbase && tmpbase[0]) ? tmpbase : "/tmp");
|
||||
const char *data_dir = (argc > 1) ? argv[1] : def_dir;
|
||||
printf("ncm_core self-test, data_dir=%s\n", data_dir);
|
||||
ncm_ctx_t ctx;
|
||||
ncm_ctx_init(&ctx, data_dir);
|
||||
|
||||
Reference in new issue
Block a user