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
|
#!/bin/sh
# autopkgtest check based on upstream cmake test ($ make test)
set -ue
mkdir -p $AUTOPKGTEST_TMP/tests
mkdir -p $AUTOPKGTEST_TMP/include/primesieve
cp -vpd -t $AUTOPKGTEST_TMP/include src/PreSieve.hpp
cp -vpd -t $AUTOPKGTEST_TMP/include src/PrimeSieveClass.hpp
cp -vpd -t $AUTOPKGTEST_TMP/include src/ParallelSieve.hpp
cp -vpd -t $AUTOPKGTEST_TMP/include src/RiemannR.hpp
cp -vpd -t $AUTOPKGTEST_TMP/include/primesieve include/primesieve/Vector.hpp
cp -vpd -t $AUTOPKGTEST_TMP/include/primesieve include/primesieve/pmath.hpp
cp -vpd -t $AUTOPKGTEST_TMP/include/primesieve include/primesieve/macros.hpp
cp -vpd -t $AUTOPKGTEST_TMP/include/primesieve include/primesieve/calculator.hpp
cp -vpd -t $AUTOPKGTEST_TMP/include/primesieve include/primesieve/cpu_supports_popcnt.hpp
cp -vpd -t $AUTOPKGTEST_TMP/tests test/*.c
cp -vpd -t $AUTOPKGTEST_TMP/tests test/*.cpp
cd $AUTOPKGTEST_TMP
cat > $AUTOPKGTEST_TMP/tests/GNUmakefile << EOF
#!/usr/bin/make -f
PROGRAMS = \
\$(patsubst %.c,%,\$(wildcard *.c)) \
\$(filter-out atomic cpu_info, \$(patsubst %.cpp,%,\$(wildcard *.cpp)) )
default: all
CFLAGS = \$(shell pkg-config primesieve --cflags)
CXXFLAGS = -I../include \$(shell pkg-config primesieve --cflags)
LDLIBS = \$(shell pkg-config primesieve --libs) -pthread
all: build
build: \$(PROGRAMS)
check: build
\$(foreach tst, \$(PROGRAMS), echo "+-+-+-+ \$(tst) +-+-+-+" ; ./\$(tst) ; )
clean:
\$(RM) \$(PROGRAMS)
EOF
make -C $AUTOPKGTEST_TMP/tests check
exit 0
|