1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

Add WASM FunC autotests (#673)

* feat: func wasm autotests

* fixes necessary for func wasm autotests

---------

Co-authored-by: krigga <krigga7@gmail.com>
This commit is contained in:
EmelyanenkoK 2023-04-19 21:29:41 +03:00 committed by GitHub
parent 8d919a5db9
commit 8b0d6a2665
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 172 additions and 3 deletions

View file

@ -0,0 +1,27 @@
const fs = require('fs/promises');
const { compileWasm, compileFile } = require('./wasm_tests_common');
async function main() {
const tests = JSON.parse((await fs.readFile('../legacy_tests.json')).toString('utf-8'))
for (const [filename, hashstr] of tests) {
if (filename.includes('storage-provider')) continue;
const mod = await compileWasm()
const response = await compileFile(mod, filename);
if (response.status !== 'ok') {
console.error(response);
throw new Error('Could not compile ' + filename);
}
if (BigInt('0x' + response.codeHashHex) !== BigInt(hashstr)) {
throw new Error('Compilation result is different for ' + filename);
}
console.log(filename, 'ok');
}
}
main()