forked from lix-project/lix
Move unit tests to sr/libutil/tests, use mk make rules
This commit is contained in:
parent
73d0b5d807
commit
7cc7cef950
4
Makefile
4
Makefile
|
@ -3,6 +3,7 @@ makefiles = \
|
||||||
local.mk \
|
local.mk \
|
||||||
nix-rust/local.mk \
|
nix-rust/local.mk \
|
||||||
src/libutil/local.mk \
|
src/libutil/local.mk \
|
||||||
|
src/libutil/tests/local.mk \
|
||||||
src/libstore/local.mk \
|
src/libstore/local.mk \
|
||||||
src/libfetchers/local.mk \
|
src/libfetchers/local.mk \
|
||||||
src/libmain/local.mk \
|
src/libmain/local.mk \
|
||||||
|
@ -16,8 +17,7 @@ makefiles = \
|
||||||
misc/upstart/local.mk \
|
misc/upstart/local.mk \
|
||||||
doc/manual/local.mk \
|
doc/manual/local.mk \
|
||||||
tests/local.mk \
|
tests/local.mk \
|
||||||
tests/plugins/local.mk \
|
tests/plugins/local.mk
|
||||||
tests/unit-tests/local.mk
|
|
||||||
|
|
||||||
-include Makefile.config
|
-include Makefile.config
|
||||||
|
|
||||||
|
|
11
src/libutil/tests/local.mk
Normal file
11
src/libutil/tests/local.mk
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
programs += libutil-tests
|
||||||
|
|
||||||
|
libutil-tests_DIR := $(d)
|
||||||
|
|
||||||
|
libutil-tests_SOURCES := $(wildcard $(d)/*.cc)
|
||||||
|
|
||||||
|
libutil-tests_CXXFLAGS += -I src/libutil
|
||||||
|
|
||||||
|
libutil-tests_LIBS = libutil
|
||||||
|
|
||||||
|
libutil-tests_LDFLAGS := $$(pkg-config --libs gtest_main)
|
|
@ -1,5 +1,5 @@
|
||||||
#include "../../src/libutil/util.hh"
|
#include "util.hh"
|
||||||
#include "../../src/libutil/types.hh"
|
#include "types.hh"
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
LIBS=-larchive -lcrypto -llzma -lbz2 -lz -lbrotlienc -lbrotlidec
|
|
||||||
unit-tests:
|
|
||||||
echo $(nix_LDFLAGS)
|
|
||||||
$(CXX) -o unit-test $(nix_CXXFLAGS) $(nix_LDFLAGS) $(LIBS) --std=c++17 $$(pkg-config --libs gtest_main) ./src/libutil/*.o tests/unit-tests/test-util.cc
|
|
Loading…
Reference in a new issue