-
Notifications
You must be signed in to change notification settings - Fork 0
/
4-describe-data-1-list.sh
executable file
·137 lines (128 loc) · 5.15 KB
/
4-describe-data-1-list.sh
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#!/usr/bin/env bash
. $(dirname "${BASH_SOURCE[0]}")/common.sh
cd "$CURR_DIR"/describe-project
temp_file=$(mktemp $(basename $0).XXXXXX)
function cleanup {
rm $temp_file
}
trap cleanup EXIT
if ! $DUB describe --compiler=$DC --filter-versions \
--data-list \
'--data= target-type , target-path , target-name ' \
'--data= working-directory ' \
--data=main-source-file \
'--data=dflags,lflags' \
'--data=libs, linker-files' \
'--data=source-files, copy-files' \
'--data=versions, debug-versions' \
--data=import-paths \
--data=string-import-paths \
--data=import-files \
--data=string-import-files \
--data=pre-generate-commands \
--data=post-generate-commands \
--data=pre-build-commands \
--data=post-build-commands \
'--data=requirements, options' \
> "$temp_file"; then
die $LINENO 'Printing project data failed!'
fi
# Create the expected output path file to compare against.
expected_file="$CURR_DIR/expected-describe-data-1-list-output"
# --data=target-type
echo "executable" > "$expected_file"
echo >> "$expected_file"
# --data=target-path
echo "$CURR_DIR/describe-project/" >> "$expected_file"
echo >> "$expected_file"
# --data=target-name
echo "describe-project" >> "$expected_file"
echo >> "$expected_file"
# --data=working-directory
echo "$CURR_DIR/describe-project/" >> "$expected_file"
echo >> "$expected_file"
# --data=main-source-file
echo "$CURR_DIR/describe-project/src/dummy.d" >> "$expected_file"
echo >> "$expected_file"
# --data=dflags
echo "--some-dflag" >> "$expected_file"
echo "--another-dflag" >> "$expected_file"
echo >> "$expected_file"
# --data=lflags
echo "--some-lflag" >> "$expected_file"
echo "--another-lflag" >> "$expected_file"
echo >> "$expected_file"
# --data=libs
echo "somelib" >> "$expected_file"
echo "anotherlib" >> "$expected_file"
echo >> "$expected_file"
# --data=linker-files
echo "$CURR_DIR/describe-dependency-3/libdescribe-dependency-3.a" >> "$expected_file"
echo "$CURR_DIR/describe-project/some.a" >> "$expected_file"
echo "$CURR_DIR/describe-dependency-1/dep.a" >> "$expected_file"
echo >> "$expected_file"
# --data=source-files
echo "$CURR_DIR/describe-project/src/dummy.d" >> "$expected_file"
echo "$CURR_DIR/describe-dependency-1/source/dummy.d" >> "$expected_file"
echo >> "$expected_file"
# --data=copy-files
echo "$CURR_DIR/describe-project/data/dummy.dat" >> "$expected_file"
echo "$CURR_DIR/describe-dependency-1/data/*" >> "$expected_file"
echo >> "$expected_file"
# --data=versions
echo "someVerIdent" >> "$expected_file"
echo "anotherVerIdent" >> "$expected_file"
echo "Have_describe_dependency_3" >> "$expected_file"
echo >> "$expected_file"
# --data=debug-versions
echo "someDebugVerIdent" >> "$expected_file"
echo "anotherDebugVerIdent" >> "$expected_file"
echo >> "$expected_file"
# --data=import-paths
echo "$CURR_DIR/describe-project/src/" >> "$expected_file"
echo "$CURR_DIR/describe-dependency-1/source/" >> "$expected_file"
echo "$CURR_DIR/describe-dependency-2/some-path/" >> "$expected_file"
echo "$CURR_DIR/describe-dependency-3/dep3-source/" >> "$expected_file"
echo >> "$expected_file"
# --data=string-import-paths
echo "$CURR_DIR/describe-project/views/" >> "$expected_file"
echo "$CURR_DIR/describe-dependency-2/some-extra-string-import-path/" >> "$expected_file"
echo "$CURR_DIR/describe-dependency-3/dep3-string-import-path/" >> "$expected_file"
echo >> "$expected_file"
# --data=import-files
echo "$CURR_DIR/describe-dependency-2/some-path/dummy.d" >> "$expected_file"
echo >> "$expected_file"
# --data=string-import-files
echo "$CURR_DIR/describe-project/views/dummy.d" >> "$expected_file"
#echo "$CURR_DIR/describe-dependency-2/some-extra-string-import-path/dummy.d" >> "$expected_file" # This is missing from result, is that a bug?
echo >> "$expected_file"
# --data=pre-generate-commands
echo "./do-preGenerateCommands.sh" >> "$expected_file"
echo "../describe-dependency-1/dependency-preGenerateCommands.sh" >> "$expected_file"
echo >> "$expected_file"
# --data=post-generate-commands
echo "./do-postGenerateCommands.sh" >> "$expected_file"
echo "../describe-dependency-1/dependency-postGenerateCommands.sh" >> "$expected_file"
echo >> "$expected_file"
# --data=pre-build-commands
echo "./do-preBuildCommands.sh" >> "$expected_file"
echo "../describe-dependency-1/dependency-preBuildCommands.sh" >> "$expected_file"
echo >> "$expected_file"
# --data=post-build-commands
echo "./do-postBuildCommands.sh" >> "$expected_file"
echo "../describe-dependency-1/dependency-postBuildCommands.sh" >> "$expected_file"
echo >> "$expected_file"
# --data=requirements
echo "allowWarnings" >> "$expected_file"
echo "disallowInlining" >> "$expected_file"
#echo "requireContracts" >> "$expected_file" # Not sure if this (from a sourceLib dependency) should be missing from the result
echo >> "$expected_file"
# --data=options
echo "debugMode" >> "$expected_file"
echo "releaseMode" >> "$expected_file"
echo "debugInfo" >> "$expected_file"
echo "warnings" >> "$expected_file"
#echo "stackStomping" >> "$expected_file" # Not sure if this (from a sourceLib dependency) should be missing from the result
if ! diff "$expected_file" "$temp_file"; then
die $LINENO 'The project data did not match the expected output!'
fi