| 1 | #!/bin/bash -e |
| 2 | |
| 3 | # Copyright The Notary Project Authors. |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | # build example plugins for e2e tests |
| 17 | echo "building example plugins..." |
| 18 | echo "==============================" |
| 19 | CWD=$(pwd) |
| 20 | PLUGIN_NAME=com.example.plugin |
| 21 | plugin_directories=( envelopegenerator signaturegenerator ) |
| 22 | for plugin_directory in "${plugin_directories[@]}" |
| 23 | do |
| 24 | (cd "../../example/${plugin_directory}" && go build -o "$CWD/bin/${plugin_directory}/$PLUGIN_NAME" . && echo "e2e ${plugin_directory} plugin built") |
| 25 | done |
| 26 | |
| 27 | # run e2e tests |
| 28 | echo "running e2e tests..." |
| 29 | echo "==============================" |
| 30 | go test -race -v ./... -args -env_gen_plugin="./bin/${plugin_directories[0]}/$PLUGIN_NAME" -sig_gen_plugin="./bin/${plugin_directories[1]}/$PLUGIN_NAME" |