File: remote_url.bash

package info (click to toggle)
ccache 4.12.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 5,192 kB
  • sloc: cpp: 47,336; asm: 28,570; sh: 8,709; ansic: 5,357; python: 685; perl: 68; makefile: 23
file content (49 lines) | stat: -rw-r--r-- 1,779 bytes parent folder | download | duplicates (3)
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
SUITE_remote_url_SETUP() {
    generate_code 1 test.c
}

SUITE_remote_url() {
    # -------------------------------------------------------------------------
    TEST "Reject empty url (without config attributes)"

    export CCACHE_REMOTE_STORAGE="|"
    $CCACHE_COMPILE -c test.c 2>stderr.log
    expect_contains stderr.log "must provide a URL"

    # -------------------------------------------------------------------------
    TEST "Reject empty url (but with config attributes)"

    export CCACHE_REMOTE_STORAGE="|key=value"
    $CCACHE_COMPILE -c test.c 2>stderr.log
    expect_contains stderr.log "must provide a 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
}