File: remote_url.bash

package info (click to toggle)
ccache 4.13.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 5,420 kB
  • sloc: cpp: 50,251; asm: 28,570; sh: 9,632; ansic: 5,357; python: 834; perl: 68; makefile: 24
file content (35 lines) | stat: -rw-r--r-- 1,229 bytes parent folder | download
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
SUITE_remote_url_SETUP() {
    generate_code 1 test.c
}

SUITE_remote_url() {
    # -------------------------------------------------------------------------
    TEST "Reject invalid url"

    export CCACHE_REMOTE_STORAGE="://qwerty"
    $CCACHE_COMPILE -c test.c 2>stderr.log
    expect_contains stderr.log "Cannot parse URL"

    # -------------------------------------------------------------------------
if $RUN_WIN_XFAIL; then
    TEST "Reject missing scheme"

    export CCACHE_REMOTE_STORAGE="/qwerty"
    $CCACHE_COMPILE -c test.c 2>stderr.log
    expect_contains stderr.log "URL scheme must not be empty"

    # -------------------------------------------------------------------------
    TEST "Reject user info defined but no host"

    export CCACHE_REMOTE_STORAGE="http://foo@"
    $CCACHE_COMPILE -c test.c 2>stderr.log
    expect_contains stderr.log "User info defined, but host is empty"

    # -------------------------------------------------------------------------
    TEST "Reject relative path with colon in first part"

    export CCACHE_REMOTE_STORAGE="file:foo:bar"
    $CCACHE_COMPILE -c test.c 2>stderr.log
    expect_contains stderr.log "The first segment of the relative path can't contain ':'"
fi
}