ci: add tool to check for Cargo features
When running tests from .travis.yml, the passed in features are first
checked locally for support in the current simulator. The list of
supported features was manually maintained, allowing newly implemented
features to be skipped, also skipping the related test (without
warnings). This adds a new tool that parses and prints the list of
features directly from the given Cargo.toml.
Signed-off-by: Fabio Utzig <utzig@apache.org>
diff --git a/ci/sim_run.sh b/ci/sim_run.sh
index 3a9b0df..6c0e3f2 100755
--- a/ci/sim_run.sh
+++ b/ci/sim_run.sh
@@ -12,13 +12,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+GET_FEATURES="$(pwd)/ci/get_features.py"
+CARGO_TOML="$(pwd)/sim/Cargo.toml"
+
pushd sim
+all_features="$(${GET_FEATURES} ${CARGO_TOML})"
+[ $? -ne 0 ] && exit 1
+
EXIT_CODE=0
if [[ ! -z $SINGLE_FEATURES ]]; then
- all_features="sig-rsa sig-ecdsa overwrite-only validate-primary-slot enc-rsa enc-kw bootstrap"
-
if [[ $SINGLE_FEATURES =~ "none" ]]; then
echo "Running cargo with no features"
cargo test