Commit ac5bf544 authored by Robert Bradshaw's avatar Robert Bradshaw

Test for --embedded mode.

parent 3a2a66e2
# Makefile for creating our standalone Cython program # Makefile for creating our standalone Cython program
PYVERSION=2.3 PYVERSION=$(shell python -c "import sys; print sys.version[:3]")
PYPREFIX=/usr PYPREFIX=$(shell python -c "import sys; print sys.prefix")
INCLUDES=-I$(PYPREFIX)/include/python$(PYVERSION) INCLUDES=-I$(PYPREFIX)/include/python$(PYVERSION)
embedded: embedded.o embedded: embedded.o
gcc -o $@ $^ -lpython$(PYVERSION) gcc -o $@ $^ -lpython$(PYVERSION)
embedded.o: embedded.c embedded.o: embedded.c
gcc -c $^ $(INCLUDES) gcc -c $^ $(INCLUDES)
embedded.c: embedded.pyx embedded.c: embedded.pyx
@python ../../cython.py --embed embedded.pyx @python ../../cython.py --embed embedded.pyx
all: embedded all: embedded
clean: clean:
@echo Cleaning Demos/embed @echo Cleaning Demos/embed
@rm -f *~ *.o *.so core core.* *.c embedded @rm -f *~ *.o *.so core core.* *.c embedded
test: clean all
./embedded > test.output
python assert_equal.py embedded.output test.output
import sys
if open(sys.argv[1]).read() != open(sys.argv[2]).read():
print "Files differ"
sys.exit(1)
else:
print "Files identical"
__main__
Hi, I'm embedded.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment