aboutsummaryrefslogtreecommitdiff
path: root/cortex-m-rt/ci/script.sh
blob: 02ba51f0b2882f94be1cb73408dedbc347344fd3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/usr/bin/env bash

set -euxo pipefail

main() {
    cargo check --target "$TARGET"

    cargo check --target "$TARGET" --features device

    # A `critical_section` implementation is always needed.
    needed_features=cortex-m/critical-section-single-core

    if [ "$TARGET" = x86_64-unknown-linux-gnu ] && [ "$TRAVIS_RUST_VERSION" = stable ]; then
        ( cd macros && cargo check && cargo test )

        cargo test --features "device,${needed_features}" --test compiletest
    fi

    local examples=(
        alignment
        divergent-default-handler
        divergent-exception
        entry-static
        main
        minimal
        override-exception
        pre_init
        qemu
        state
        unsafe-default-handler
        unsafe-entry
        unsafe-exception
        unsafe-hard-fault
    )
    local fail_examples=(
        data_overflow
    )
    local linkers=(
        # Link with arm-none-eabi-ld
        "-C linker=arm-none-eabi-ld"
        # Link with arm-none-eabi-gcc, requires -nostartfiles
        "-C linker=arm-none-eabi-gcc -C link-arg=-nostartfiles"
        # Link with rust-lld (default)
        ""
    )
    if [ "$TARGET" != x86_64-unknown-linux-gnu ]; then
        # Only test on stable and nightly, not MSRV.
        if [ "$TRAVIS_RUST_VERSION" = stable ] || [ "$TRAVIS_RUST_VERSION" = nightly ]; then
            RUSTDOCFLAGS="-Cpanic=abort" cargo test --features "${needed_features}" --doc
        fi

        for linker in "${linkers[@]}"; do
            for ex in "${examples[@]}"; do
                cargo rustc --target "$TARGET" --example "$ex" --features "${needed_features}" -- $linker
                cargo rustc --target "$TARGET" --example "$ex" --features "${needed_features}" --release -- $linker
            done
            for ex in "${fail_examples[@]}"; do
                ! cargo rustc --target "$TARGET" --example "$ex" --features "${needed_features}" -- $linker
                ! cargo rustc --target "$TARGET" --example "$ex" --features "${needed_features}" --release -- $linker
            done
            cargo rustc --target "$TARGET" --example device --features "device,${needed_features}" -- $linker
            cargo rustc --target "$TARGET" --example device --features "device,${needed_features}" --release -- $linker

            cargo rustc --target "$TARGET" --example minimal --features "set-sp,${needed_features}" -- $linker
            cargo rustc --target "$TARGET" --example minimal --features "set-sp,${needed_features}" --release -- $linker
            cargo rustc --target "$TARGET" --example minimal --features "zero-init-ram,${needed_features}" -- $linker
            cargo rustc --target "$TARGET" --example minimal --features "zero-init-ram,${needed_features}" --release -- $linker
            cargo rustc --target "$TARGET" --example minimal --features "set-vtor,${needed_features}" -- $linker
            cargo rustc --target "$TARGET" --example minimal --features "set-vtor,${needed_features}" --release -- $linker
        done
    fi

    case $TARGET in
        thumbv6m-none-eabi|thumbv7m-none-eabi)
            for linker in "${linkers[@]}"; do
                env RUSTFLAGS="$linker -C link-arg=-Tlink.x" cargo run \
                    --target "$TARGET" --features "${needed_features}" --example qemu | grep "x = 42"
                env RUSTFLAGS="$linker -C link-arg=-Tlink.x" cargo run \
                    --target "$TARGET" --features "${needed_features}" --example qemu --release | grep "x = 42"
            done

            ;;
    esac
}

main
959ac03e39ff0?s=13&d=retro' width='13' height='13' alt='Gravatar' /> Colin McDonnell 4-77/+119 2023-04-07feat(tls.Server) basic support (cert, key, rejectUnauthorized, requestCert, c...Gravatar Ciro Spaciari 23-10346/+13923 2023-04-06Proactively add these to the listGravatar Jarred Sumner 1-0/+2 2023-04-06BumpGravatar Jarred Sumner 1-1/+1 2023-04-06fix: export `constants` from `fs/promises` (#2567)Gravatar dave caruso 6-6/+14 2023-04-06docs: add a section on uninstalling bun (#2560)Gravatar dave caruso 1-0/+8 2023-04-06docs(cli/bunx): add notice (#2574)Gravatar Jozef Steinhübl 1-0/+4 2023-04-06Fix `toEqual` when the second array has extra array holes (#2580)Gravatar Dylan Conway 3-18/+76 2023-04-06Add last modify field "mtime" for FileBlob (#1431) (#2491)Gravatar Zhongwei Yao 6-33/+128 2023-04-06bun-types: infer strict `Subprocess` from `Bun.spawn()` options, part 2 (#2573)Gravatar dave caruso 9-67/+165 2023-04-06cache needs to update, move to another process (#2578)Gravatar Dylan Conway 2-156/+171 2023-04-06fix(ws): export Server (#2575)Gravatar hiroki osame 1-13/+30 2023-04-06docs(CONTRIBUTING): referece development guide (#2576)Gravatar hiroki osame 1-1/+5 2023-04-05rebase (#1501)Gravatar dave caruso 2-144/+305 2023-04-05Update `typecheck` (#2572)Gravatar Colin McDonnell 3-4/+8 2023-04-05prependGravatar Jarred Sumner 1-7/+3 2023-04-05Add tests for `bun test` with preload scripts (#2566)Gravatar Jake Boone 2-1/+107 2023-04-05Disable buffering when we clear terminalGravatar Jarred Sumner 1-0/+2 2023-04-05PrettierGravatar Jarred Sumner 3-4/+4 2023-04-05fix(fetch.proxy) fix proxy authentication (#2554)Gravatar Ciro Spaciari 3-31/+186 2023-04-05fix: build warnings (#2562)Gravatar hiroki osame 4-4/+1 2023-04-05In Documentation, move --watch before the script name (#2569)Gravatar Lawlzer 1-4/+5 2023-04-05fix `deepEquals` with array holes and accessors (#2557)Gravatar Dylan Conway 2-10/+249 2023-04-05fix: modules to have null prototype (#2561)Gravatar hiroki osame 2-2/+9 2023-04-04:clock1: :clock2: :clock3:Gravatar Jarred Sumner 1-1/+1 2023-04-04Implement `import.meta.main` (#2556)Gravatar Jarred Sumner 10-8/+89 2023-04-04Dylan/fix some failing tests (#2544)Gravatar Jarred Sumner 10-29/+72 2023-04-04Add npm benchmark (#2555)Gravatar Colin McDonnell 13-1/+271 2023-04-03Use absolute paths morebun-v0.5.9Gravatar Jarred Sumner 2-6/+11 2023-04-03Fix test failureGravatar Jarred Sumner 1-15/+18