tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

split-conversions.js (1066B)


      1 /*
      2 
      3 run with
      4   node split-conversions.js
      5 
      6 notes:
      7 
      8 conversions.test is generated from the C++ based dEQP tests
      9 https://github.com/KhronosGroup/VK-GL-CTS/blob/main/modules/gles3/scripts/gen-conversions.py
     10 
     11 You need to manually add these tests to the 00_test_list.txt
     12 
     13 */
     14 
     15 const fs = require('fs');
     16 
     17 process.chdir(__dirname);
     18 
     19 const testWarning = `\
     20 # WARNING: This file is auto-generated. Do NOT modify it manually, but rather
     21 # modify the generating script file. Otherwise changes will be lost!
     22 # See split-conversions.js
     23 
     24 `;
     25 
     26 const conversionsHTML = fs.readFileSync('conversions.template', {encoding: 'utf8'});
     27 const conversions = fs.readFileSync('conversions.test', {encoding: 'utf8'});
     28 const groupMatches = conversions.matchAll(/group ([a-zA-Z0-9_]+) [\s\S]+?end #.*?\n/g);
     29 for (const [str, groupName] of groupMatches) {
     30  const baseName = `conversions_${groupName}`;
     31  fs.writeFileSync(`${baseName}.test`, `${testWarning}${str}`);
     32  fs.writeFileSync(`${baseName}.html`, `<!--\n${testWarning}-->\n${conversionsHTML.replace("'conversions'", `'${baseName}'`)}`);
     33 }