Example #1
0
#!/usr/bin/env python

import pingphp 
import os
import glob2
import logging

os.chdir('./test')
pingphp.run()

files = glob2.glob('dest/test/**/*.php')

from pingphp.helper import read

for filePath in files:
    stdFilePath = 'std-' + filePath
    fileContent = read(filePath)
    fileContentStd = read(stdFilePath)
    if fileContent != fileContentStd:
        logging.error('Compare file: %s to %s not same\a', filePath, stdFilePath)
        exit(1)
    logging.info('Compare file: %s to %s same', filePath, stdFilePath)
Example #2
0
#!/usr/bin/env python

import sys
from pingphp.helper import read
from pingphp.lexer import PingLexer

filename = './test/test/'

if len(sys.argv)>1:
    filename += sys.argv[1]
else:
    print('Please input filename!')
    exit(1)

lexer = PingLexer(read(filename))

for item in lexer:
    print(item)
Example #3
0
#!/usr/bin/env python

import pingphp
import os
import glob2
import logging

os.chdir('./test')
pingphp.run()

files = glob2.glob('dest/test/**/*.php')

from pingphp.helper import read

for filePath in files:
    stdFilePath = 'std-' + filePath
    fileContent = read(filePath)
    fileContentStd = read(stdFilePath)
    if fileContent != fileContentStd:
        logging.error('Compare file: %s to %s not same\a', filePath,
                      stdFilePath)
        exit(1)
    logging.info('Compare file: %s to %s same', filePath, stdFilePath)
Example #4
0
#!/usr/bin/env python

import sys
from pingphp.helper import read
from pingphp.lexer import PingLexer

filename = './test/test/'

if len(sys.argv) > 1:
    filename += sys.argv[1]
else:
    print('Please input filename!')
    exit(1)

lexer = PingLexer(read(filename))

for item in lexer:
    print(item)