File: wrapper.sh

package info (click to toggle)
bear 3.1.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,904 kB
  • sloc: cpp: 9,184; sh: 706; ansic: 497; python: 175; makefile: 29
file content (28 lines) | stat: -rw-r--r-- 1,027 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
#!/usr/bin/env sh

# REQUIRES: shell
# RUN: cd %T; %{bear} --verbose --output %t.json -- %{shell} %s
# RUN: assert_compilation %t.json count -eq 2
# RUN: assert_compilation %t.json contains -file %T/wrapper_1.c -directory %T -arguments %{c_compiler} -c -o wrapper_1.o wrapper_1.c
# RUN: assert_compilation %t.json contains -file %T/wrapper_2.c -directory %T -arguments %{c_compiler} -c -o wrapper_2.o wrapper_2.c

# RUN: cd %T; %{bear} --verbose --output %t.json --force-wrapper -- %{shell} %s
# RUN: assert_compilation %t.json count -eq 2
# RUN: assert_compilation %t.json contains -file %T/wrapper_1.c -directory %T -arguments %{c_compiler} -c -o wrapper_1.o wrapper_1.c
# RUN: assert_compilation %t.json contains -file %T/wrapper_2.c -directory %T -arguments %{c_compiler} -c -o wrapper_2.o wrapper_2.c

touch wrapper_1.c wrapper_2.c

cat > wrapper << EOF
#!/usr/bin/env sh

exec \$*
EOF

chmod +x wrapper

ORIGINAL=$CC
CC=./wrapper

$CC $ORIGINAL -c -o wrapper_1.o wrapper_1.c;
$CC $ORIGINAL -c -o wrapper_2.o wrapper_2.c;