raylib-wasm-transpiler/tools/js-class-c-struct-transpiler/test/testgen.js

12 lines
1.4 KiB
JavaScript
Raw Normal View History

2024-05-27 22:56:25 -04:00
import { $ } from "bun";
await $`bun run ../transpile.js -S schema.json -j build/ -c build/ -s build/`;
await $`rm -rf build/test.db`;
await $`sqlite3 build/test.db < build/types.sql`;
// const vid1 = await $`echo 'INSERT INTO Vector3 (x, y, z) VALUES (-9.0, 9.0, 4.0) RETURNING id;' | sqlite3 build/test.db`.text();
// const vid2 = await $`echo 'INSERT INTO Vector3 (x, y, z) VALUES (9.0, 9.0, 0.0) RETURNING id;' | sqlite3 build/test.db`.text();
// const vid3 = await $`echo 'INSERT INTO Vector3 (x, y, z) VALUES (0.0, 1.0, 0.0) RETURNING id;' | sqlite3 build/test.db`.text();
// const cid = await $`echo 'INSERT INTO Camera3D (position_id, target_id, up_id, fovy, projection) VALUES (${vid1}, ${vid2}, ${vid3}, 60.0, 0) RETURNING id;' | sqlite3 build/test.db`.text();
// const eid = await $`echo "INSERT INTO Entity (Name, camera_id, Strength, Endurance, Intelligence, Wisdom, Charisma, Faith, Artisan, Metalworking, Alchemy, Engineering, Culinary, Ranged, Melee, Acrobatics, Prestidigitation, Language, Medicine, Thaumatology, Theology, Fishing, Mining, Survival, Gardening, History, Perception, Luck, Stealth, Attractiveness, Affluence, Notoriety) VALUES ('Zongor',${cid},1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,42,1,1,1,1) RETURNING id;" | sqlite3 build/test.db`.text();
// console.log(`generated Entity=${eid} Camera3D=${cid} Vector3=${vid1} Vector3=${vid2} Vector3=${vid3}`);