Commit 3e8b7929 authored by Greg Williams's avatar Greg Williams
Browse files

Updated travis config to match newer config used in 'develop' branch.

Fixed kinetic_logger test.
Updated SublimeText project file to match 'develop' to get tests running from within SublimeText.
Updated Makefile to better support json-c integration, but did not tie into root install/uninstall tasks yet.
Merged in changes to ensure simulators are stopped before stopSimulator.sh script exits to prevent start/stop contention.
parent cbfcfc60
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ before_script:
  - sudo apt-get install -y gcc-4.8
  - if [ $CC == 'gcc' ]; then export CC=gcc-4.8; fi;
  - bundle install
script:
  - make clean
  - make start_simulator
script:
  - make all
+18 −10
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@ OPENSSL_PATH ?= .
CC ?= gcc
OPTIMIZE = -O3
SYSTEM_TEST_HOST ?= \"localhost\"
SESSION_HMAC_KEY ?= \"asdfasdf\"
SESSION_PIN ?= \"1234\"
WARN = -Wall -Wextra -Werror -Wstrict-prototypes -Wcast-align -pedantic -Wno-missing-field-initializers -Werror=strict-prototypes
CDEFS += -D_POSIX_C_SOURCE=199309L -D_C99_SOURCE=1 -DSYSTEM_TEST_HOST=${SYSTEM_TEST_HOST}
CFLAGS += -std=c99 -fPIC -g $(WARN) $(CDEFS) $(OPTIMIZE)
@@ -101,11 +103,11 @@ clean: makedirs update_git_submodules
	rm -rf ./bin/**/*
	rm -f $(OUT_DIR)/*.o $(OUT_DIR)/*.a *.core *.log
	bundle exec rake clobber
	-./vendor/kinetic-simulator/stopSimulator.sh &> /dev/null;
	# -./vendor/kinetic-simulator/stopSimulator.sh &> /dev/null;
	cd ${SOCKET99} && make clean
	cd ${LIB_DIR}/threadpool && make clean
	cd ${LIB_DIR}/bus && make clean
	# cd ${JSONC} && make clean --- make clean task does NOT exist
	if [ -f ${JSONC}/Makefile ]; then cd ${JSONC} && make clean; fi;

update_git_submodules:
	git submodule update --init
@@ -145,7 +147,7 @@ $(OUT_DIR)/%.o: ${LIB_DIR}/bus/%.c ${LIB_DIR}/bus/%.h
${OUT_DIR}/*.o: src/lib/kinetic_types_internal.h


ci: uninstall all stop_simulator test_internals install
ci: uninstall stop_simulator start_simulator all stop_simulator install uninstall
	@echo
	@echo --------------------------------------------------------------------------------
	@echo $(PROJECT) build completed successfully!
@@ -160,6 +162,15 @@ ci: uninstall all stop_simulator test_internals install

json: ${OUT_DIR}/libjson-c.a

json_install: json
	cd ${JSONC} && \
	make install

json_uninstall:
	if [ -f ${JSONC}/Makefile ]; then cd ${JSONC} && make uninstall; fi;

.PHONY: json_install json_uninstall

${JSONC}/Makefile:
	cd ${JSONC} && \
	sh autogen.sh && \
@@ -237,7 +248,6 @@ $(KINETIC_SO_DEV): $(LIB_OBJS) $(KINETIC_LIB_OTHER_DEPS)
# Installation Support
#-------------------------------------------------------------------------------

API_NAME = kinetic_client
INSTALL ?= install
RM ?= rm

@@ -250,7 +260,7 @@ install: $(KINETIC_LIB) $(KINETIC_SO_DEV)
	$(INSTALL) -d $(PREFIX)${LIBDIR}
	$(INSTALL) -c $(KINETIC_LIB) $(PREFIX)${LIBDIR}/
	$(INSTALL) -d $(PREFIX)/include/
	$(INSTALL) -c $(PUB_INC)/$(API_NAME).h $(PREFIX)/include/
	$(INSTALL) -c $(PUB_INC)/$kinetic_client.h $(PREFIX)/include/
	$(INSTALL) -c $(PUB_INC)/kinetic_types.h $(PREFIX)/include/
	$(INSTALL) -c $(PUB_INC)/kinetic_semaphore.h $(PREFIX)/include/
	$(INSTALL) -c $(PUB_INC)/byte_array.h $(PREFIX)/include/
@@ -263,7 +273,7 @@ uninstall:
	@echo
	$(RM) -f $(PREFIX)${LIBDIR}/lib$(PROJECT)*.a
	$(RM) -f $(PREFIX)${LIBDIR}/lib$(PROJECT)*.so
	$(RM) -f $(PREFIX)/include/${API_NAME}.h
	$(RM) -f $(PREFIX)/include/kinetic_client.h
	$(RM) -f $(PREFIX)/include/kinetic_types.h
	$(RM) -f $(PREFIX)/include/kinetic_semaphore.h
	$(RM) -f $(PREFIX)/include/byte_array.h
@@ -384,8 +394,6 @@ discovery_utility: $(DISCOVERY_UTIL_EXEC)
build: discovery_utility




#-------------------------------------------------------------------------------
# Support for Simulator and Exection of Test Utility
#-------------------------------------------------------------------------------
@@ -460,7 +468,7 @@ examples: setup_examples \
	run_example_write_file_blocking \
	run_example_write_file_blocking_threads \
	run_example_write_file_nonblocking \
	run_example_get_key_range \
	run_example_get_key_range

valgrind_examples: setup_examples \
	valgrind_put_nonblocking \
@@ -468,4 +476,4 @@ valgrind_examples: setup_examples \
	valgrind_example_write_file_blocking \
	valgrind_example_write_file_blocking_threads \
	valgrind_example_write_file_nonblocking \
	valgrind_example_get_key_range \
	valgrind_example_get_key_range
+183 −154
Original line number Diff line number Diff line
{
	"build_systems":
	[
		{
			"cmd": "make",
			"file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)",
			"name": "kinetic-c - Default Build",
			"working_dir": "${project_path}",
			"path": "/usr/local/bin:/usr/local/sbin:/usr/bin:/Users/greg/bin:~/.local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin",
		},
		{
			"cmd":
			[
				"make",
				"test"
			],
			"file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)",
			"name": "kinetic-c - Run all tests (full)",
			"working_dir": "${project_path}",
			"path": "/usr/local/bin:/usr/local/sbin:/usr/bin:/Users/greg/bin:~/.local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin",
		},
		{
			"cmd":
			[
				"rake",
				"CC=gcc-4.8",
				"test:${file_name}"
			],
			"file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)",
			"name": "kinetic-c - Test current module",
			"selector":
			[
				"source.c",
				"source.c++"
			],
			"working_dir": "${project_path}",
			"path": "/usr/local/bin:/usr/local/sbin:/usr/bin:/Users/greg/bin:~/.local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin",
		},
		{
			"cmd":
			[
				"make",
				"utility"
			],
			"file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)",
			"name": "kinetic-c - Build test utility",
			"working_dir": "${project_path}",
			"path": "/usr/local/bin:/usr/local/sbin:/usr/bin:/Users/greg/bin:~/.local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin",
		},
		{
			"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}",
			"path": "/usr/local/bin:/usr/local/sbin:/usr/bin:/Users/greg/bin:~/.local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin",
		},
		{
			"cmd":
			[
				"make",
				"run"
			],
			"file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)",
			"name": "kinetic-c - Build and run test utility",
			"working_dir": "${project_path}",
			"path": "/usr/local/bin:/usr/local/sbin:/usr/bin:/Users/greg/bin:~/.local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin",
		},
		{
			"cmd":
			[
				"make",
				"examples"
			],
			"file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)",
			"name": "kinetic-c - Build and run examples",
			"working_dir": "${project_path}",
			"path": "/usr/local/bin:/usr/local/sbin:/usr/bin:/Users/greg/bin:~/.local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin",
		},
		{
			"cmd":
			[
				"make",
				"all"
			],
			"file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)",
			"name": "kinetic-c - Full CI build",
			"working_dir": "${project_path}",
			"path": "/usr/local/bin:/usr/local/sbin:/usr/bin:/Users/greg/bin:~/.local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin",
		}
	],
	"folders":
	[
		{
      "follow_symlinks": true,
      "path": ".",
      "folder_exclude_patterns": ["build", "vendor/bundle"],
      "binary_file_patterns": ["build"]
			"folder_exclude_patterns":
			[
				"build",
				"vendor/bundle"
			],
			"path": "."
		}
	],
	"settings":
@@ -73,16 +168,6 @@
			"build"
		],
		"index_files": true,
    // "rulers":
    // [
    //  80,
    //  100
    // ],
    "tab_size": 4,
    "translate_tabs_to_spaces": true,
    "trim_automatic_white_space": true,
    "word_wrap": "true",
    "wrap_width": 0,
		"sublimeclang_dont_prepend_clang_includes": true,
		"sublimeclang_options":
		[
@@ -105,80 +190,24 @@
			"-Wno-missing-field-initializers",
			"-O",
			"-xc",
      "-isystem", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/",
      // "-isystem", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/c++/4.2.1",
      // "-isystem", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/c++/4.2.1/tr1",
      "-isystem", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers",

			"-isystem",
			"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/",
			"-isystem",
			"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers",
			"-I${folder:${project_path:kinetic-c.sublime-project}}/src/**",
			"-I${folder:${project_path:kinetic-c.sublime-project}}/include",
			"-I${folder:${project_path:kinetic-c.sublime-project}}/test/**",
      // "-I${folder:${project_path:kinetic-c.sublime-project}}/vendor/**",
			"-I${folder:${project_path:kinetic-c.sublime-project}}/vendor/protobuf-c",
			"-I${folder:${project_path:kinetic-c.sublime-project}}/vendor/socket99",
			"-I${folder:${project_path:kinetic-c.sublime-project}}/vendor/bundle/ruby/2.0.0/gems/ceedling-0.15.6/vendor/unity/src",
			"-I${folder:${project_path:kinetic-c.sublime-project}}/build/test/mocks",
			"-I${folder:${project_path:kinetic-c.sublime-project}}/test/support/stubs",
			"-I${folder:${project_path:kinetic-c.sublime-project}}/test/support"
    ]
  },
	"build_systems":
	[
		{
			"cmd": "make",
			"file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)",
			"name": "kinetic-c - Default Build",
			"working_dir": "${project_path}"
		},
		{
			"cmd": ["make", "test"],
			"file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)",
			"name": "kinetic-c - Run all tests (full)",
			"working_dir": "${project_path}"
		},
		{
			"cmd": ["rake", "CC=/usr/bin/CC", "test:${file_name}"],
			"file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)",
			"name": "kinetic-c - Test current module w/Clang",
			"selector": ["source.c", "source.c++"],
			"working_dir": "${project_path}"
		},
		{
			"cmd": ["rake", "CC=gcc-4.9", "test:${file_name}"],
			"file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)",
			"name": "kinetic-c - Test current module w/GCC",
			"selector": ["source.c", "source.c++"],
			"working_dir": "${project_path}"
		},
		{
			"cmd": ["make", "utility"],
			"file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)",
			"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]*)",
			"name": "kinetic-c - Build and run test utility",
			"working_dir": "${project_path}"
		},
    {
      "cmd": ["make", "examples"],
      "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)",
      "name": "kinetic-c - Build and run examples",
      "working_dir": "${project_path}"
    },
		{
			"cmd": ["make", "all"],
			"file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)",
			"name": "kinetic-c - Full CI build",
			"working_dir": "${project_path}"
		],
		"tab_size": 4,
		"translate_tabs_to_spaces": true,
		"trim_automatic_white_space": true,
		"word_wrap": "true",
		"wrap_width": 0
	}
	]
}
+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@
#define KINETIC_LOGGER_SLEEP_TIME_SEC 10
#define KINETIC_LOGGER_BUFFER_FLUSH_SIZE (0.8 * KINETIC_LOGGER_BUFFER_SIZE)

static int KineticLogLevel = -1;
STATIC int KineticLogLevel = -1;
static FILE* KineticLoggerHandle = NULL;
static pthread_mutex_t KineticLoggerBufferMutex = PTHREAD_MUTEX_INITIALIZER;
static char KineticLoggerBuffer[KINETIC_LOGGER_BUFFER_SIZE][KINETIC_LOGGER_BUFFER_STR_MAX_LEN];
+0 −1
Original line number Diff line number Diff line
@@ -384,4 +384,3 @@ static void op_finished(KineticCompletionData* kinetic_data, void* clientData)
    // Signal that we're done
    KineticSemaphore_Signal(op_status->sem);
}
Loading