-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from /issues/65
Add support for user-passed compiler settings
- Loading branch information
Showing
5 changed files
with
250 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
test/integration/sol-ast-compile/compiler-settings/invalid.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import expect from "expect"; | ||
import { SolAstCompileCommand, SolAstCompileExec } from "../common"; | ||
|
||
const sample = "test/samples/solidity/missing_pragma.sol"; | ||
const badArgsSamples = [ | ||
[ | ||
[sample, "--compiler-settings", "{blahblah}"], | ||
`Error: Invalid compiler settings '{blahblah}'. Compiler settings must be a valid JSON object.` | ||
] | ||
]; | ||
|
||
for (const [args, expectedError] of badArgsSamples) { | ||
const command = SolAstCompileCommand(...args); | ||
|
||
describe(command, () => { | ||
let exitCode: number | null; | ||
let outData = ""; | ||
let errData = ""; | ||
|
||
before((done) => { | ||
const result = SolAstCompileExec(...args); | ||
|
||
outData = result.stdout; | ||
errData = result.stderr; | ||
exitCode = result.status; | ||
|
||
done(); | ||
}); | ||
|
||
it("Exit code is valid", () => { | ||
expect(exitCode).toEqual(1); | ||
}); | ||
|
||
it("STDERR is correct", () => { | ||
expect(errData).toContain(expectedError); | ||
}); | ||
|
||
it("STDOUT is empty", () => { | ||
expect(outData).toEqual(""); | ||
}); | ||
}); | ||
} |
Oops, something went wrong.