-
Notifications
You must be signed in to change notification settings - Fork 9
/
build_tests
executable file
·69 lines (54 loc) · 1.77 KB
/
build_tests
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
#!/bin/sh
template_header_1='template_header_1.txt'
template_header_2='template_header_2.txt'
decl_template='declarative_template.txt'
decl_output='test_declarative.html'
script_template_1='script_template.txt'
script_output_1='test_script.html'
script_template_2='script_2_template.txt'
script_template_2_end='script_2b_template.txt'
script_output_2='test_script_2.html'
script_template_3='script_3_template.txt'
script_template_3_start='script_3b_template.txt'
script_output_3='test_script_3.html'
#num_copies=10
num_copies=10000
function write_header_1() {
sed -e "s/\${num_copies}/${num_copies}/" ${template_header_1} > $1
}
function write_header_2() {
sed -e "s/\${num_copies}/${num_copies}/" ${template_header_2} >> $1
}
function write_footer() {
cat <<EOF >>$1
</div> <!-- id=suppress_layout -->
EOF
}
function write_copies() {
for (( i=0; i<${num_copies}; i++ )); do
##sed -e "s/\${copy_num}/${i}/" $1 >> $2
cat $1 >> $2
done
}
echo "Writing ${decl_output}..."
write_header_1 ${decl_output}
write_header_2 ${decl_output}
write_copies ${decl_template} ${decl_output}
write_footer ${decl_output}
echo "Writing ${script_output_1}..."
write_header_1 ${script_output_1}
write_header_2 ${script_output_1}
write_copies ${script_template_1} ${script_output_1}
write_footer ${script_output_1}
echo "Writing ${script_output_2}..."
write_header_1 ${script_output_2}
write_header_2 ${script_output_2}
write_copies ${script_template_2} ${script_output_2}
write_footer ${script_output_2}
cat ${script_template_2_end} >> ${script_output_2}
echo "Writing ${script_output_3}..."
write_header_1 ${script_output_3}
cat ${script_template_3_start} >> ${script_output_3}
write_header_2 ${script_output_3}
write_copies ${script_template_3} ${script_output_3}
write_footer ${script_output_3}