Commit 954e0721 authored by Greg Williams's avatar Greg Williams
Browse files

Migrated building and execution of system tests completely to Make, and...

Migrated building and execution of system tests completely to Make, and removed corresponding support from Rake/Ceedling test build. Added test_system_getkeyrange.
parent 8d2752d8
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -10,3 +10,6 @@
	path = vendor/socket99
	url = https://github.com/silentbicycle/socket99.git
	branch = master
[submodule "vendor/unity"]
	path = vendor/unity
	url = https://github.com/ThrowTheSwitch/Unity.git
+88 −6
Original line number Diff line number Diff line
SHELL := /bin/bash

#===============================================================================
# Configuration of Shared Paths
#===============================================================================
@@ -64,9 +66,9 @@ KINETIC_LIB_OTHER_DEPS = Makefile Rakefile $(VERSION_FILE)
default: makedirs $(KINETIC_LIB)

makedirs:
	@echo; mkdir -p ./bin/examples &> /dev/null; mkdir -p ./out &> /dev/null
	@echo; mkdir -p ./bin/examples &> /dev/null; mkdir -p ./bin/systest &> /dev/null; mkdir -p ./out &> /dev/null

all: default test run examples
all: default test system_tests run examples

clean: makedirs
	rm -rf ./bin/**/*
@@ -202,7 +204,90 @@ start_simulator:
stop_simulator:
	./vendor/kinetic-simulator/stopSimulator.sh

.PHONY: update_simulator start_simulator erase_simulator stop_simulator
.PHONY: update_simulator erase_simulator stop_simulator



#===============================================================================
# System Tests
#===============================================================================

SYSTEST_SRC = ./test/system
SYSTEST_OUT = $(BIN_DIR)/systest
SYSTEST_LDFLAGS += -lm -l ssl $(KINETIC_LIB) -l crypto -l pthread
SYSTEST_WARN = -Wall -Wextra -Wstrict-prototypes -pedantic -Wno-missing-field-initializers -Werror=strict-prototypes
SYSTEST_CFLAGS += -std=c99 -fPIC -g $(SYSTEST_WARN) $(CDEFS) $(OPTIMIZE) -DTEST
UNITY_INC = ./vendor/unity/src
UNITY_SRC = ./vendor/unity/src/unity.c

systest_sources = $(wildcard $(SYSTEST_SRC)/*.c)
systest_executables = $(patsubst $(SYSTEST_SRC)/%.c,$(SYSTEST_OUT)/run_%,$(systest_sources))
systest_results = $(patsubst $(SYSTEST_OUT)/run_%,$(SYSTEST_OUT)/%.log,$(systest_executables))
systest_passfiles = $(patsubst $(SYSTEST_OUT)/run_%,$(SYSTEST_OUT)/%.testpass,$(systest_executables))
systest_names = $(patsubst $(SYSTEST_OUT)/run_%,%,$(systest_executables))

list_system_tests:
	echo $(systest_names)

$(SYSTEST_OUT)/%_runner.c: $(SYSTEST_SRC)/%.c
	./test/support/generate_test_runner.sh $< > $@

$(SYSTEST_OUT)/run_%: $(SYSTEST_SRC)/%.c $(SYSTEST_OUT)/%_runner.c $(KINETIC_LIB)
	@echo
	@echo ================================================================================
	@echo System test: '$<'
	@echo --------------------------------------------------------------------------------
	$(CC) -o $@ $< $(word 2,$^) ./test/support/system_test_fixture.c $(UNITY_SRC) $(SYSTEST_CFLAGS) $(LIB_INCS) -I$(UNITY_INC) -I./test/support $(SYSTEST_LDFLAGS) $(KINETIC_LIB)

$(SYSTEST_OUT)/%.testpass : $(SYSTEST_OUT)/run_%
	./scripts/runSystemTest.sh $*

$(systest_names) : % : $(SYSTEST_OUT)/%.testpass

# system_tests: start_simulator $(systest_results)
system_tests: start_simulator $(systest_passfiles)


# run_systest_%: $(SYSTEST_OUT)/%
# 	@echo
# 	@echo ================================================================================
# 	@echo Executing system test: '$<'
# 	@echo --------------------------------------------------------------------------------;
# 	$<
# 	@echo ================================================================================
# 	@echo
# 	./vendor/kinetic-simulator/stopSimulator.sh
# run_systest_%: start_simulator

# valgrind_systest_%: $(SYSTEST_OUT)/%
# 	@echo
# 	@echo ================================================================================
# 	@echo Executing system test: '$<'
# 	@echo --------------------------------------------------------------------------------;
# 	${VALGRIND} ${VALGRIND_ARGS} $<
# 	@echo ================================================================================
# 	@echo

# setup_system_tests: $(systest_executables) \
# 	build_system_tests

# system_tests: setup_system_tests \
# 	start_simulator \
# 	run_example_write_file_blocking \
# 	run_example_write_file_blocking_threads \
# 	run_example_write_file_nonblocking \
# 	run_example_write_file_nonblocking_threads \
# 	stop_simulator

# valgrind_system_tests: setup_system_tests \
# 	start_simulator \
# 	valgrind_example_write_file_blocking \
# 	valgrind_example_write_file_blocking_threads \
# 	valgrind_example_write_file_nonblocking \
# 	valgrind_example_write_file_nonblocking_threads \
# 	stop_simulator




#===============================================================================
@@ -265,9 +350,6 @@ VALGRIND_ARGS = --track-origins=yes #--leak-check=full
example_sources = $(wildcard $(EXAMPLE_SRC)/*.c)
example_executables = $(patsubst $(EXAMPLE_SRC)/%.c,$(BIN_DIR)/examples/%,$(example_sources))

list_examples:
	echo $(example_executables)

$(BIN_DIR)/examples/%: $(EXAMPLE_SRC)/%.c $(KINETIC_LIB)
	@echo
	@echo ================================================================================
+1 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ v0.9.0 (kinetic-protocol 3.0.5)
* Fixed bug with mutex locking causing an assert failure and subsequent crash.
* Fixed leaking of destroyed connections and they are now properly freed upon call to KineticClient_DestoryConnection().
* Fixed bug where some unrecoverable socket errors could cause retries when unintended.
* Modified PDU flow control in order not stall transmission on request PDUs when Value payload is empty or of small size.

v0.8.1 (kinetic-protocol 3.0.5)
-------------------------------
+1 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
  :test:
    - +:test/**
    - -:test/support
    - -:test/system
  :support:
    - test/support/**
  :source:
+6 −0
Original line number Diff line number Diff line
@@ -155,6 +155,12 @@
			"name": "kinetic-c - Build test utility",
			"working_dir": "${project_path}"
		},
    {
      "cmd": ["make", "${file_base_name}"],
      "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)",
      "name": "kinetic-c - Build and run system test",
      "working_dir": "${project_path}"
    },
		{
			"cmd": ["make", "run"],
			"file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)",
Loading