abi-gen/test-cli: rm expected-output; use git diff (#2079)

* abi-gen/test-cli: rm expected-output; use git diff

* abi-gen/test-cli: Simplify git diff test script

* Remove abi-gen/test-cli/output from .gitignore
This commit is contained in:
F. Eugene Aumson
2019-08-20 14:08:54 -04:00
committed by GitHub
parent afb32c087d
commit 22c6548ed1
9 changed files with 1 additions and 11 deletions

View File

@@ -38,7 +38,7 @@
"generate_contract_wrappers": "run-p gen_typescript gen_python",
"gen_typescript": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output ./test-cli/output/typescript --backend ethers",
"gen_python": "pip install black && abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/Python/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/Python/partials/**/*.handlebars' --output ./test-cli/output/python --language Python",
"diff_contract_wrappers": "test-cli/diff.sh ./test-cli/expected-output ./test-cli/output",
"diff_contract_wrappers": "git diff --exit-code ./test-cli/output",
"coverage:report:text": "istanbul report text",
"coverage:report:html": "istanbul report html && open coverage/index.html",
"profiler:report:html": "istanbul report html && open coverage/index.html",

View File

@@ -1,7 +0,0 @@
diff -r -U 5 $1 $2
# -r tells diff to compare folders recursively.
# "-U 5" tells diff to output a "unified" format, with 5 lines of context.
if [ $? -ne 0 ]; then
echo "ERROR: Freshly generated output does not match expected output. If you're confident that the expected output should be updated, copy it in there and commit it."
exit 1
fi