File tree 5 files changed +51
-3
lines changed
5 files changed +51
-3
lines changed File renamed without changes.
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ # SPDX-License-Identifier: Apache-2.0 OR MIT
4
+ #
5
+ # Runs `rustfmt` in our source crates and tests.
6
+ # The arguments given to this script are passed to rustfmt.
7
+ set -o errexit
8
+ set -o pipefail
9
+ set -o nounset
10
+
11
+ # Run from the repository root folder
12
+ ROOT_FOLDER=$( git rev-parse --show-toplevel)
13
+ cd ${ROOT_FOLDER}
14
+
15
+ # Verify crates.
16
+ # TODO: We should be able to use workspace once we unfork from rustc.
17
+ # https://github.com/model-checking/rmc/issues/719
18
+ CRATES=(
19
+ " bookrunner"
20
+ " cbmc"
21
+ " compiletest"
22
+ " kani-compiler"
23
+ " kani"
24
+ " kani_macros"
25
+ " kani_queries"
26
+ " kani_restrictions"
27
+ " rustc_codegen_kani"
28
+ )
29
+
30
+ error=0
31
+ for crate in ${CRATES[@]} ; do
32
+ # Check all crates. Only fail at the end.
33
+ cargo fmt $@ -p ${crate} || error=1
34
+ done
35
+
36
+ # Check test source files.
37
+ TESTS=(" src/test/kani"
38
+ " src/test/prusti"
39
+ " src/test/smack"
40
+ " src/test/expected"
41
+ " src/test/cargo-kani"
42
+ " kani-docs/src/tutorial" )
43
+
44
+ for suite in " ${TESTS[@]} " ; do
45
+ files=$( find " ${suite} " -name " *.rs" )
46
+ rustfmt --unstable-features $@ ${files} || error=1
47
+ done
48
+
49
+ exit $error
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ check-cbmc-version.py --major 5 --minor 48
28
28
check-cbmc-viewer-version.py --major 2 --minor 5
29
29
30
30
# Formatting check
31
- ./x.py fmt --check
31
+ ${SCRIPT_DIR} /kani- fmt.sh --check
32
32
33
33
# Build Kani compiler and Kani library
34
34
(cd " ${KANI_DIR} /src/kani-compiler" ; cargo build)
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ cargo new std_lib_test --lib
40
40
cd std_lib_test
41
41
42
42
# Use same nightly toolchain used to build Kani
43
- cp ${KANI_DIR} /src/kani-compiler/ rust-toolchain.toml .
43
+ cp ${KANI_DIR} /rust-toolchain.toml .
44
44
45
45
echo " Starting cargo build with Kani"
46
46
export RUSTC_LOG=error
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments