|
| 1 | +#!/bin/sh -e |
| 2 | +# Check, build, and test everything |
| 3 | + |
| 4 | +echo "################################################################################" |
| 5 | +echo "# make enclaves" |
| 6 | +echo "################################################################################" |
| 7 | +for enclave in 'rtc_data_enclave' 'rtc_auth_enclave' 'rtc_exec_enclave'; do |
| 8 | + ./_hack_timestamp.sh |
| 9 | + (cd "$enclave" && make) |
| 10 | +done |
| 11 | + |
| 12 | +# TODO: doc --document-private-items |
| 13 | +for action in check build doc test; do |
| 14 | + |
| 15 | + for root in rtc_tenclave rtc_data_enclave rtc_auth_enclave rtc_exec_enclave .; do |
| 16 | + |
| 17 | + args='' |
| 18 | + case "$root $action" in |
| 19 | + |
| 20 | + # Skip enclave tests: not supported yet. |
| 21 | + 'rtc_'*'_enclave test') continue ;; |
| 22 | + |
| 23 | + # Only the root project can build all targets, so far |
| 24 | + '. build') args='--all-targets' ;; |
| 25 | + |
| 26 | + |
| 27 | + # FIXME: Skip enclave docs for now: rustdoc doesn't support const_evaluatable_checked yet. |
| 28 | + # Issue: https://github.com/rust-lang/rust/issues/77647 |
| 29 | + 'rtc_'*'enclave doc') continue ;; |
| 30 | + |
| 31 | + # FIXME: Only the rtc_types docs build successfully right now. |
| 32 | + '. doc') args='--no-deps --package rtc_types' ;; |
| 33 | + |
| 34 | + # Skip documenting dependencies, by default |
| 35 | + *' doc') args='--no-deps' ;; |
| 36 | + |
| 37 | + # rtc_tenclave can test, but only with --no-default-features |
| 38 | + 'rtc_tenclave test') args='--no-default-features' ;; |
| 39 | + |
| 40 | + esac |
| 41 | + |
| 42 | + # Show a big banner to make it easier to find and re-run failing commands. |
| 43 | + echo "################################################################################" |
| 44 | + echo "# (cd $root && cargo $action $args)" |
| 45 | + echo "################################################################################" |
| 46 | + ./_hack_timestamp.sh |
| 47 | + (cd "$root" && cargo "$action" $args) |
| 48 | + done |
| 49 | + |
| 50 | +done |
| 51 | + |
| 52 | +# Final timestamp reset, for good measure. |
| 53 | +./_hack_timestamp.sh |
0 commit comments