forked from awakesecurity/gRPC-haskell
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to run code generation for modules containing test types (a…
…wakesecurity#16) * Squash merge from branch `joel-add-compile-proto-file-tool` * Squash merge from branch `joel-prefer-codegen-over-derive-generic` * Add proto3-suite-no-tests attr to toplevel * Add `tests/generate-test-types.sh * PR feedback from @gabriel re: nix-env invocations and a configure switch in README.md
- Loading branch information
1 parent
7c354a1
commit 10f592c
Showing
6 changed files
with
26 additions
and
8 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Code generation for tests | ||
|
||
Running: | ||
|
||
```bash | ||
$ bash generate-test-types.sh | ||
``` | ||
|
||
from inside this directly will result in `GeneratedTestTypes.hs` and | ||
`GeneratedImportedTestTypes.hs` being regenerated from | ||
`../test-files/test.proto` and `../test-files/test_import.proto`, respectively. | ||
|
||
We'll eventually `nix`-ify the building of codegen artifacts, so this is a bit | ||
of a stopgap. |
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,3 @@ | ||
PROTO3_SUITE_NO_TESTS=$(nix-build --no-out-link ../release.nix -A proto3-suite-no-tests) | ||
(cd .. && "${PROTO3_SUITE_NO_TESTS}"/bin/compile-proto-file --proto test-files/test.proto > tests/GeneratedTestTypes.hs) | ||
(cd .. && "${PROTO3_SUITE_NO_TESTS}"/bin/compile-proto-file --proto test-files/test_import.proto > tests/GeneratedImportedTestTypes.hs) |