Skip to content

Commit

Permalink
Changed to DocTest UnitTesting Framework + fixed c++2a typo for compi…
Browse files Browse the repository at this point in the history
…ling unittests.
  • Loading branch information
alejandroarmas committed May 18, 2022
1 parent 3461e26 commit 42b4047
Show file tree
Hide file tree
Showing 7 changed files with 6,875 additions and 18,016 deletions.
26 changes: 9 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,32 +39,24 @@ UNIT_TESTING_MAIN_OBJ = $(addprefix ./unittests/obj/, $(notdir $(UNIT_TESTING_MA
-include $(OBJS:.o=.d)


%.o: %.cpp
$(CC) $(CPPFLAGS) -c $< -o $@

%.o: %.c
$(CC) $(CPPFLAGS) -c $< -o $@

matrix_multiply: $(OBJS)
$(CC) -o $@ $(CPPFLAGS) $(OBJS) $(LDFLAGS)

./unittests/obj/test_all.o: $(UNIT_TESTING_MAIN)
$(CC) -c $(CPPFLAGS) $(INCLUDE) -o $@ $<

run_unit_tests: $(UNIT_TESTING_MAIN_OBJ) $(UNIT_TESTS_CPP) $(DEPS_OBJS_FOR_UNIT_TESTING) $(OBJS_FOR_UNIT_TEST)
$(CC) -o $@ $^ $(LDFLAGS) $(LIBS)

# ./unittests/obj/%.o: ./unittests/%.cpp
# $(CC) $(CPPFLAGS) -c $< -o $@

%.d: %.c
@set -e; gcc -MM $(CPPFLAGS) $< \
| sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@;
@[ -s $@ ] || rm -f $@
run_unit_tests: $(UNIT_TESTING_MAIN_OBJ) $(UNIT_TESTS_CPP) $(OBJS_FOR_UNIT_TEST)
$(CC) $(CPPFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS)

%.d: %.cpp
@set -e; $(CC) -MM $(CPPFLAGS) $< \
| sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@;
@[ -s $@ ] || rm -f $@

%.o: %.cpp
$(CC) $(CPPFLAGS) -c $< -o $@

%.o: %.c
gcc $(CPPFLAGS) -c $< -o $@

clean:
rm -f matrix_multiply *.o *~ core.* *.d run_unit_tests unittests/obj/*.o
Loading

0 comments on commit 42b4047

Please sign in to comment.