예제 #1
0
파일: build.py 프로젝트: rdavydov/pigz
def test_one_with_flag2(sha1_orig, suffix, flag1, flag2):
    pigz_exe = os.path.join("..", "rel", "pigz.exe")
    unpigz_exe = os.path.join("..", "rel", "unpigz.exe")
    util.run_cmd_throw(pigz_exe, flag1, flag2, "pigz.c")
    util.run_cmd_throw(pigz_exe, "-t", "pigz.c" + suffix)
    util.run_cmd_throw(unpigz_exe, "pigz.c" + suffix)
    assert sha1_orig == util.file_sha1("pigz.c")
예제 #2
0
파일: build.py 프로젝트: andschenk/pigz
def test_one_with_flag2(sha1_orig, suffix, flag1, flag2):
	pigz_exe = os.path.join("..", "rel", "pigz.exe")
	unpigz_exe = os.path.join("..", "rel", "unpigz.exe")
	util.run_cmd_throw(pigz_exe, flag1, flag2, "pigz.c")
	util.run_cmd_throw(pigz_exe, "-t", "pigz.c" + suffix)
	util.run_cmd_throw(unpigz_exe, "pigz.c" + suffix)
	assert sha1_orig == util.file_sha1("pigz.c")
예제 #3
0
def copy_file(srcDir, dstDir, moveFiles, fileName, dstDir2):
    srcPath = pj(srcDir, fileName)
    sha = file_sha1(srcPath)
    ext = os.path.splitext(fileName)[1].lower()
    dstPath = pj(dstDir, dstDir2, sha + ext)
    print("Copying %s to %s" % (srcPath, dstPath))
    if os.path.exists(dstPath):
        print("  %s already exists" % dstPath)
    else:
        shutil.copyfile(srcPath, dstPath)
    if moveFiles:
        print("  deleting %s" % srcPath)
        os.remove(srcPath)
    return sha
def copy_file(srcDir, dstDir, moveFiles, fileName, dstDir2):
	srcPath = pj(srcDir, fileName)
	sha = file_sha1(srcPath)
	ext = os.path.splitext(fileName)[1].lower()
	dstPath = pj(dstDir, dstDir2, sha + ext)
	print("Copying %s to %s" % (srcPath, dstPath))
	if os.path.exists(dstPath):
		print("  %s already exists" % dstPath)
	else:
		shutil.copyfile(srcPath, dstPath)
	if moveFiles:
		print("  deleting %s" % srcPath)
		os.remove(srcPath)
	return sha
예제 #5
0
파일: build.py 프로젝트: rdavydov/pigz
def test():
    cd_to_pigz()
    util.create_dir("pigz_test_tmp")
    shutil.copyfile("pigz.c", os.path.join("pigz_test_tmp", "pigz.c"))

    os.chdir("pigz_test_tmp")
    sha1_orig = util.file_sha1("pigz.c")
    test_one_with_flag(sha1_orig, ".gz", "-f")
    test_one_with_flag2(sha1_orig, ".gz", "-fb", "32")
    test_one_with_flag2(sha1_orig, ".gz", "-fp", "1")
    test_one_with_flag(sha1_orig, ".zz", "-fz")
    test_one_with_flag(sha1_orig, ".zip", "-fK")
    test_one_with_flag2(sha1_orig, ".gz", "-11", "-f")
    # TODO: more tests for stdin/stdout
    # TODO: compare with gzip/compress (if available in path)
    cd_to_pigz()
    rm_dirs(["pigz_test_tmp"])
예제 #6
0
파일: build.py 프로젝트: andschenk/pigz
def test():
	cd_to_pigz()
	util.create_dir("pigz_test_tmp")
	shutil.copyfile("pigz.c", os.path.join("pigz_test_tmp", "pigz.c"))

	os.chdir("pigz_test_tmp")
	sha1_orig = util.file_sha1("pigz.c")
	test_one_with_flag(sha1_orig, ".gz", "-f")
	test_one_with_flag2(sha1_orig, ".gz", "-fb", "32")
	test_one_with_flag2(sha1_orig, ".gz", "-fp", "1")
	test_one_with_flag(sha1_orig, ".zz", "-fz")
	test_one_with_flag(sha1_orig, ".zip", "-fK")
	test_one_with_flag2(sha1_orig, ".gz", "-11", "-f")
	# TODO: more tests for stdin/stdout
	# TODO: compare with gzip/compress (if available in path)
	cd_to_pigz()
	rm_dirs(["pigz_test_tmp"])