mirror of
https://tinyplantnews.com/git2/ldaphotos
synced 2025-01-10 18:35:15 +00:00
Quicksaving. Works.
Removed test suite and dependency on criterion unit test framework. The criterion AUR depended on an out-of-date ABI of libgit2, and since I don't want to wait for criterion's developers to update it, or to install an old version of a library I don't need, I decided to cut the unit test framework out of ldaphotos. The team (me) is searching for alternatives. main.h: Refactored the OPTIONS list. local.schema: Added LDAP schema. This is currently useless. Makefile: Consolidated libraries into $(LIBRARIES) variable.
This commit is contained in:
parent
39a69c947e
commit
bad9984903
12
Makefile
12
Makefile
@ -17,11 +17,13 @@ INSTDIR := /usr/local/bin
|
|||||||
|
|
||||||
REFACTOR := refactor.h
|
REFACTOR := refactor.h
|
||||||
|
|
||||||
TESTCFLAGS:= $(shell pkg-config --cflags criterion)
|
TESTCFLAGS:= #$(shell pkg-config --cflags )
|
||||||
TESTLIBS := $(shell pkg-config --libs criterion)
|
TESTLIBS := #$(shell pkg-config --libs )
|
||||||
TESTDIR := $(SRCDIR)/test
|
TESTDIR := $(SRCDIR)/test
|
||||||
TESTOD := $(OBJDIR)/test
|
TESTOD := $(OBJDIR)/test
|
||||||
|
|
||||||
|
LIBRARIES := libnotify libcrypto
|
||||||
|
|
||||||
HEADERS := $(wildcard $(INCDIR)/*.h)
|
HEADERS := $(wildcard $(INCDIR)/*.h)
|
||||||
|
|
||||||
MAINS := $(wildcard $(MAINDIR)/*.c)
|
MAINS := $(wildcard $(MAINDIR)/*.c)
|
||||||
@ -40,10 +42,10 @@ SOURCES := $(wildcard $(SRCDIR)/*.c)
|
|||||||
OBJECTS := $(patsubst $(SRCDIR)/%.c, $(OBJDIR)/%.o, $(SOURCES))
|
OBJECTS := $(patsubst $(SRCDIR)/%.c, $(OBJDIR)/%.o, $(SOURCES))
|
||||||
|
|
||||||
CPPFLAGS := -I$(abspath $(INCDIR)) -MMD -MP -DUSE_LIBNOTIFY -DUSE_SYSLOG
|
CPPFLAGS := -I$(abspath $(INCDIR)) -MMD -MP -DUSE_LIBNOTIFY -DUSE_SYSLOG
|
||||||
CFLAGS := -Wall -Werror -Wpedantic $(shell pkg-config --cflags libnotify) -ggdb
|
CFLAGS := -Wall -Werror -Wpedantic $(shell pkg-config --cflags $(LIBRARIES)) -ggdb
|
||||||
|
|
||||||
LDFLAGS := #-Lmath or whatever
|
LDFLAGS := #-Lmath or whatever
|
||||||
LDLIBS := $(shell pkg-config --libs libnotify libcrypto) #-lm or whatever
|
LDLIBS := $(shell pkg-config --libs $(LIBRARIES)) #-lm or whatever
|
||||||
|
|
||||||
define MANGLE =
|
define MANGLE =
|
||||||
$(dir $(1))$(PREFIX)$(notdir $(1))$(SUFFIX)
|
$(dir $(1))$(PREFIX)$(notdir $(1))$(SUFFIX)
|
||||||
@ -60,6 +62,8 @@ refactor:
|
|||||||
$(UNITTESTS): $(OBJECTS) $(TESTOBJS) | $(BINDIR) $(OBJDIR) $(TESTOD)
|
$(UNITTESTS): $(OBJECTS) $(TESTOBJS) | $(BINDIR) $(OBJDIR) $(TESTOD)
|
||||||
@echo "Linking unit tests..."
|
@echo "Linking unit tests..."
|
||||||
@echo "Object files for tests is " $(TESTOBJS)
|
@echo "Object files for tests is " $(TESTOBJS)
|
||||||
|
@echo "LDLIBS expands to" $(LDLIBS)
|
||||||
|
@echo "LIBRARIES expands to" $(LIBRARIES)
|
||||||
$(CC) $(LDFLAGS) $(OBJECTS) $(patsubst $(BINDIR)/%, $(TESTOD)/%.o, $@) $(LDLIBS) $(TESTLIBS) -o $(dir $@)$(PREFIX)$(notdir $@)$(SUFFIX)
|
$(CC) $(LDFLAGS) $(OBJECTS) $(patsubst $(BINDIR)/%, $(TESTOD)/%.o, $@) $(LDLIBS) $(TESTLIBS) -o $(dir $@)$(PREFIX)$(notdir $@)$(SUFFIX)
|
||||||
@echo "...Done linking unit tests"
|
@echo "...Done linking unit tests"
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
attributeType ( 69.420 NAME ( '' '' )
|
attributeType ( 1.3.6.1.4.1.60580.1.1 NAME ( '' '' )
|
||||||
DESC ''
|
DESC ''
|
||||||
EQUALITY caseIgnoreMatch
|
EQUALITY caseIgnoreMatch
|
||||||
SUBSTR caseIgnoreSubstringsMatch
|
SUBSTR caseIgnoreSubstringsMatch
|
||||||
|
@ -10,25 +10,18 @@
|
|||||||
#define PROGNAME "ldaphotos"
|
#define PROGNAME "ldaphotos"
|
||||||
#define USAGE0 "Usage:"
|
#define USAGE0 "Usage:"
|
||||||
#define USAGE1 "[OPTION...]"
|
#define USAGE1 "[OPTION...]"
|
||||||
#define OPTIONS0 "Options:"
|
#define OPTIONS "Options: \
|
||||||
#define OPTIONS1 "\t-v run verbosely"
|
\t-v run verbosely \
|
||||||
#define OPTIONS2 "\t-h show help and exit"
|
\t-h show help and exit \
|
||||||
#define OPTIONS3 "\t-t provide terse output"
|
\t-t provide terse output \
|
||||||
#define OPTIONS4 "\t-f <path> Read input from file <path>"
|
\t-f <path> Read input from file <path> \
|
||||||
#define OPTIONS5 ""
|
t-p Print the effects of the given options for this invocation"
|
||||||
#define OPTIONS6 ""
|
|
||||||
#define OPTIONS7 ""
|
|
||||||
#define OPTIONS8 ""
|
|
||||||
#define OPTIONS9 ""
|
|
||||||
#define OPTIONS10 "\t-p Print the effects of the given options for this invocation"
|
|
||||||
|
|
||||||
void print_help(void){
|
void print_help(void){
|
||||||
printf("%s %s\n", TITLE, VERSION);
|
printf("%s %s\n", TITLE, VERSION);
|
||||||
printf("%s %s %s\n", USAGE0, PROGNAME, USAGE1);
|
printf("%s %s %s\n", USAGE0, PROGNAME, USAGE1);
|
||||||
printf("%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n",
|
printf("%s\n",
|
||||||
OPTIONS0, OPTIONS1, OPTIONS2, OPTIONS3, OPTIONS4,
|
OPTIONS);
|
||||||
OPTIONS5, OPTIONS6, OPTIONS7, OPTIONS8, OPTIONS9,
|
|
||||||
OPTIONS10);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -118,7 +118,7 @@ int opt;
|
|||||||
memcpy(filepath, optarg, strlen(optarg));
|
memcpy(filepath, optarg, strlen(optarg));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
printf("Literally how could you pass an unspecified argument to this program");
|
printf("Literally how could you pass an unspecified argument to this program\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,38 +0,0 @@
|
|||||||
#include <stdlib.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#include <criterion/criterion.h>
|
|
||||||
|
|
||||||
#include "main.h"
|
|
||||||
#include "manipulations.h"
|
|
||||||
#include "hasher.h"
|
|
||||||
#include "log.h"
|
|
||||||
|
|
||||||
#ifdef USE_LIBNOTIFY
|
|
||||||
#include <libnotify/notify.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Test(misc, passing){
|
|
||||||
cr_assert(1, "ya boi");
|
|
||||||
}
|
|
||||||
|
|
||||||
Test(misc, hashsomething){
|
|
||||||
|
|
||||||
if(!init_hasher()){
|
|
||||||
log(LOG_INFO, "Error encountered while initializing hasher");
|
|
||||||
}
|
|
||||||
|
|
||||||
begin_digest();
|
|
||||||
|
|
||||||
|
|
||||||
unsigned int len;
|
|
||||||
unsigned int aalen;
|
|
||||||
unsigned char * a = get_digest(&len);
|
|
||||||
char *aa = atohex(a, len, &aalen);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
free(aa);
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user