(relPath, data)
| 238 | } |
| 239 | |
| 240 | loadFlags(relPath, data) { |
| 241 | // Create the settings path based on the location of the test file, e.g. |
| 242 | // .../fuzzilli/fuzzdir-1/settings.json for |
| 243 | // .../fuzzilli/fuzzdir-1/corpus/program_x.js |
| 244 | const pathComponents = relPath.split(path.sep); |
| 245 | assert(pathComponents.length > 1); |
| 246 | assert(pathComponents[0] == 'fuzzilli'); |
| 247 | const settingsPath = path.join( |
| 248 | this.inputDir, pathComponents[0], pathComponents[1], 'settings.json'); |
| 249 | |
| 250 | // Use cached flags if already loaded. |
| 251 | let flags = this.flagMap.get(settingsPath); |
| 252 | if (flags == undefined) { |
| 253 | assert(fs.existsSync(settingsPath)); |
| 254 | const settings = JSON.parse(fs.readFileSync(settingsPath, 'utf-8')); |
| 255 | flags = settings["processArguments"]; |
| 256 | this.flagMap.set(settingsPath, flags); |
| 257 | } |
| 258 | return flags; |
| 259 | } |
| 260 | |
| 261 | // Fuzzilli is able to load resources relative to the V8 corpus, which is |
| 262 | // expected to be side-by-side. |
nothing calls this directly
no test coverage detected