60a0ce6f98
# Conflicts: # msvc/_msvc_filters.py # msvc/_msvc_project.py # msvc/_msvc_solution.py # msvc/cfg.h # msvc/check_config.bat # msvc/g2y.py # msvc/gen_config_h.bat # msvc/gen_mpir_h.bat # msvc/gen_test_config_props.bat # msvc/getopt.c # msvc/getopt.h # msvc/getrusage.c # msvc/getrusage.h # msvc/gettimeofday.c # msvc/gettimeofday.h # msvc/mpir_config.py # msvc/mpir_config.pyproj # msvc/mpir_config.sln # msvc/mpir_debug_dll.props # msvc/mpir_debug_lib.props # msvc/mpir_release_dll.props # msvc/mpir_release_lib.props # msvc/obsolete.c # msvc/out_copy_rename.bat # msvc/postbuild.bat # msvc/prebuild.bat # msvc/run-tests.py # msvc/unistd.h # msvc/vs13/dll_mpir_gc/dll_mpir_gc.vcxproj.filters # msvc/vs13/lib_mpir_cxx/lib_mpir_cxx.vcxproj # msvc/vs13/lib_mpir_cxx/lib_mpir_cxx.vcxproj.filters # msvc/vs13/lib_mpir_gc/lib_mpir_gc.vcxproj.filters # msvc/vs13/mpir-tests.sln # msvc/vs13/mpir-tune.sln # msvc/vs13/msbuild.bat # msvc/vs13/run-speed.py # msvc/vs13/run-tests.py # msvc/vs13/version_info.py # msvc/vs17/dll_mpir_gc/dll_mpir_gc.vcxproj.filters # msvc/vs17/lib_mpir_cxx/lib_mpir_cxx.vcxproj # msvc/vs17/lib_mpir_cxx/lib_mpir_cxx.vcxproj.filters # msvc/vs17/lib_mpir_gc/lib_mpir_gc.vcxproj.filters # msvc/vs17/mpir-tests.sln # msvc/vs17/mpir-tests/add-test-lib/add-test-lib.vcxproj # msvc/vs17/mpir-tests/add-test-lib/add-test-lib.vcxproj.filters # msvc/vs17/mpir-tests/cxx.assign/cxx.assign.vcxproj # msvc/vs17/mpir-tests/cxx.binary/cxx.binary.vcxproj # msvc/vs17/mpir-tests/cxx.cast/cxx.cast.vcxproj # msvc/vs17/mpir-tests/cxx.constr/cxx.constr.vcxproj # msvc/vs17/mpir-tests/cxx.istream/cxx.istream.vcxproj # msvc/vs17/mpir-tests/f.adjust/f.adjust.vcxproj # msvc/vs17/mpir-tests/f.adjust_sqrt2/f.adjust_sqrt2.vcxproj # msvc/vs17/mpir-tests/f.butterfly/f.butterfly.vcxproj # msvc/vs17/mpir-tests/f.butterfly_lshb/f.butterfly_lshb.vcxproj # msvc/vs17/mpir-tests/f.butterfly_rshb/f.butterfly_rshb.vcxproj # msvc/vs17/mpir-tests/f.butterfly_sqrt2/f.butterfly_sqrt2.vcxproj # msvc/vs17/mpir-tests/f.butterfly_twiddle/f.butterfly_twiddle.vcxproj # msvc/vs17/mpir-tests/f.div_2expmod_2expp1/f.div_2expmod_2expp1.vcxproj # msvc/vs17/mpir-tests/f.fft_ifft_mfa_trunc_sqrt2/f.fft_ifft_mfa_trunc_sqrt2.vcxproj # msvc/vs17/mpir-tests/f.fft_ifft_negacyclic/f.fft_ifft_negacyclic.vcxproj # msvc/vs17/mpir-tests/f.fft_ifft_radix2/f.fft_ifft_radix2.vcxproj # msvc/vs17/mpir-tests/f.fft_ifft_trunc/f.fft_ifft_trunc.vcxproj # msvc/vs17/mpir-tests/f.fft_ifft_trunc_sqrt2/f.fft_ifft_trunc_sqrt2.vcxproj # msvc/vs17/mpir-tests/f.mul_2expmod_2expp1/f.mul_2expmod_2expp1.vcxproj # msvc/vs17/mpir-tests/f.mul_fft_main/f.mul_fft_main.vcxproj # msvc/vs17/mpir-tests/f.mul_mfa_trunc_sqrt2/f.mul_mfa_trunc_sqrt2.vcxproj # msvc/vs17/mpir-tests/f.mul_trunc_sqrt2/f.mul_trunc_sqrt2.vcxproj # msvc/vs17/mpir-tests/f.mulmod_2expp1/f.mulmod_2expp1.vcxproj # msvc/vs17/mpir-tests/f.normmod_2expp1/f.normmod_2expp1.vcxproj # msvc/vs17/mpir-tests/f.split_combine_bits/f.split_combine_bits.vcxproj # msvc/vs17/mpir-tests/misc.printf/misc.printf.vcxproj # msvc/vs17/mpir-tests/misc.scanf/misc.scanf.vcxproj # msvc/vs17/mpir-tests/mpf.add/mpf.add.vcxproj # msvc/vs17/mpir-tests/mpf.cmp_d/mpf.cmp_d.vcxproj # msvc/vs17/mpir-tests/mpf.cmp_si/mpf.cmp_si.vcxproj # msvc/vs17/mpir-tests/mpf.conv/mpf.conv.vcxproj # msvc/vs17/mpir-tests/mpf.div/mpf.div.vcxproj # msvc/vs17/mpir-tests/mpf.dm2exp/mpf.dm2exp.vcxproj # msvc/vs17/mpir-tests/mpf.eq/mpf.eq.vcxproj # msvc/vs17/mpir-tests/mpf.fits/mpf.fits.vcxproj # msvc/vs17/mpir-tests/mpf.get_d/mpf.get_d.vcxproj # msvc/vs17/mpir-tests/mpf.get_d_2exp/mpf.get_d_2exp.vcxproj # msvc/vs17/mpir-tests/mpf.get_si/mpf.get_si.vcxproj # msvc/vs17/mpir-tests/mpf.get_ui/mpf.get_ui.vcxproj # msvc/vs17/mpir-tests/mpf.gsprec/mpf.gsprec.vcxproj # msvc/vs17/mpir-tests/mpf.inp_str/mpf.inp_str.vcxproj # msvc/vs17/mpir-tests/mpf.int_p/mpf.int_p.vcxproj # msvc/vs17/mpir-tests/mpf.mul_ui/mpf.mul_ui.vcxproj # msvc/vs17/mpir-tests/mpf.muldiv/mpf.muldiv.vcxproj # msvc/vs17/mpir-tests/mpf.reuse/mpf.reuse.vcxproj # msvc/vs17/mpir-tests/mpf.set/mpf.set.vcxproj # msvc/vs17/mpir-tests/mpf.set_q/mpf.set_q.vcxproj # msvc/vs17/mpir-tests/mpf.set_si/mpf.set_si.vcxproj # msvc/vs17/mpir-tests/mpf.set_ui/mpf.set_ui.vcxproj # msvc/vs17/mpir-tests/mpf.sqrt/mpf.sqrt.vcxproj # msvc/vs17/mpir-tests/mpf.sqrt_ui/mpf.sqrt_ui.vcxproj # msvc/vs17/mpir-tests/mpf.sub/mpf.sub.vcxproj # msvc/vs17/mpir-tests/mpf.trunc/mpf.trunc.vcxproj # msvc/vs17/mpir-tests/mpf.ui_div/mpf.ui_div.vcxproj # msvc/vs17/mpir-tests/mpn.addadd_n/mpn.addadd_n.vcxproj # msvc/vs17/mpir-tests/mpn.addsub_n/mpn.addsub_n.vcxproj # msvc/vs17/mpir-tests/mpn.aors_1/mpn.aors_1.vcxproj # msvc/vs17/mpir-tests/mpn.asmtype/mpn.asmtype.vcxproj # msvc/vs17/mpir-tests/mpn.dc_div_q/mpn.dc_div_q.vcxproj # msvc/vs17/mpir-tests/mpn.dc_div_qr/mpn.dc_div_qr.vcxproj # msvc/vs17/mpir-tests/mpn.dc_div_qr_n/mpn.dc_div_qr_n.vcxproj # msvc/vs17/mpir-tests/mpn.dc_divappr_q/mpn.dc_divappr_q.vcxproj # msvc/vs17/mpir-tests/mpn.divebyff/mpn.divebyff.vcxproj # msvc/vs17/mpir-tests/mpn.divebyfobm1/mpn.divebyfobm1.vcxproj # msvc/vs17/mpir-tests/mpn.divrem_1/mpn.divrem_1.vcxproj # msvc/vs17/mpir-tests/mpn.gcdext/mpn.gcdext.vcxproj # msvc/vs17/mpir-tests/mpn.get_d/mpn.get_d.vcxproj # msvc/vs17/mpir-tests/mpn.hgcd/mpn.hgcd.vcxproj # msvc/vs17/mpir-tests/mpn.instrument/mpn.instrument.vcxproj # msvc/vs17/mpir-tests/mpn.inv_divappr_q/mpn.inv_divappr_q.vcxproj # msvc/vs17/mpir-tests/mpn.invert/mpn.invert.vcxproj # msvc/vs17/mpir-tests/mpn.iord_u/mpn.iord_u.vcxproj # msvc/vs17/mpir-tests/mpn.logic/mpn.logic.vcxproj # msvc/vs17/mpir-tests/mpn.lorrshift1/mpn.lorrshift1.vcxproj # msvc/vs17/mpir-tests/mpn.matrix22/mpn.matrix22.vcxproj # msvc/vs17/mpir-tests/mpn.mp_bases/mpn.mp_bases.vcxproj # msvc/vs17/mpir-tests/mpn.mullow_basecase/mpn.mullow_basecase.vcxproj # msvc/vs17/mpir-tests/mpn.mullowhigh/mpn.mullowhigh.vcxproj # msvc/vs17/mpir-tests/mpn.mulmid/mpn.mulmid.vcxproj # msvc/vs17/mpir-tests/mpn.mulmod_2expm1/mpn.mulmod_2expm1.vcxproj # msvc/vs17/mpir-tests/mpn.neg/mpn.neg.vcxproj # msvc/vs17/mpir-tests/mpn.perfsqr/mpn.perfsqr.vcxproj # msvc/vs17/mpir-tests/mpn.redc_1/mpn.redc_1.vcxproj # msvc/vs17/mpir-tests/mpn.sb_div_q/mpn.sb_div_q.vcxproj # msvc/vs17/mpir-tests/mpn.sb_div_qr/mpn.sb_div_qr.vcxproj # msvc/vs17/mpir-tests/mpn.sb_divappr_q/mpn.sb_divappr_q.vcxproj # msvc/vs17/mpir-tests/mpn.scan/mpn.scan.vcxproj # msvc/vs17/mpir-tests/mpn.sizeinbase/mpn.sizeinbase.vcxproj # msvc/vs17/mpir-tests/mpn.subadd_n/mpn.subadd_n.vcxproj # msvc/vs17/mpir-tests/mpn.tdiv_q/mpn.tdiv_q.vcxproj # msvc/vs17/mpir-tests/mpq.aors/mpq.aors.vcxproj # msvc/vs17/mpir-tests/mpq.cmp/mpq.cmp.vcxproj # msvc/vs17/mpir-tests/mpq.cmp_si/mpq.cmp_si.vcxproj # msvc/vs17/mpir-tests/mpq.cmp_ui/mpq.cmp_ui.vcxproj # msvc/vs17/mpir-tests/mpq.equal/mpq.equal.vcxproj # msvc/vs17/mpir-tests/mpq.get_d/mpq.get_d.vcxproj # msvc/vs17/mpir-tests/mpq.get_str/mpq.get_str.vcxproj # msvc/vs17/mpir-tests/mpq.inp_str/mpq.inp_str.vcxproj # msvc/vs17/mpir-tests/mpq.md_2exp/mpq.md_2exp.vcxproj # msvc/vs17/mpir-tests/mpq.set_f/mpq.set_f.vcxproj # msvc/vs17/mpir-tests/mpq.set_str/mpq.set_str.vcxproj # msvc/vs17/mpir-tests/mpz.addsub/mpz.addsub.vcxproj # msvc/vs17/mpir-tests/mpz.aorsmul/mpz.aorsmul.vcxproj # msvc/vs17/mpir-tests/mpz.bin/mpz.bin.vcxproj # msvc/vs17/mpir-tests/mpz.bit/mpz.bit.vcxproj # msvc/vs17/mpir-tests/mpz.cdiv_ui/mpz.cdiv_ui.vcxproj # msvc/vs17/mpir-tests/mpz.cmp/mpz.cmp.vcxproj # msvc/vs17/mpir-tests/mpz.cmp_d/mpz.cmp_d.vcxproj # msvc/vs17/mpir-tests/mpz.cmp_si/mpz.cmp_si.vcxproj # msvc/vs17/mpir-tests/mpz.cong/mpz.cong.vcxproj # msvc/vs17/mpir-tests/mpz.cong_2exp/mpz.cong_2exp.vcxproj # msvc/vs17/mpir-tests/mpz.convert/mpz.convert.vcxproj # msvc/vs17/mpir-tests/mpz.div_2exp/mpz.div_2exp.vcxproj # msvc/vs17/mpir-tests/mpz.dive/mpz.dive.vcxproj # msvc/vs17/mpir-tests/mpz.dive_ui/mpz.dive_ui.vcxproj # msvc/vs17/mpir-tests/mpz.divis/mpz.divis.vcxproj # msvc/vs17/mpir-tests/mpz.divis_2exp/mpz.divis_2exp.vcxproj # msvc/vs17/mpir-tests/mpz.export/mpz.export.vcxproj # msvc/vs17/mpir-tests/mpz.fac_ui/mpz.fac_ui.vcxproj # msvc/vs17/mpir-tests/mpz.fdiv/mpz.fdiv.vcxproj # msvc/vs17/mpir-tests/mpz.fdiv_ui/mpz.fdiv_ui.vcxproj # msvc/vs17/mpir-tests/mpz.fib_ui/mpz.fib_ui.vcxproj # msvc/vs17/mpir-tests/mpz.fits/mpz.fits.vcxproj # msvc/vs17/mpir-tests/mpz.gcd/mpz.gcd.vcxproj # msvc/vs17/mpir-tests/mpz.gcd_ui/mpz.gcd_ui.vcxproj # msvc/vs17/mpir-tests/mpz.get_d/mpz.get_d.vcxproj # msvc/vs17/mpir-tests/mpz.get_d_2exp/mpz.get_d_2exp.vcxproj # msvc/vs17/mpir-tests/mpz.get_si/mpz.get_si.vcxproj # msvc/vs17/mpir-tests/mpz.get_sx/mpz.get_sx.vcxproj # msvc/vs17/mpir-tests/mpz.get_ux/mpz.get_ux.vcxproj # msvc/vs17/mpir-tests/mpz.hamdist/mpz.hamdist.vcxproj # msvc/vs17/mpir-tests/mpz.import/mpz.import.vcxproj # msvc/vs17/mpir-tests/mpz.inp_str/mpz.inp_str.vcxproj # msvc/vs17/mpir-tests/mpz.io_raw/mpz.io_raw.vcxproj # msvc/vs17/mpir-tests/mpz.jac/mpz.jac.vcxproj # msvc/vs17/mpir-tests/mpz.lcm/mpz.lcm.vcxproj # msvc/vs17/mpir-tests/mpz.likely_prime_p/mpz.likely_prime_p.vcxproj # msvc/vs17/mpir-tests/mpz.limbs/mpz.limbs.vcxproj # msvc/vs17/mpir-tests/mpz.logic/mpz.logic.vcxproj # msvc/vs17/mpir-tests/mpz.lucnum_ui/mpz.lucnum_ui.vcxproj # msvc/vs17/mpir-tests/mpz.mfac_uiui/mpz.mfac_uiui.vcxproj # msvc/vs17/mpir-tests/mpz.mul/mpz.mul.vcxproj # msvc/vs17/mpir-tests/mpz.mul_i/mpz.mul_i.vcxproj # msvc/vs17/mpir-tests/mpz.next_prime_candidate/mpz.next_prime_candidate.vcxproj # msvc/vs17/mpir-tests/mpz.oddeven/mpz.oddeven.vcxproj # msvc/vs17/mpir-tests/mpz.perfpow/mpz.perfpow.vcxproj # msvc/vs17/mpir-tests/mpz.perfsqr/mpz.perfsqr.vcxproj # msvc/vs17/mpir-tests/mpz.popcount/mpz.popcount.vcxproj # msvc/vs17/mpir-tests/mpz.pow/mpz.pow.vcxproj # msvc/vs17/mpir-tests/mpz.powm/mpz.powm.vcxproj # msvc/vs17/mpir-tests/mpz.powm_ui/mpz.powm_ui.vcxproj # msvc/vs17/mpir-tests/mpz.pprime_p/mpz.pprime_p.vcxproj # msvc/vs17/mpir-tests/mpz.primorial_ui/mpz.primorial_ui.vcxproj # msvc/vs17/mpir-tests/mpz.reuse/mpz.reuse.vcxproj # msvc/vs17/mpir-tests/mpz.root/mpz.root.vcxproj # msvc/vs17/mpir-tests/mpz.scan/mpz.scan.vcxproj # msvc/vs17/mpir-tests/mpz.set_d/mpz.set_d.vcxproj # msvc/vs17/mpir-tests/mpz.set_f/mpz.set_f.vcxproj # msvc/vs17/mpir-tests/mpz.set_si/mpz.set_si.vcxproj # msvc/vs17/mpir-tests/mpz.set_str/mpz.set_str.vcxproj # msvc/vs17/mpir-tests/mpz.set_sx/mpz.set_sx.vcxproj # msvc/vs17/mpir-tests/mpz.set_ux/mpz.set_ux.vcxproj # msvc/vs17/mpir-tests/mpz.sizeinbase/mpz.sizeinbase.vcxproj # msvc/vs17/mpir-tests/mpz.sqrtrem/mpz.sqrtrem.vcxproj # msvc/vs17/mpir-tests/mpz.tdiv/mpz.tdiv.vcxproj # msvc/vs17/mpir-tests/mpz.tdiv_ui/mpz.tdiv_ui.vcxproj # msvc/vs17/mpir-tests/mpz.trial_division/mpz.trial_division.vcxproj # msvc/vs17/mpir-tests/rand.iset/rand.iset.vcxproj # msvc/vs17/mpir-tests/rand.lc2exp/rand.lc2exp.vcxproj # msvc/vs17/mpir-tests/rand.mt/rand.mt.vcxproj # msvc/vs17/mpir-tests/rand.rand/rand.rand.vcxproj # msvc/vs17/mpir-tests/rand.urbui/rand.urbui.vcxproj # msvc/vs17/mpir-tests/rand.urmui/rand.urmui.vcxproj # msvc/vs17/mpir-tests/rand.urndmm/rand.urndmm.vcxproj # msvc/vs17/mpir-tests/run-tests.py # msvc/vs17/mpir-tune.sln # msvc/vs17/mpir-tune/lib_speed/lib_speed.vcxproj # msvc/vs17/mpir-tune/lib_speed/lib_speed.vcxproj.filters # msvc/vs17/mpir-tune/speed/speed.vcxproj # msvc/vs17/mpir-tune/speed/speed.vcxproj.filters # msvc/vs17/mpir-tune/try/try.vcxproj # msvc/vs17/mpir-tune/try/try.vcxproj.filters # msvc/vs17/mpir-tune/tune/divrem_1.c # msvc/vs17/mpir-tune/tune/fac_ui.c # msvc/vs17/mpir-tune/tune/mod_1.c # msvc/vs17/mpir-tune/tune/mulmod_2expp1.c # msvc/vs17/mpir-tune/tune/normmod_2expp1.c # msvc/vs17/mpir-tune/tune/revbin.c # msvc/vs17/mpir-tune/tune/split_bits.c # msvc/vs17/mpir-tune/tune/sqr_basecase.asm # msvc/vs17/mpir-tune/tune/tune.vcxproj # msvc/vs17/mpir-tune/tune/tune.vcxproj.filters # msvc/vs17/mpir-tune/tune/tune_prebuild.bat # msvc/vs17/mpir-tune/tune/tune_prebuild.py # msvc/vs17/msbuild.bat # msvc/vs17/run-speed.py # msvc/vs17/run-tests.py # msvc/vs17/version_info.py # msvc/vsyasm.props # msvc/vsyasm.xml # msvc/win_timing.c # msvc/win_timing.h
114 lines
2.6 KiB
Python
114 lines
2.6 KiB
Python
#
|
|
# Python script for running GMP tests
|
|
#
|
|
|
|
import os
|
|
import shutil
|
|
import string
|
|
import copy
|
|
import subprocess
|
|
import code
|
|
import sys
|
|
import re
|
|
|
|
cw, f = os.path.split(__file__)
|
|
if cw != '':
|
|
os.chdir(cw)
|
|
|
|
try:
|
|
fn = r'..\output_params.bat'
|
|
f = open(fn)
|
|
par = f.readlines()
|
|
f.close()
|
|
m1 = re.match(r'\(set ldir\=(.*)\)', par[0])
|
|
m2 = re.match(r'\(set libr\=(.*)\)', par[1])
|
|
m3 = re.match(r'\(set plat\=(.*)\)', par[2])
|
|
m4 = re.match(r'\(set conf\=(.*)\)', par[3])
|
|
if m1 and m2 and m3 and m4:
|
|
d = (m1.group(1), m2.group(1), m3.group(1), m4.group(1))
|
|
else:
|
|
raise OSError(2, 'Incorrect file content', fn)
|
|
except OSError as e:
|
|
print(e.strerror, e.filename)
|
|
sys.exit(-1)
|
|
|
|
tdir = '{}\\{}\\'.format(d[2], d[3])
|
|
if d[1] == 'dll':
|
|
shutil.copy("{}\\{}mpir.dll".format(d[0], tdir), tdir)
|
|
xt = 'Dynamic Link Library'
|
|
else:
|
|
xt = 'Static Library'
|
|
print('Testing MPIR {:s} ({:s}) in <{:s}> Configuration'.format(xt, d[0][:-1], tdir))
|
|
|
|
dir_list = []
|
|
for x in os.walk('mpir-tests'):
|
|
if x[0] == 'mpir-tests':
|
|
dir_list += x[1]
|
|
else:
|
|
break
|
|
|
|
prj_list = []
|
|
for x in dir_list:
|
|
l = os.listdir('mpir-tests\\' + x)
|
|
for f in l :
|
|
y = os.path.splitext(f)
|
|
if y[1] == '.vcxproj' and y[0] != 'add-test-lib':
|
|
prj_list += [y[0]]
|
|
prj_list.sort()
|
|
|
|
exe_list = []
|
|
try :
|
|
l = os.listdir(tdir)
|
|
except :
|
|
print("Tests have not been built for this configuration")
|
|
os._exit(-1)
|
|
|
|
for f in l:
|
|
x = os.path.splitext(f)
|
|
if x[1] == '.exe':
|
|
exe_list += [x[0]]
|
|
exe_list.sort()
|
|
if len(exe_list) == 0:
|
|
print("No executable test files for this configuration")
|
|
os._exit(-1)
|
|
|
|
build_fail = 0
|
|
run_ok = 0
|
|
run_fail = 0
|
|
for i in prj_list:
|
|
if i in exe_list:
|
|
ef = tdir + '\\' + i + '.exe'
|
|
try:
|
|
prc = subprocess.Popen( ef, stdout = subprocess.PIPE,
|
|
stderr = subprocess.STDOUT, creationflags = 0x08000000 )
|
|
except Exception as str:
|
|
print(i, ': ERROR (', str, ')')
|
|
run_fail += 1
|
|
continue
|
|
output = prc.communicate()[0]
|
|
if prc.returncode:
|
|
print(i, ': ERROR (', prc.returncode, ' )')
|
|
run_fail += 1
|
|
else:
|
|
print(i, ': success')
|
|
run_ok += 1
|
|
if output:
|
|
print(' ', output.decode(), end = '')
|
|
else:
|
|
print("Build failure for {0}".format(i))
|
|
build_fail += 1
|
|
print(build_fail + run_ok + run_fail, "tests:")
|
|
if build_fail > 0:
|
|
print("\t{0} failed to build".format(build_fail))
|
|
if run_ok > 0:
|
|
print("\t{0} ran correctly".format(run_ok))
|
|
if run_fail > 0:
|
|
print("\t{0} failed".format(run_fail))
|
|
if len(sys.argv) == 1:
|
|
try:
|
|
input(".. completed - press ENTER")
|
|
except:
|
|
pass
|
|
else:
|
|
sys.exit(build_fail + run_fail)
|