Rizin
unix-like reverse engineering framework and cli tools
test-lz4-versions Namespace Reference

Functions

def proc (cmd_args, pipe=True, dummy=False)
 
def make (args, pipe=True)
 
def git (args, pipe=True)
 
def get_git_tags ()
 
def sha1_of_file (filepath)
 

Variables

string repo_url = 'https://github.com/lz4/lz4.git'
 
string tmp_dir_name = 'tests/versionsTest'
 
string make_cmd = 'make'
 
string git_cmd = 'git'
 
string test_dat_src = 'README.md'
 
string test_dat = 'test_dat'
 
string head = 'v999'
 
int error_code = 0
 
string base_dir = os.getcwd() + '/..'
 
string tmp_dir = base_dir + '/' + tmp_dir_name
 
string clone_dir = tmp_dir + '/' + 'lz4'
 
string programs_dir = base_dir + '/programs'
 
 exist_ok
 
list tags = [head] + get_git_tags()
 
string dst_lz4c = '{}/lz4c.{}' .format(tmp_dir, tag)
 
string dst_lz4c32 = '{}/lz4c32.{}'.format(tmp_dir, tag)
 
string r_dir = '{}/{}'.format(tmp_dir, tag)
 
 lz4s = sorted(glob.glob('*.lz4'))
 
 lz4t = lz4s[j]
 
 lz4
 
 end
 
 tag
 
 decs = glob.glob('*.dec')
 

Function Documentation

◆ get_git_tags()

def test-lz4-versions.get_git_tags ( )

Definition at line 43 of file test-lz4-versions.py.

43 def get_git_tags():
44  stdout, stderr = git(['tag', '-l', 'r[0-9][0-9][0-9]'])
45  tags = stdout.decode('utf-8').split()
46  stdout, stderr = git(['tag', '-l', 'v[1-9].[0-9].[0-9]'])
47  tags += stdout.decode('utf-8').split()
48  return tags
49 
50 # https://stackoverflow.com/a/19711609/2132223
def git(args, pipe=True)

References git().

◆ git()

def test-lz4-versions.git (   args,
  pipe = True 
)

Definition at line 40 of file test-lz4-versions.py.

40 def git(args, pipe=True):
41  return proc([git_cmd] + args, pipe)
42 

References proc().

Referenced by get_git_tags().

◆ make()

def test-lz4-versions.make (   args,
  pipe = True 
)

Definition at line 37 of file test-lz4-versions.py.

37 def make(args, pipe=True):
38  return proc([make_cmd] + args, pipe)
39 
def make(args, pipe=True)

References proc().

◆ proc()

def test-lz4-versions.proc (   cmd_args,
  pipe = True,
  dummy = False 
)

Definition at line 26 of file test-lz4-versions.py.

26 def proc(cmd_args, pipe=True, dummy=False):
27  if dummy:
28  return
29  if pipe:
30  subproc = subprocess.Popen(cmd_args,
31  stdout=subprocess.PIPE,
32  stderr=subprocess.PIPE)
33  else:
34  subproc = subprocess.Popen(cmd_args)
35  return subproc.communicate()
36 

Referenced by git(), and make().

◆ sha1_of_file()

def test-lz4-versions.sha1_of_file (   filepath)

Definition at line 51 of file test-lz4-versions.py.

51 def sha1_of_file(filepath):
52  with open(filepath, 'rb') as f:
53  return hashlib.sha1(f.read()).hexdigest()
54 
def sha1_of_file(filepath)

Variable Documentation

◆ base_dir

string test-lz4-versions.base_dir = os.getcwd() + '/..'

Definition at line 57 of file test-lz4-versions.py.

◆ clone_dir

string test-lz4-versions.clone_dir = tmp_dir + '/' + 'lz4'

Definition at line 59 of file test-lz4-versions.py.

◆ decs

test-lz4-versions.decs = glob.glob('*.dec')

Definition at line 144 of file test-lz4-versions.py.

◆ dst_lz4c

string test-lz4-versions.dst_lz4c = '{}/lz4c.{}' .format(tmp_dir, tag)

Definition at line 78 of file test-lz4-versions.py.

◆ dst_lz4c32

string test-lz4-versions.dst_lz4c32 = '{}/lz4c32.{}'.format(tmp_dir, tag)

Definition at line 79 of file test-lz4-versions.py.

◆ end

test-lz4-versions.end

Definition at line 136 of file test-lz4-versions.py.

◆ error_code

int test-lz4-versions.error_code = 0

Definition at line 56 of file test-lz4-versions.py.

Referenced by clusterRedirectClient(), getNodeByQuery(), and main().

◆ exist_ok

test-lz4-versions.exist_ok

Definition at line 61 of file test-lz4-versions.py.

◆ git_cmd

string test-lz4-versions.git_cmd = 'git'

Definition at line 21 of file test-lz4-versions.py.

◆ head

◆ lz4

test-lz4-versions.lz4

Definition at line 136 of file test-lz4-versions.py.

◆ lz4s

test-lz4-versions.lz4s = sorted(glob.glob('*.lz4'))

Definition at line 106 of file test-lz4-versions.py.

Referenced by LZ4_createStream(), and LZ4_createStreamDecode().

◆ lz4t

test-lz4-versions.lz4t = lz4s[j]

Definition at line 118 of file test-lz4-versions.py.

◆ make_cmd

string test-lz4-versions.make_cmd = 'make'

Definition at line 20 of file test-lz4-versions.py.

◆ programs_dir

string test-lz4-versions.programs_dir = base_dir + '/programs'

Definition at line 60 of file test-lz4-versions.py.

◆ r_dir

test-lz4-versions.r_dir = '{}/{}'.format(tmp_dir, tag)

Definition at line 82 of file test-lz4-versions.py.

◆ repo_url

string test-lz4-versions.repo_url = 'https://github.com/lz4/lz4.git'

Definition at line 18 of file test-lz4-versions.py.

◆ tag

◆ tags

list test-lz4-versions.tags = [head] + get_git_tags()

Definition at line 72 of file test-lz4-versions.py.

◆ test_dat

string test-lz4-versions.test_dat = 'test_dat'

Definition at line 23 of file test-lz4-versions.py.

◆ test_dat_src

string test-lz4-versions.test_dat_src = 'README.md'

Definition at line 22 of file test-lz4-versions.py.

◆ tmp_dir

test-lz4-versions.tmp_dir = base_dir + '/' + tmp_dir_name

Definition at line 58 of file test-lz4-versions.py.

◆ tmp_dir_name

string test-lz4-versions.tmp_dir_name = 'tests/versionsTest'

Definition at line 19 of file test-lz4-versions.py.