Skip to content

Commit

Permalink
Merge pull request #4 from lanl/feature/dont-call-python-in-tests
Browse files Browse the repository at this point in the history
Don't Call Python Explicitly
  • Loading branch information
Yurlungur authored May 7, 2020
2 parents 177b0ac + 571e73c commit cc1b175
Show file tree
Hide file tree
Showing 26 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion test/advection1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
# COMPILE CODE AT MULTIPLE RESOLUTIONS USING SEPARATE BUILD FILE
for n,res in enumerate(RES):
util.change_cparm('N{}TOT'.format(IDIM), res, TMP_BUILD)
call(['python', TMP_BUILD, '-dir', TMP_DIR, '-idim', str(IDIM)])
call([sys.executable, TMP_BUILD, '-dir', TMP_DIR, '-idim', str(IDIM)])
call(['cp', os.path.join(os.getcwd(), TMP_DIR, 'bhlight'),
'../../test/' + TMP_DIR + '/bhlight_' + str(res)])
copyfile(os.path.join(os.getcwd(), TMP_DIR, 'param_template.dat'), '../../test/' +
Expand Down
2 changes: 1 addition & 1 deletion test/advection2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def phi_true(t,x,y):
if MPI:
for d in [1,2]:
util.change_cparm('N{}CPU'.format(d), 2, TMP_BUILD)
call(['python', TMP_BUILD, '-dir', TMP_DIR])
call([sys.executable, TMP_BUILD, '-dir', TMP_DIR])
parm_src = os.path.join(os.getcwd(), TMP_DIR, 'param_template.dat')
parm_dest = '../../test/' + TMP_DIR + '/param.dat'
call(['cp', os.path.join(os.getcwd(), TMP_DIR, 'bhlight'),
Expand Down
2 changes: 1 addition & 1 deletion test/advection3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def phi_true(t,x,y,z):
if MPI:
for d in [1,2,3]:
util.change_cparm('N{}CPU'.format(d), 2, TMP_BUILD)
call(['python', TMP_BUILD, '-dir', TMP_DIR])
call([sys.executable, TMP_BUILD, '-dir', TMP_DIR])
parm_src = os.path.join(os.getcwd(), TMP_DIR, 'param_template.dat')
parm_dest = '../../test/' + TMP_DIR + '/param.dat'
call(['cp', os.path.join(os.getcwd(), TMP_DIR, 'bhlight'),
Expand Down
2 changes: 1 addition & 1 deletion test/binning.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
os.chdir('../prob/' + PROBLEM)

# COMPILE CODE
args = ['python', 'build.py', '-dir', TMP_DIR, '-idim', str(IDIM)]
args = [sys.executable, 'build.py', '-dir', TMP_DIR, '-idim', str(IDIM)]
if MPI:
args += ['-mpi']
call(args)
Expand Down
2 changes: 1 addition & 1 deletion test/bondi.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
for n in xrange(len(RES)):
util.change_cparm('N1TOT', RES[n], TMP_BUILD)
util.change_cparm('N2TOT', RES[n], TMP_BUILD)
call(['python', TMP_BUILD, '-dir', TMP_DIR])
call([sys.executable, TMP_BUILD, '-dir', TMP_DIR])
call(['cp', os.path.join(os.getcwd(), TMP_DIR, 'bhlight'),
'../../test/' + TMP_DIR + '/bhlight_' + str(RES[n])])
copyfile(os.path.join(os.getcwd(), TMP_DIR, 'param_template.dat'), '../../test/' +
Expand Down
2 changes: 1 addition & 1 deletion test/brem.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
os.chdir('../prob/' + PROBLEM)

# COMPILE CODE
call(['python', 'build.py', '-dir', TMP_DIR])
call([sys.executable, 'build.py', '-dir', TMP_DIR])
os.chdir('../../test')
call(['mv', '../prob/' + PROBLEM + '/' + TMP_DIR, './'])

Expand Down
2 changes: 1 addition & 1 deletion test/brem_mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
os.chdir('../prob/' + PROBLEM)

# COMPILE CODE
call(['python', 'build_mpi.py', '-dir', TMP_DIR])
call([sys.executable, 'build_mpi.py', '-dir', TMP_DIR])
os.chdir('../../test/')
call(['mv', '../prob/' + PROBLEM + '/' + TMP_DIR, './'])

Expand Down
2 changes: 1 addition & 1 deletion test/comptonization.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
os.chdir('../prob/' + PROBLEM)

# COMPILE CODE
call(['python', 'build.py', '-dir', TMP_DIR])
call([sys.executable, 'build.py', '-dir', TMP_DIR])
os.chdir('../../test')
call(['mv', '../prob/' + PROBLEM + '/' + TMP_DIR, './'])

Expand Down
2 changes: 1 addition & 1 deletion test/entropy.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
os.chdir('../prob/' + PROBLEM)

# COMPILE CODE
call(['python', 'build.py', '-dir', TMP_DIR])
call([sys.executable, 'build.py', '-dir', TMP_DIR])
os.chdir('../../test')
call(['mv', '../prob/' + PROBLEM + '/' + TMP_DIR, './'])

Expand Down
2 changes: 1 addition & 1 deletion test/fornax.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
os.chdir('../prob/' + PROBLEM)

# COMPILE CODE
compile_args = ['python','build.py','-dir',TMP_DIR]
compile_args = [sys.executable,'build.py','-dir',TMP_DIR]
if MPI:
compile_args += ['-mpi']
if EQUIL:
Expand Down
2 changes: 1 addition & 1 deletion test/generate_all_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

for TEST in TESTS:
print ' ' + util.color.BOLD + TEST + util.color.NORMAL
args = ['python', TEST]
args = [sys.executable, TEST]
if TABLE:
args += ['-table']
popen = sp.Popen(args, stdout=sp.PIPE, stderr=sp.PIPE,
Expand Down
2 changes: 1 addition & 1 deletion test/leptoneq.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
os.chdir('../prob/' + PROBLEM)

# COMPILE CODE
compile_args = ['python','build.py','-dir',TMP_DIR]
compile_args = [sys.executable,'build.py','-dir',TMP_DIR]
if MPI:
compile_args += ['-mpi']
call(compile_args)
Expand Down
2 changes: 1 addition & 1 deletion test/mhdmodes1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
for n in range(len(RES)):
util.change_cparm('N{}TOT'.format(IDIM), RES[n], TMP_BUILD)
#util.change_cparm('RECONSTRUCTION', 'PARA', TMP_BUILD)
args = ['python', TMP_BUILD, '-dir', TMP_DIR, '-idim', str(IDIM)]
args = [sys.executable, TMP_BUILD, '-dir', TMP_DIR, '-idim', str(IDIM)]
if TABLE:
args += ['-table']
call(args)
Expand Down
2 changes: 1 addition & 1 deletion test/mhdmodes2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
for n in range(len(RES)):
util.change_cparm('N1TOT', RES[n], TMP_BUILD)
util.change_cparm('N2TOT', RES[n], TMP_BUILD)
args = ['python', TMP_BUILD, '-dir', TMP_DIR]
args = [sys.executable, TMP_BUILD, '-dir', TMP_DIR]
if TABLE:
args.append('-table')
call(args)
Expand Down
2 changes: 1 addition & 1 deletion test/mhdmodes2d_mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
for n in range(len(RES)):
util.change_cparm('N1TOT', RES[n], TMP_BUILD)
util.change_cparm('N2TOT', RES[n], TMP_BUILD)
call(['python', TMP_BUILD, '-dir', TMP_DIR])
call([sys.executable, TMP_BUILD, '-dir', TMP_DIR])
call(['cp', os.path.join(os.getcwd(), TMP_DIR, 'bhlight'),
'../../test/' + TMP_DIR + '/bhlight_' + str(RES[n])])
copyfile(os.path.join(os.getcwd(), TMP_DIR, 'param_template.dat'), '../../test/' +
Expand Down
2 changes: 1 addition & 1 deletion test/mhdmodes3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
util.change_cparm('N2CPU', nxcpu, TMP_BUILD)
util.change_cparm('N3CPU', nxcpu, TMP_BUILD)
util.change_cparm('OPENMP', 'True', TMP_BUILD)
args = ['python', TMP_BUILD, '-dir', TMP_DIR]
args = [sys.executable, TMP_BUILD, '-dir', TMP_DIR]
if TABLE:
args.append('-table')
call(args)
Expand Down
2 changes: 1 addition & 1 deletion test/multiscatt.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
os.chdir('../prob/' + PROBLEM)

# COMPILE CODE
args = ['python', 'build.py', '-dir', TMP_DIR]
args = [sys.executable, 'build.py', '-dir', TMP_DIR]
if MPI:
args += ['-mpi']
if NOREBALANCE:
Expand Down
2 changes: 1 addition & 1 deletion test/sod.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
os.chdir('../prob/' + PROBLEM)

# COMPILE CODE
args = ['python', 'build.py', '-dir', TMP_DIR]
args = [sys.executable, 'build.py', '-dir', TMP_DIR]
if TABLE:
args.append('-table')
if FORCE:
Expand Down
2 changes: 1 addition & 1 deletion test/sod_mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
os.chdir('../prob/' + PROBLEM)

# COMPILE CODE
call(['python', 'build.py', '-mpi', '-dir', TMP_DIR])
call([sys.executable, 'build.py', '-mpi', '-dir', TMP_DIR])
os.chdir('../../test/')
call(['mv', '../prob/' + PROBLEM + '/' + TMP_DIR, './'])

Expand Down
2 changes: 1 addition & 1 deletion test/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

os.chdir('../prob/' + PROBLEM)
# COMPILE CODE
args = ['python', 'build.py', '-dir', TMP_DIR]
args = [sys.executable, 'build.py', '-dir', TMP_DIR]
call(args)
call(['mv', 'sc_eos_gamma_{}.h5'.format(str(gam).replace('.','p')), TMP_DIR])
os.chdir('../../test/')
Expand Down
2 changes: 1 addition & 1 deletion test/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def L1_norm(xa, ya, xb, yb):
args = name_to_args(TEST)
TESTNAME = args[0][:-3] if len(args) == 1 else TEST
print(' ' + util.color.BOLD + TESTNAME + util.color.NORMAL)
args = ['python'] + args + ['-auto']
args = [sys.executable] + args + ['-auto']
if TABLE:
args += ['-table']
if FAST:
Expand Down
2 changes: 1 addition & 1 deletion test/thermalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
os.chdir('../prob/' + PROBLEM)

# COMPILE CODE
call(['python', 'build.py', '-dir', TMP_DIR])
call([sys.executable, 'build.py', '-dir', TMP_DIR])
os.chdir('../../test')
call(['mv', '../prob/' + PROBLEM + '/' + TMP_DIR, './'])

Expand Down
2 changes: 1 addition & 1 deletion test/thermalization_mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
os.chdir('../prob/' + 'thermalization')

# COMPILE CODE
call(['python', 'build_mpi.py', '-dir', TMP_DIR])
call([sys.executable, 'build_mpi.py', '-dir', TMP_DIR])
os.chdir('../../test')
call(['mv', '../prob/' + 'thermalization' + '/' + TMP_DIR, './'])

Expand Down
2 changes: 1 addition & 1 deletion test/tracers1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
os.chdir('../prob/' + PROBLEM)

# COMPILE CODE
call(['python', 'build.py', '-dir', TMP_DIR, '-idim',
call([sys.executable, 'build.py', '-dir', TMP_DIR, '-idim',
str(IDIM),'-ntot',str(RES),'-tracers'])
os.chdir('../../test/')
call(['mv', '../prob/' + PROBLEM + '/' + TMP_DIR, './'])
Expand Down
2 changes: 1 addition & 1 deletion test/tracers3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
os.chdir('../prob/' + PROBLEM)

# COMPILE CODE
call(['python', 'build.py', '-dir', TMP_DIR,
call([sys.executable, 'build.py', '-dir', TMP_DIR,
'-classic', '-nob', '-norenorm', '-tracertest'])
os.chdir('../../test/')
call(['mv', '../prob/' + PROBLEM + '/' + TMP_DIR, './'])
Expand Down
2 changes: 1 addition & 1 deletion test/yedecay.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
os.chdir('../prob/' + PROBLEM)

# COMPILE CODE
compile_args = ['python','build.py','-dir',TMP_DIR]
compile_args = [sys.executable,'build.py','-dir',TMP_DIR]
if MPI:
compile_args += ['-mpi']
if ANTINU:
Expand Down

0 comments on commit cc1b175

Please sign in to comment.