Commit 96a0683310d02c42dd3c7ee0650820e921b33884

Authored by perry.werneck@gmail.com
1 parent 750adb4c
Exists in master

Incluindo testes da biblioteca usando valgrind

latest/Makefile.in
... ... @@ -57,6 +57,7 @@ TMPDIR=@TMPDIR@
57 57 INSTALL=@INSTALL@
58 58 INSTALL_EXE=$(INSTALL) --mode=755
59 59 INSTALL_DATA=$(INSTALL) --mode=644
  60 +VALGRIND=/usr/bin/valgrind
60 61  
61 62 MAKENSIS=@MAKENSIS@
62 63  
... ... @@ -138,6 +139,19 @@ $(BINDIR)/Debug/lib/lib3270@DLLEXT@: src/lib/*
138 139 $(BINDIR)/Release/lib/lib3270@DLLEXT@: src/lib/*
139 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 155 #---[ Programs ]---------------------------------------------------------------
142 156  
143 157 $(BINDIR)/Debug/$(PACKAGE_NAME)@EXEEXT@: $(BINDIR)/Debug/lib/lib3270@DLLEXT@ src/gtk2/*
... ...
latest/pw3270.cbp
... ... @@ -30,6 +30,17 @@
30 30 <Add option="-s" />
31 31 </Linker>
32 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 44 </Build>
34 45 <Compiler>
35 46 <Add option="-Wall" />
... ... @@ -626,6 +637,10 @@
626 637 <Option compilerVar="CC" />
627 638 </Unit>
628 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 644 <Unit filename="src/lib/tn3270e.h" />
630 645 <Unit filename="src/lib/toggles.c">
631 646 <Option compilerVar="CC" />
... ... @@ -701,6 +716,7 @@
701 716 <Unit filename="src/plugins/java/j3270plugin.c">
702 717 <Option compilerVar="CC" />
703 718 <Option target="Debug" />
  719 + <Option target="libtest" />
704 720 </Unit>
705 721 <Unit filename="src/plugins/pipectl/Makefile.in" />
706 722 <Unit filename="src/plugins/pipectl/init.c">
... ...
latest/src/lib/Makefile.in
... ... @@ -51,7 +51,7 @@ XGETTEXT = @XGETTEXT@
51 51 MSGCAT = @MSGCAT@
52 52  
53 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 55 RLS_CFLAGS=-DNDEBUG=1
56 56  
57 57 DLL_CFLAGS=@DLL_CFLAGS@
... ...