diff options
Diffstat (limited to 'test/compilers/argument-parsers-tests.js')
-rw-r--r-- | test/compilers/argument-parsers-tests.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/compilers/argument-parsers-tests.js b/test/compilers/argument-parsers-tests.js index 16ff3d8f5..770dad72c 100644 --- a/test/compilers/argument-parsers-tests.js +++ b/test/compilers/argument-parsers-tests.js @@ -29,6 +29,7 @@ import { GCCParser, ICCParser, PascalParser, + TableGenParser, VCParser, } from '../../lib/compilers/argument-parsers.js'; import {FakeCompiler} from '../../lib/compilers/fake-for-test.js'; @@ -272,3 +273,28 @@ describe('ICC argument parser', () => { ]); }); }); + +describe('TableGen argument parser', () => { + it('Should extract actions', () => { + const lines = [ + 'USAGE: llvm-tblgen [options] <input file>', + '', + 'OPTIONS:', + '', + 'General options:', + '', + ' -D <macro name> - Name of the macro...', + ' Action to perform:', + ' --gen-attrs - Generate attributes', + ' --print-detailed-records - Print full details...', + ' --gen-x86-mnemonic-tables - Generate X86...', + ' --no-warn-on-unused-template-args - Disable...', + ]; + const actions = TableGenParser.extractPossibleActions(lines); + actions.should.deep.equal([ + {name: 'gen-attrs: Generate attributes', value: '--gen-attrs'}, + {name: 'print-detailed-records: Print full details...', value: '--print-detailed-records'}, + {name: 'gen-x86-mnemonic-tables: Generate X86...', value: '--gen-x86-mnemonic-tables'}, + ]); + }); +}); |