Commit 96a0683310d02c42dd3c7ee0650820e921b33884
1 parent
750adb4c
Exists in
master
Incluindo testes da biblioteca usando valgrind
Showing
3 changed files
with
31 additions
and
1 deletions
Show diff stats
latest/Makefile.in
@@ -57,6 +57,7 @@ TMPDIR=@TMPDIR@ | @@ -57,6 +57,7 @@ TMPDIR=@TMPDIR@ | ||
57 | INSTALL=@INSTALL@ | 57 | INSTALL=@INSTALL@ |
58 | INSTALL_EXE=$(INSTALL) --mode=755 | 58 | INSTALL_EXE=$(INSTALL) --mode=755 |
59 | INSTALL_DATA=$(INSTALL) --mode=644 | 59 | INSTALL_DATA=$(INSTALL) --mode=644 |
60 | +VALGRIND=/usr/bin/valgrind | ||
60 | 61 | ||
61 | MAKENSIS=@MAKENSIS@ | 62 | MAKENSIS=@MAKENSIS@ |
62 | 63 | ||
@@ -138,6 +139,19 @@ $(BINDIR)/Debug/lib/lib3270@DLLEXT@: src/lib/* | @@ -138,6 +139,19 @@ $(BINDIR)/Debug/lib/lib3270@DLLEXT@: src/lib/* | ||
138 | $(BINDIR)/Release/lib/lib3270@DLLEXT@: src/lib/* | 139 | $(BINDIR)/Release/lib/lib3270@DLLEXT@: src/lib/* |
139 | @$(MAKE) $(RLS_MAKE) -C src/lib $@ | 140 | @$(MAKE) $(RLS_MAKE) -C src/lib $@ |
140 | 141 | ||
142 | +testprogram@EXEEXT@: $(BINDIR)/Debug/lib/lib3270@DLLEXT@ src/lib/testprogram.c | ||
143 | + @$(CC) $(LIB3270_CFLAGS) -DDEBUG=1 -g -o $@ src/lib/testprogram.c -Wl,-rpath,.bin/Debug/lib $(LIB3270_DBGLIBS) | ||
144 | + | ||
145 | +libtest: testprogram@EXEEXT@ | ||
146 | + | ||
147 | +chklib: testprogram@EXEEXT@ | ||
148 | +ifeq ($(VALGRIND),no) | ||
149 | + @$(BINDBG)/testprogram@EXEEXT@ | ||
150 | +else | ||
151 | + @G_DEBUG=gc-friendly G_SLICE=always-malloc \$(VALGRIND) --leak-check=full ./testprogram@EXEEXT@ | ||
152 | +endif | ||
153 | + | ||
154 | + | ||
141 | #---[ Programs ]--------------------------------------------------------------- | 155 | #---[ Programs ]--------------------------------------------------------------- |
142 | 156 | ||
143 | $(BINDIR)/Debug/$(PACKAGE_NAME)@EXEEXT@: $(BINDIR)/Debug/lib/lib3270@DLLEXT@ src/gtk2/* | 157 | $(BINDIR)/Debug/$(PACKAGE_NAME)@EXEEXT@: $(BINDIR)/Debug/lib/lib3270@DLLEXT@ src/gtk2/* |
latest/pw3270.cbp
@@ -30,6 +30,17 @@ | @@ -30,6 +30,17 @@ | ||
30 | <Add option="-s" /> | 30 | <Add option="-s" /> |
31 | </Linker> | 31 | </Linker> |
32 | </Target> | 32 | </Target> |
33 | + <Target title="libtest"> | ||
34 | + <Option output="testprogram" prefix_auto="1" extension_auto="1" /> | ||
35 | + <Option object_output="obj/Debug/" /> | ||
36 | + <Option type="1" /> | ||
37 | + <Option compiler="gcc" /> | ||
38 | + <Option use_console_runner="0" /> | ||
39 | + <Option parameters="--program-data=. --model=5 --plugin-path=./bin/Debug/plugins" /> | ||
40 | + <Compiler> | ||
41 | + <Add option="-g" /> | ||
42 | + </Compiler> | ||
43 | + </Target> | ||
33 | </Build> | 44 | </Build> |
34 | <Compiler> | 45 | <Compiler> |
35 | <Add option="-Wall" /> | 46 | <Add option="-Wall" /> |
@@ -626,6 +637,10 @@ | @@ -626,6 +637,10 @@ | ||
626 | <Option compilerVar="CC" /> | 637 | <Option compilerVar="CC" /> |
627 | </Unit> | 638 | </Unit> |
628 | <Unit filename="src/lib/telnetc.h" /> | 639 | <Unit filename="src/lib/telnetc.h" /> |
640 | + <Unit filename="src/lib/testprogram.c"> | ||
641 | + <Option compilerVar="CC" /> | ||
642 | + <Option target="libtest" /> | ||
643 | + </Unit> | ||
629 | <Unit filename="src/lib/tn3270e.h" /> | 644 | <Unit filename="src/lib/tn3270e.h" /> |
630 | <Unit filename="src/lib/toggles.c"> | 645 | <Unit filename="src/lib/toggles.c"> |
631 | <Option compilerVar="CC" /> | 646 | <Option compilerVar="CC" /> |
@@ -701,6 +716,7 @@ | @@ -701,6 +716,7 @@ | ||
701 | <Unit filename="src/plugins/java/j3270plugin.c"> | 716 | <Unit filename="src/plugins/java/j3270plugin.c"> |
702 | <Option compilerVar="CC" /> | 717 | <Option compilerVar="CC" /> |
703 | <Option target="Debug" /> | 718 | <Option target="Debug" /> |
719 | + <Option target="libtest" /> | ||
704 | </Unit> | 720 | </Unit> |
705 | <Unit filename="src/plugins/pipectl/Makefile.in" /> | 721 | <Unit filename="src/plugins/pipectl/Makefile.in" /> |
706 | <Unit filename="src/plugins/pipectl/init.c"> | 722 | <Unit filename="src/plugins/pipectl/init.c"> |
latest/src/lib/Makefile.in
@@ -51,7 +51,7 @@ XGETTEXT = @XGETTEXT@ | @@ -51,7 +51,7 @@ XGETTEXT = @XGETTEXT@ | ||
51 | MSGCAT = @MSGCAT@ | 51 | MSGCAT = @MSGCAT@ |
52 | 52 | ||
53 | CFLAGS=@CFLAGS@ -DLIB3270=1 -I. -I$(SRCDIR)/include -I$(SRCDIR)/include/lib3270 | 53 | CFLAGS=@CFLAGS@ -DLIB3270=1 -I. -I$(SRCDIR)/include -I$(SRCDIR)/include/lib3270 |
54 | -DBG_CFLAGS=-DDEBUG=1 | 54 | +DBG_CFLAGS=-DDEBUG=1 -g |
55 | RLS_CFLAGS=-DNDEBUG=1 | 55 | RLS_CFLAGS=-DNDEBUG=1 |
56 | 56 | ||
57 | DLL_CFLAGS=@DLL_CFLAGS@ | 57 | DLL_CFLAGS=@DLL_CFLAGS@ |