|
1 | 1 | #!/bin/bash |
2 | 2 | set -e |
3 | 3 |
|
4 | | -echo "=== ArceOS Helloworld Test Script ===" |
| 4 | +echo "=== ArceOS Childtask Test Script ===" |
5 | 5 | echo "" |
6 | 6 |
|
7 | 7 | # Check if required tools are installed |
@@ -30,11 +30,35 @@ check_format() { |
30 | 30 | echo "" |
31 | 31 | } |
32 | 32 |
|
33 | | -# Clippy lint check |
| 33 | +# Clippy lint check by architecture |
34 | 34 | check_clippy() { |
35 | 35 | echo "[3/7] Running clippy lint checks..." |
36 | | - cargo clippy -- -D warnings |
37 | | - echo "✓ Clippy check passed" |
| 36 | + |
| 37 | + local archs=("riscv64" "x86_64" "aarch64" "loongarch64") |
| 38 | + local targets=("riscv64gc-unknown-none-elf" "x86_64-unknown-none" "aarch64-unknown-none-softfloat" "loongarch64-unknown-none") |
| 39 | + |
| 40 | + for i in "${!archs[@]}"; do |
| 41 | + local arch="${archs[$i]}" |
| 42 | + local target="${targets[$i]}" |
| 43 | + |
| 44 | + echo "" |
| 45 | + echo "Running clippy for architecture: $arch" |
| 46 | + |
| 47 | + # Install config file for the architecture |
| 48 | + cp "configs/${arch}.toml" ".axconfig.toml" |
| 49 | + |
| 50 | + if cargo clippy --features axstd --target="$target" -- -D warnings; then |
| 51 | + echo "✓ $arch clippy check passed" |
| 52 | + else |
| 53 | + echo "Error: $arch clippy check failed" |
| 54 | + rm -f .axconfig.toml |
| 55 | + exit 1 |
| 56 | + fi |
| 57 | + done |
| 58 | + |
| 59 | + rm -f .axconfig.toml |
| 60 | + echo "" |
| 61 | + echo "✓ All architecture clippy checks passed" |
38 | 62 | echo "" |
39 | 63 | } |
40 | 64 |
|
@@ -81,11 +105,35 @@ run_arch_tests() { |
81 | 105 | echo "" |
82 | 106 | } |
83 | 107 |
|
84 | | -# Publish dry-run check |
| 108 | +# Publish dry-run check by architecture |
85 | 109 | check_publish() { |
86 | 110 | echo "[6/7] Checking publish readiness..." |
87 | | - cargo publish --dry-run --allow-dirty |
88 | | - echo "✓ Publish check passed" |
| 111 | + |
| 112 | + local archs=("riscv64" "x86_64" "aarch64" "loongarch64") |
| 113 | + local targets=("riscv64gc-unknown-none-elf" "x86_64-unknown-none" "aarch64-unknown-none-softfloat" "loongarch64-unknown-none") |
| 114 | + |
| 115 | + for i in "${!archs[@]}"; do |
| 116 | + local arch="${archs[$i]}" |
| 117 | + local target="${targets[$i]}" |
| 118 | + |
| 119 | + echo "" |
| 120 | + echo "Checking publish for architecture: $arch" |
| 121 | + |
| 122 | + # Install config file for the architecture |
| 123 | + cp "configs/${arch}.toml" ".axconfig.toml" |
| 124 | + |
| 125 | + if cargo publish --features axstd --dry-run --allow-dirty --target="$target"; then |
| 126 | + echo "✓ $arch publish check passed" |
| 127 | + else |
| 128 | + echo "Error: $arch publish check failed" |
| 129 | + rm -f .axconfig.toml |
| 130 | + exit 1 |
| 131 | + fi |
| 132 | + done |
| 133 | + |
| 134 | + rm -f .axconfig.toml |
| 135 | + echo "" |
| 136 | + echo "✓ All architecture publish checks passed" |
89 | 137 | echo "" |
90 | 138 | } |
91 | 139 |
|
|
0 commit comments