adding a small test

LPA-1
Volker Birk 4 years ago
parent bcfcff6ad6
commit 7eb073d28d
  1. 1
      .hgignore
  2. 12
      Makefile
  3. 6
      Makefile.conf
  4. 29
      test_adapter.cc

@ -3,3 +3,4 @@ syntax: glob
*.a
*.swp
ws
test_adapter

@ -3,12 +3,10 @@
include Makefile.conf
-include local.conf
TARGET?=libpEpAdapter.a
PEPENGINE_IN?=$(HOME)
CXXFLAGS += -I$(HOME)/include -std=c++14 -O0 -g
SOURCE=$(wildcard *.cc)
HEADERS=$(wildcard *.hh)
OBJECTS=$(subst .cc,.o,$(SOURCE))
WITHOUT_TESTS=$(patsubst test%.o,,$(OBJECTS))
@ -20,7 +18,7 @@ all: $(TARGET)
$(TARGET): $(WITHOUT_TESTS)
ar -rc $@ $^
.PHONY: clean test
.PHONY: clean test install
clean:
rm -f $(TARGET) $(OBJECTS) *.a test_adapter
@ -29,5 +27,9 @@ test: test_adapter
./test_adapter
test_adapter: test_adapter.o $(TARGET)
$(CXX) -o $@ -L$(HOME)/lib -lpEpEngine -L. -lpEpAdapter $<
$(CXX) -o $@ -L$(PEP)/lib -lpEpEngine -L. -lpEpAdapter $<
install:
-mkdir -p $(PEP)/include
cp $(HEADERS) $(PEP)/include

@ -1,2 +1,4 @@
# TARGET=libpEpAdapter.a
# PEPENGINE_IN=$(HOME)
TARGET=libpEpAdapter.a
PREFIX=$(HOME)
PEP=$(HOME)

@ -0,0 +1,29 @@
#include "Adapter.hh"
#include <iostream>
#include <assert.h>
#include <unistd.h>
using namespace pEp;
using namespace std;
PEP_STATUS messageToSend(struct _message *msg)
{
cout << "calling messageToSend();\n";
return PEP_STATUS_OK;
}
PEP_STATUS notifyHandshake(void *obj, pEp_identity *me, pEp_identity *partner, sync_handshake_signal signal)
{
cout << "calling notifyHandshake();\n";
return PEP_STATUS_OK;
}
int main()
{
Adapter(messageToSend, notifyHandshake);
sleep(3);
Adapter::shutdown();
return 0;
}
Loading…
Cancel
Save