diff --git a/unit-test/binding-file-template.js b/unit-test/binding-file-template.js index a3b485979..2c7b3aa8b 100644 --- a/unit-test/binding-file-template.js +++ b/unit-test/binding-file-template.js @@ -1,3 +1,6 @@ +const path = require('path'); +const fs = require('fs'); + /** * @param bindingConfigurations * This method acts as a template to generate the content of binding.cc file @@ -27,3 +30,10 @@ module.exports.generateFileContent = function (bindingConfigurations) { return Promise.resolve(content.join('\r\n')); }; + +module.exports.writeToBindingFile = function writeToBindingFile (content) { + const generatedFilePath = path.join(__dirname, 'generated', 'binding.cc'); + fs.writeFileSync(generatedFilePath, ''); + fs.writeFileSync(generatedFilePath, content, { flag: 'a' }); + console.log('generated binding file ', generatedFilePath, new Date()); +}; diff --git a/unit-test/binding.gyp b/unit-test/binding.gyp index fd7a84e26..8d4a92cc9 100644 --- a/unit-test/binding.gyp +++ b/unit-test/binding.gyp @@ -3,6 +3,7 @@ 'includes': ['../common.gypi'], 'include_dirs': ['../test/common', "./generated"], 'variables': { + 'setup': ["