aboutsummaryrefslogtreecommitdiff
path: root/tests/buildtab/testscript
blob: 511d284916c02e685cdbcd4438cc03ecd3304c46 (plain)
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
87
88
89
90
91
92
93
# file      : tests/buildtab/testscript
# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd
# license   : MIT; see accompanying LICENSE file

: valid
:
: Roundtrip buildtab.
:
{
  : all-fileds-combinations
  :
  $* <<EOF >>EOF
  windows*-vc_14* windows-vc_14-32 i686-microsoft-win32-msvc14.0 default
  windows*-vc_14* windows-vc_14-32-debug i686-microsoft-win32-msvc14.0 default config.cc.coptions=/Z7 config.cc.loptions=/DEBUG ~"warning C4\d{3}: "
  EOF

  : empty-lines
  :
  $* <<EOI >>EOO

  windows*-vc_14* windows-vc_14-32-debug i686-microsoft-win32-msvc14.0 default
   # abc
  EOI
  windows*-vc_14* windows-vc_14-32-debug i686-microsoft-win32-msvc14.0 default
  EOO

  : single-class
  :
  $* <<EOF >>EOF
  windows*-vc_14* windows-vc_14-32 i686-microsoft-win32-msvc14.0 default
  EOF

  : multiple-classes
  :
  $* <<EOF >>EOF
  windows*-vc_14* windows-vc_14-32 i686-microsoft-win32-msvc14.0 "all default"
  EOF
}

: parse-errors
:
{
  : no-name
  :
  $* <<EOI 2>>EOE == 1
  windows*-vc_14*
  EOI
  cin:1:16: error: no configuration name found
  EOE

  : no-target
  :
  $* <<EOI 2>>EOE == 1
  windows*-vc_14* windows-vc_14-32
  EOI
  cin:1:33: error: no target found
  EOE

  : invalid-target
  :
  $* <<EOI 2>>EOE == 1
  windows*-vc_14* windows-vc_14-32 microsoft
  EOI
  cin:1:34: error: missing cpu
  EOE

  : invalid-class
  :
  $* <<EOI 2>>EOE == 1
  windows*-vc_14* windows-vc_14-32 i686-microsoft-win32-msvc14.0 a=b
  EOI
  cin:1:64: error: class name 'a=b' contains '='
  EOE

  : invalid-var
  :
  {
    : unquoted
    :
    $* <<EOI 2>>EOE == 1
    windows*-vc_14* windows-vc_14-32 i686-microsoft-win32-msvc14.0 default config.cc.coptions="/Z7
    EOI
    cin:1:95: error: unterminated quoted string
    EOE
  }

  : dup-config-name
  :
  $* <<EOI 2>'cin:2:17: error: duplicate configuration name' == 1
  windows*-vc_14* windows-vc_14-32 i686-microsoft-win32-msvc14.0 default
  windows*-vc_14* windows-vc_14-32 i686-microsoft-win32-msvc14.0 default
  EOI
}