mirror of
https://github.com/meekrosoft/fff
synced 2026-01-23 08:25:59 +01:00
Add googletest library and update makefiles
This commit is contained in:
@@ -2,12 +2,14 @@
|
||||
BUILD_DIR = ../build
|
||||
|
||||
CPP_OBJS += \
|
||||
$(BUILD_DIR)/fff_test_cpp.o
|
||||
$(BUILD_DIR)/fff_test_cpp.o \
|
||||
$(BUILD_DIR)/gtest-all.o \
|
||||
$(BUILD_DIR)/gtest-main.o
|
||||
|
||||
C_OBJS += \
|
||||
$(BUILD_DIR)/fff_test_c.o
|
||||
|
||||
LIBS := -lgtest_main -lgtest -lpthread
|
||||
LIBS := -lpthread
|
||||
|
||||
CPPNAME = $(BUILD_DIR)/fff_test_cpp
|
||||
CNAME = $(BUILD_DIR)/fff_test_c
|
||||
@@ -19,14 +21,14 @@ all: $(CPPNAME) $(CNAME)
|
||||
$(BUILD_DIR)/%.o: %.cpp
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: GCC C++ Compiler'
|
||||
g++ -I/home/mlong/tools/gtest/gtest-1.5.0/include -O0 -g3 -Wall -c -o"$@" "$<"
|
||||
g++ -I../ -O0 -g3 -Wall -c -o"$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
$(BUILD_DIR)/%.o: %.c
|
||||
@echo 'Building file: $<'
|
||||
@echo 'Invoking: GCC C++ Compiler'
|
||||
gcc -I/home/mlong/tools/gtest/gtest-1.5.0/include -O0 -g3 -Wall -std=c99 -c -o"$@" "$<"
|
||||
gcc -I../ -O0 -g3 -Wall -std=c99 -c -o"$@" "$<"
|
||||
@echo 'Finished building: $<'
|
||||
@echo ' '
|
||||
|
||||
@@ -35,14 +37,14 @@ $(BUILD_DIR)/%.o: %.c
|
||||
$(CPPNAME): $(CPP_OBJS)
|
||||
@echo 'Building target: $@'
|
||||
@echo 'Invoking: GCC C++ Linker'
|
||||
g++ -L/home/mlong/tools/gtest -o"$(CPPNAME)" $(CPP_OBJS) $(LIBS)
|
||||
g++ -o "$(CPPNAME)" $(CPP_OBJS) $(LIBS)
|
||||
@echo 'Finished building target: $@'
|
||||
@echo ' '
|
||||
|
||||
$(CNAME): $(C_OBJS)
|
||||
@echo 'Building target: $@'
|
||||
@echo 'Invoking: GCC C++ Linker'
|
||||
g++ -L/home/mlong/tools/gtest -o"$(CNAME)" $(C_OBJS) $(LIBS)
|
||||
g++ -o "$(CNAME)" $(C_OBJS) $(LIBS)
|
||||
@echo 'Finished building target: $@'
|
||||
@echo ' '
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#define OVERRIDE_CALL_HIST_LEN 17u
|
||||
#define FFF_CALL_HISTORY_LEN OVERRIDE_CALL_HIST_LEN
|
||||
|
||||
#include "../fff.h"
|
||||
#include "../fff3.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#define OVERRIDE_CALL_HIST_LEN 17u
|
||||
#define FFF_CALL_HISTORY_LEN OVERRIDE_CALL_HIST_LEN
|
||||
|
||||
#include "../fff.h"
|
||||
#include "../fff3.h"
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
FAKE_VOID_FUNC(voidfunc1, int);
|
||||
|
||||
Reference in New Issue
Block a user