Make a compiler-wrapper script

refactor
Matt Godbolt 11 years ago
parent 46bb780001
commit 540ebdbf92

@ -6,13 +6,13 @@ libpreload.so: preload.c
.PHONY: test clean
test: libpreload.so
-@rm -f /tmp/allowed
cat tests/testfile | ./g++.sh -std=c++0x -S -o /tmp/allowed -x c++ -
cat tests/testfile | ./compiler-wrapper g++ -std=c++0x -S -o /tmp/allowed -x c++ -
@if [ ! -s /tmp/allowed ]; then echo "/tmp/allowed should exist"; false; fi
-@rm -f /tmp/allowed
cat tests/bad-includes | ./g++.sh -std=c++0x -S -o /tmp/allowed -x c++ - 2>&1 | grep 'Denying'
cat tests/bad-includes | ./compiler-wrapper g++ -std=c++0x -S -o /tmp/allowed -x c++ - 2>&1 | grep 'Denying'
@if [ -s /tmp/allowed ]; then echo "/tmp/allowed should not exist"; false; fi
-@rm -f not-allowed
cat tests/testfile | ./g++.sh -std=c++0x -S -o not-allowed -x c++ - 2>&1 | grep 'Denying'
cat tests/testfile | ./compiler-wrapper g++ -std=c++0x -S -o not-allowed -x c++ - 2>&1 | grep 'Denying'
@if [ -e not-allowed ]; then echo "not-allowed should not exist"; false; fi
clean:

@ -4,4 +4,4 @@ export LD_PRELOAD=$(pwd)/libpreload.so
export ALLOWED_FOR_CREATE=/tmp
export ALLOWED_FOR_READ=/usr/local/include:/usr/include:/usr/lib
g++ "$@"
"$@"
Loading…
Cancel
Save