Merge branch 'master' into 24-tests-in-gitlab
This commit is contained in:
24
Makefile
24
Makefile
@@ -50,15 +50,11 @@ CC?=gcc
|
|||||||
|
|
||||||
LIBS=-lpthread
|
LIBS=-lpthread
|
||||||
INC=-I/usr/include/libev -Isrc/common -Isrc/server -Isrc/proxy
|
INC=-I/usr/include/libev -Isrc/common -Isrc/server -Isrc/proxy
|
||||||
COMPILE=$(CC) $(INC) -c $(CCFLAGS)
|
COMPILE=$(CC) -MMD $(INC) -c $(CCFLAGS)
|
||||||
SAVEDEP=$(CC) $(INC) -MM $(CCFLAGS)
|
|
||||||
LINK=$(CC) $(LLDFLAGS) -Isrc $(LIBS)
|
LINK=$(CC) $(LLDFLAGS) -Isrc $(LIBS)
|
||||||
|
|
||||||
LIB=build/
|
LIB=build/
|
||||||
|
|
||||||
EXISTING_OBJS := $(wildcard build/*.o)
|
|
||||||
-include $(EXISTING_OBJS:.o=.d)
|
|
||||||
|
|
||||||
COMMON_SRC := $(wildcard src/common/*.c)
|
COMMON_SRC := $(wildcard src/common/*.c)
|
||||||
SERVER_SRC := $(wildcard src/server/*.c)
|
SERVER_SRC := $(wildcard src/server/*.c)
|
||||||
PROXY_SRC := $(wildcard src/proxy/*.c)
|
PROXY_SRC := $(wildcard src/proxy/*.c)
|
||||||
@@ -76,7 +72,6 @@ all: build/flexnbd build/flexnbd-proxy doc
|
|||||||
build/%.o: %.c
|
build/%.o: %.c
|
||||||
mkdir -p $(dir $@)
|
mkdir -p $(dir $@)
|
||||||
$(COMPILE) $< -o $@
|
$(COMPILE) $< -o $@
|
||||||
$(SAVEDEP) $< > build/$*.d
|
|
||||||
|
|
||||||
objs: $(OBJS)
|
objs: $(OBJS)
|
||||||
|
|
||||||
@@ -91,16 +86,13 @@ proxy: build/flexnbd-proxy
|
|||||||
|
|
||||||
|
|
||||||
CHECK_SRC := $(wildcard tests/unit/*.c)
|
CHECK_SRC := $(wildcard tests/unit/*.c)
|
||||||
CHECK_OBJ := $(CHECK_SRC:tests/unit/%.c=build/tests/%.o)
|
CHECK_OBJ := $(CHECK_SRC:tests/unit/%.c=build/%.o)
|
||||||
# Why can't we reuse the build/%.o rule above? Not sure.
|
# Why can't we reuse the build/%.o rule above? Not sure.
|
||||||
build/tests/%.o: tests/unit/%.c
|
|
||||||
mkdir -p $(dir $@)
|
|
||||||
$(COMPILE) $< -o $@
|
|
||||||
$(SAVEDEP) $< > build/tests/$*.d
|
|
||||||
|
|
||||||
CHECK_BINS := $(CHECK_OBJ:build/tests/%.o=build/tests/%)
|
CHECK_BINS := $(CHECK_SRC:tests/unit/%.c=build/%)
|
||||||
build/tests/%: build/tests/%.o $(OBJS)
|
|
||||||
$(LINK) $^ -o $@ -lcheck
|
build/check_%: build/check_%.o
|
||||||
|
$(LINK) $^ -o $@ $(COMMON_OBJ) -lcheck
|
||||||
|
|
||||||
check_objs: $(CHECK_OBJ)
|
check_objs: $(CHECK_OBJ)
|
||||||
|
|
||||||
@@ -117,7 +109,6 @@ build/flexnbd-proxy.1: README.proxy.txt
|
|||||||
%.1.gz: %.1
|
%.1.gz: %.1
|
||||||
gzip -c -f $< > $@
|
gzip -c -f $< > $@
|
||||||
|
|
||||||
|
|
||||||
server-man: build/flexnbd.1.gz
|
server-man: build/flexnbd.1.gz
|
||||||
proxy-man: build/flexnbd-proxy.1.gz
|
proxy-man: build/flexnbd-proxy.1.gz
|
||||||
|
|
||||||
@@ -132,3 +123,6 @@ clean:
|
|||||||
|
|
||||||
|
|
||||||
.PHONY: clean objs check_objs all server proxy check_bins check server-man proxy-man doc
|
.PHONY: clean objs check_objs all server proxy check_bins check server-man proxy-man doc
|
||||||
|
|
||||||
|
# Include extra dependencies at the end, NOT before 'all'
|
||||||
|
-include $(wildcard build/*.d)
|
||||||
|
@@ -4,7 +4,7 @@ require 'flexnbd/fake_dest'
|
|||||||
|
|
||||||
module ProxyTests
|
module ProxyTests
|
||||||
def b
|
def b
|
||||||
String.new("\xFF", encoding: "BINARY")
|
"\xFF".b
|
||||||
end
|
end
|
||||||
|
|
||||||
def with_proxied_client( override_size = nil )
|
def with_proxied_client( override_size = nil )
|
||||||
|
@@ -6,7 +6,7 @@ class TestServeMode < Test::Unit::TestCase
|
|||||||
|
|
||||||
def setup
|
def setup
|
||||||
super
|
super
|
||||||
@b = String.new("\xFF", encoding: "BINARY")
|
@b = "\xFF".b
|
||||||
@env = Environment.new
|
@env = Environment.new
|
||||||
@env.writefile1( "0" )
|
@env.writefile1( "0" )
|
||||||
@env.serve1
|
@env.serve1
|
||||||
|
Reference in New Issue
Block a user