Files
harbour-core/harbour/tests/test_all.prg
Viktor Szakats 35ad1b2ae4 2008-08-20 11:50 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* tests/onidle.prg
   * tests/codebloc.prg
   * tests/keywords.prg
   * tests/wvtext.prg
   * tests/test_all.prg
   * tests/ainstest.prg
   * doc/es/compiler.txt
   * doc/es/file.txt
   * contrib/hbct/numconv.prg
   * contrib/hbct/tests/expomant.prg
   * contrib/hbwhat32/whatutil.prg
   * contrib/hbwhat32/winrbar.prg
   * contrib/hbwhat32/wintabs.prg
   * contrib/hbwhat32/wincomm.prg
   * contrib/hbwhat32/wincdlg.prg
   * contrib/hbwhat32/wintbar.prg
   * contrib/hbwhat32/_wininet.c
   * contrib/hbwhat32/wincore.prg
   * contrib/hbw32/w32_ole.c
   * contrib/hbapollo/tests/apollo.prg
   * contrib/hbnf/dispmsg.prg
   * contrib/hbnf/fttext.c
   * contrib/hbnf/mouse1.prg
   * contrib/hbnf/menu1.prg
   * contrib/hbnf/sleep.prg
   * contrib/hbnf/xbox.prg
   * contrib/hbnf/popadder.prg
   * contrib/hbnf/mouse2.prg
   * contrib/hbnf/pchr.prg
   * contrib/hbhpdf/tests/harupdf.prg
   * contrib/gtwvg/wvgclass.prg
   * contrib/gtwvg/tests/demowvg.prg
   * contrib/gtwvg/wvgpaint.prg
   * contrib/rddads/tests/testmg.prg
   * contrib/hbclipsm/tests/testgaug.prg
   * contrib/hbfimage/tests/fitest.prg
   * contrib/hbmisc/twirler.prg
   * contrib/hbtip/httpcln.prg
   * contrib/hbtip/ftpcln.prg
   * contrib/hbvpdf/hbvpdft.prg
   * utils/hbmake/hbmake.prg
     * Some more general code cleanups.
     * iif(), quote char, #include, filename-casing, = usage cleanups, 
       hardcoded absolute paths, non-ASCII drawing chars in source.
       Using mixed-case filenames to #include .ch files breaks on 
       non-WinDOS platforms.
2008-08-20 09:56:47 +00:00

72 lines
1.7 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][1])
p := At(".prg",Lower(aDir[f][1]))
IF p > 1
n := Left(aDir[f][1],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 !File("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