Unverified Commit db855a21 authored by Lucas Hosseini's avatar Lucas Hosseini Committed by GitHub

Add Makefile for tests. (#345)

parent 16aed09c
......@@ -59,9 +59,6 @@ tests/test_blas: tests/test_blas.cpp
$(CC) $(CFLAGS) $< -o $@ $(LDFLAGS) $(BLASLDFLAGS) $(BLASCFLAGS)
tests/demo_ivfpq_indexing: tests/demo_ivfpq_indexing.cpp $(LIBNAME).a
$(CC) -o $@ $(CFLAGS) $< $(LIBNAME).a $(LDFLAGS) $(BLASLDFLAGS)
tests/demo_sift1M: tests/demo_sift1M.cpp $(LIBNAME).a
$(CC) -o $@ $(CFLAGS) $< $(LIBNAME).a $(LDFLAGS) $(BLASLDFLAGS)
......
MAKEFILE_INC=../makefile.inc
-include $(MAKEFILE_INC)
CC_TESTS = test_ivfpq_indexing test_ivfpq_codec
all: $(CC_TESTS) ../py
run: all
./run_tests.sh
%: %.cpp ../libfaiss.a gtest/make/gtest_main.a
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(BLASLDFLAGS) \
-Igtest/include -I../..
../libfaiss.a:
cd ../ && make libfaiss.a
../py:
cd ../ && make py
gtest/make/gtest_main.a: gtest
cd gtest/make && make CXX=$(CC) gtest_main.a
gtest:
curl -L https://github.com/google/googletest/archive/release-1.8.0.tar.gz | tar xz && \
mv googletest-release-1.8.0/googletest gtest && \
rm -rf googletest-release-1.8.0
clean:
rm -rf $(CC_TESTS) gtest
#!/bin/sh
PYTHON=${PYTHON:-"python"}
make
for t in test_*.py; do
PYTHONPATH=.. $PYTHON $t || exit 1
done
for t in test_*.cpp; do
if [ "$t" != "test_blas.cpp" ]; then
./${t%.*} || exit 1
fi
done
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