adding read function and test runner

APPLEMAIL-24
Volker Birk 4 years ago
parent b5bb92dd33
commit 220b136e55
  1. 17
      Makefile
  2. 5
      UpdateStream.cc
  3. 20
      run_tests.sh
  4. 16
      test_updater.cc

@ -10,8 +10,13 @@ LDFLAGS += -lboost_regex-mt -lboost_iostreams-mt -lboost_system-mt -lssl -lcrypt
SOURCE=$(wildcard *.cc)
HEADERS=$(wildcard *.hh *.hxx)
OBJECTS=$(subst .cc,.o,$(SOURCE))
WITHOUT_TESTS=$(patsubst test_%.o,,$(OBJECTS))
TESTSOURCE=$(wildcard test_*.cc)
TESTOBJECTS=$(subst .cc,.o,$(TESTSOURCE))
TESTS=$(subst .cc,,$(TESTSOURCE))
all: $(TARGET)
%.o: %.cc %.hh
@ -35,15 +40,11 @@ uninstall:
cd $(PEP)/include && rm -f $(HEADERS)
cd $(PEP)/lib && rm -f $(TARGET)
test_split_url: test_split_url.o HTTPSStream.o
$(CXX) $(LDFLAGS) $< HTTPSStream.o -o $@
test_https: test_https.o HTTPSStream.o
$(CXX) $(LDFLAGS) $< HTTPSStream.o -o $@
test_%: test_%.o $(TARGET)
$(CXX) $(LDFLAGS) $< $(TARGET) -o $@
test: test_split_url test_https
./test_split_url
./test_https
test: $(TESTS)
. run_tests.sh $(TESTS)
tags: $(SOURCE) $(HEADERS)
ctags $(SOURCE) $(HEADERS)

@ -65,6 +65,11 @@ namespace pEp {
{
_https->close();
}
streamsize UpdateDevice::read(char* s, streamsize n)
{
return -1;
}
}
}

@ -0,0 +1,20 @@
#!/bin/bash
TESTS=$*
i=0
RED='\033[0;31m'
GREEN='\033[0;32m'
C='\033[0m'
for t in $TESTS; do
if ./$t ; then
printf "\n${GREEN}TEST SUCCEEDED: $t${C}\n\n"
((i++))
else
printf "\n${RED}TEST FAILED: $t${C}\n\n"
fi
done
echo $i OF $(echo $TESTS | wc -w) TESTS SUCCEEDED

@ -0,0 +1,16 @@
// this file is under GNU General Public License 3.0
// see LICENSE.txt
#include <iostream>
#include <assert.h>
#include "HTTPSStream.hh"
using namespace std;
using namespace pEp;
int main()
{
return 0;
}
Loading…
Cancel
Save