-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] #4151: Enhance the test environment by automatically generating …
…WASM files for the smartcontracts to be tested (#4187) [add] generate_wasm.sh to generate WASM files of the smart contracts Signed-off-by: Asem-Abdelhady <[email protected]> --------- Signed-off-by: Asem-Abdelhady <[email protected]>
- Loading branch information
1 parent
ba7577e
commit 57f87af
Showing
3 changed files
with
36 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,3 +49,4 @@ result | |
/test/ | ||
/iroha-java/ | ||
/lcov.info | ||
**/test-smartcontracts/ |
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,28 @@ | ||
#!/bin/sh | ||
|
||
# Default source directory | ||
DEFAULT_SOURCE_DIR="client/tests/integration/smartcontracts" | ||
|
||
# If no arguments are provided, use the default source directory | ||
if [ "$#" -eq 0 ]; then | ||
SOURCE_DIR="$DEFAULT_SOURCE_DIR" | ||
else | ||
SOURCE_DIR="$1" | ||
fi | ||
|
||
TARGET_DIR="test-smartcontracts" | ||
|
||
mkdir -p "$TARGET_DIR" | ||
|
||
for folder in "$SOURCE_DIR"/*; do | ||
if [ -d "$folder" ] && [ "$(basename "$folder")" != ".cargo" ]; then | ||
|
||
folder_name=$(basename "$folder") | ||
target_wasm_file_path="${TARGET_DIR}/${folder_name}.wasm" | ||
# Build the smart contracts | ||
cargo run --bin iroha_wasm_builder_cli -- build "$folder" --optimize --outfile "$target_wasm_file_path" | ||
|
||
fi | ||
done | ||
|
||
echo "Smart contracts build complete." |