From ff3ba14154eedec7f3f1b29a403cc072ca6846c2 Mon Sep 17 00:00:00 2001 From: watercal Date: Wed, 17 Jun 2020 00:57:49 +1000 Subject: Fixing build on linux --- Makefile | 16 ++++++++++++++++ other/Makefile | 28 ---------------------------- tests/.gitignore | 4 ++++ tests/Makefile | 20 ++++++++++++++++++++ tests/ts-roundtrip.cpp | 2 +- tests/ts-snippets.cpp | 2 +- tests/ts-utf8.cpp | 2 +- 7 files changed, 43 insertions(+), 31 deletions(-) create mode 100644 Makefile delete mode 100644 other/Makefile create mode 100644 tests/Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d69ea94 --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +help: + @echo This makefile is just for the test program \(use \"make clean all test\"\) + @echo Just include the SimpleIni.h header file to use it. + +install: + @echo No install required. Just include the SimpleIni.h header file to use it. + +TOPTARGETS := all clean test + +SUBDIRS := tests + +$(TOPTARGETS): $(SUBDIRS) +$(SUBDIRS): + $(MAKE) -C $@ $(MAKECMDGOALS) + +.PHONY: $(TOPTARGETS) $(SUBDIRS) diff --git a/other/Makefile b/other/Makefile deleted file mode 100644 index a04b5e3..0000000 --- a/other/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -CC=g++ -CFLAGS=-Wall -CPPFLAGS=-Wall - -OBJS=testsi.o test1.o snippets.o ConvertUTF.o - -help: - @echo This makefile is just for the test program \(use \"make clean all test\"\) - @echo Just include the SimpleIni.h header file to use it. - -all: $(OBJS) - $(CC) -o testsi $(OBJS) - -clean: - rm -f core *.o testsi - -data: - sed 's/\r\n$$/\n/g' < test1-expected.ini > unix.out - mv unix.out test1-expected.ini - -test: testsi - ./testsi -u -m -l test1-input.ini > test1-blah.ini - diff test1-output.ini test1-expected.ini - -install: - @echo No install required. Just include the SimpleIni.h header file to use it. - -testsi.o test1.o snippets.o : SimpleIni.h diff --git a/tests/.gitignore b/tests/.gitignore index 51ade18..7bc89f0 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -1 +1,5 @@ example2.ini + +tests +*.o + diff --git a/tests/Makefile b/tests/Makefile new file mode 100644 index 0000000..ae3082e --- /dev/null +++ b/tests/Makefile @@ -0,0 +1,20 @@ +CC=g++ +CFLAGS=-Wall -std=c++11 +CPPFLAGS=-Wall -std=c++11 +LDFLAGS=-lpthread -lgtest -lgtest_main -lpthread -L/usr/lib + +OBJS=ts-roundtrip.o ts-snippets.o ts-utf8.o + +BIN=./tests + +all: $(OBJS) + $(CC) -o $(BIN) $(OBJS) $(LDFLAGS) + +clean: + rm -f core $(OBJS) $(BIN) + +test: $(BIN) + $(BIN) + +$(OBJS): ../SimpleIni.h + diff --git a/tests/ts-roundtrip.cpp b/tests/ts-roundtrip.cpp index 3808a08..d4e663a 100644 --- a/tests/ts-roundtrip.cpp +++ b/tests/ts-roundtrip.cpp @@ -4,7 +4,7 @@ class TestRoundTrip : public ::testing::Test { protected: - void TestRoundTrip::SetUp() override; + void SetUp() override; void TestMulti(); void TestBOM(bool useBOM); diff --git a/tests/ts-snippets.cpp b/tests/ts-snippets.cpp index d18150e..8814e0b 100644 --- a/tests/ts-snippets.cpp +++ b/tests/ts-snippets.cpp @@ -143,7 +143,7 @@ TEST(TestSnippets, TestGettingValues) { // output all of the items CSimpleIniA::TNamesDepend::const_iterator it; for (it = values.begin(); it != values.end(); ++it) { - printf("value = '%s'\n", it->pItem); + //printf("value = '%s'\n", it->pItem); } diff --git a/tests/ts-utf8.cpp b/tests/ts-utf8.cpp index 9208648..a463dc3 100644 --- a/tests/ts-utf8.cpp +++ b/tests/ts-utf8.cpp @@ -3,7 +3,7 @@ class TestUTF8 : public ::testing::Test { protected: - void TestUTF8::SetUp() override; + void SetUp() override; protected: CSimpleIniA ini; }; -- cgit v1.2.3