Files
harbour-core/harbour/tests/test_all.prg
Viktor Szakats a6fbc56731 2012-06-04 11:28 UTC+0200 Viktor Szakats (harbour syenar.net)
* contrib/hbformat/hbfmtcls.prg
    + DispOutAt

  * contrib/hbnetio/utils/hbnetioq/netiosrq.prg
  * contrib/gtwvg/wvgclass.prg
  * contrib/gtwvg/wvgdlg.prg
  * contrib/gtwvg/wvgpaint.prg
  * contrib/gtwvg/wvgtoolb.prg
  * contrib/gtwvg/tests/wvgtbrowser.prg
  * contrib/gtwvg/tests/demoxbp.prg
  * contrib/gtwvg/tests/wvgxbp.prg
  * contrib/gtwvg/tests/wvgactivex.prg
  * contrib/gtwvg/wvgwnd.prg
  * contrib/gtwvg/wvgdatar.prg
  * contrib/gtwvg/wvgsysw.prg
  * contrib/gtwvg/wvgmenub.prg
  * contrib/gtwvg/wvgphdlr.prg
  * contrib/gtwvg/wvgbitmp.prg
  * contrib/gtwvg/wvgstatc.prg
  * contrib/xhb/decode.prg
  * contrib/xhb/ttable.prg
  * contrib/hbide/ideconsole.prg
  * tests/db_brows.prg
  * tests/inkeytst.prg
  * tests/ifinline.prg
  * tests/inifiles.prg
  * tests/test_all.prg
  * tests/fsplit.prg
    * '<>' -> '!=' or '!( == )'
      caught a few _SET_EXACT dependend code too.
2012-06-04 09:30:51 +00:00

75 lines
1.9 KiB
Plaintext

//NOTEST
/*
* $Id$
*/
/* AutoMatic Test Bank
Patrick Mast and David G. Holm
Compiler independent, but not platform independent (creates a DOS style batch file).
Specify the hbxxx batch file name to use to build with on the command line.
Defaults to "run_prg".
The test_all.bat batch file has restart capability. For example, if there is an error
in testgt.prg, find and fix the problem, then restart by running "TEST_ALL TESTGT".
*/
#include "directry.ch"
#include "fileio.ch"
FUNCTION Main( cOption, cCmd )
LOCAL aDir, f, n, o, p, cRead
SET DATE ANSI
SET CENTURY ON
aDir := Directory( "*.prg" )
o := FCreate( "test_all.bat" )
IF Empty( cOption )
cOption := "run_prg"
ENDIF
IF Empty( cCmd )
cCmd := "call "
ELSE
cCmd += " /c "
ENDIF
FWrite( o, "if not .%1==. goto %1" + Chr( 13 ) + Chr( 10 ) )
FOR f := 1 TO Len( aDir )
IF TestIt( aDir[ f ][ F_NAME ] )
p := At( ".prg", Lower( aDir[ f ][ F_NAME ] ) )
IF p > 1
n := Left( aDir[ f ][ F_NAME ], p - 1 )
FWrite( o, ":" + n + Chr( 13 ) + Chr( 10 ) )
FWrite( o, cCmd + cOption + " " + n + Chr( 13 ) + Chr( 10 ) +;
"if errorlevel 1 goto end" + Chr( 13 ) + Chr( 10 ) + Chr( 13 ) + Chr( 10 ) )
ENDIF
ENDIF
NEXT
FWrite( o, ":END" + Chr( 13 ) + Chr( 10 ) )
FClose( o )
RETURN NIL
FUNCTION TestIt( cFile )
LOCAL nH1, lRetu, nH2
nH1 := FOpen( cFile )
lRetu := !( Upper( FReadStr( nH1, 8 ) ) == "//NOTEST" )
FClose( nH1 )
IF ! lRetu
IF ! hb_FileExists( "NotTestd.txt" )
nH2 := FCreate( "nottestd.txt" )
ELSE
nH2 := FOpen( "nottestd.txt", FO_WRITE )
ENDIF
FSeek( nH2, 0, FS_END )
FWrite( nH2, DToC( Date() ) + " " + Time() + " " + cFile + Chr( 13 ) + Chr( 10 ) )
FClose( nH2 )
ENDIF
RETURN lRetu