create unique build dirs during testing; fixes #27
This commit is contained in:
parent
6877682042
commit
347462b8aa
2
.gitignore
vendored
2
.gitignore
vendored
@ -3,7 +3,7 @@ __pycache__/
|
|||||||
|
|
||||||
# generated by unit tests
|
# generated by unit tests
|
||||||
test/*/CMakeLists.txt
|
test/*/CMakeLists.txt
|
||||||
test/*/build/
|
test/*/build*/
|
||||||
test/*/cmake/update.py*
|
test/*/cmake/update.py*
|
||||||
test/*/cmake/lib/
|
test/*/cmake/lib/
|
||||||
test/*/cmake/modules/
|
test/*/cmake/modules/
|
||||||
|
@ -4,6 +4,8 @@ import subprocess
|
|||||||
import shlex
|
import shlex
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
|
import time
|
||||||
|
import datetime
|
||||||
|
|
||||||
HERE = os.path.abspath(os.path.dirname(__file__))
|
HERE = os.path.abspath(os.path.dirname(__file__))
|
||||||
|
|
||||||
@ -68,6 +70,8 @@ def exe(command):
|
|||||||
|
|
||||||
def boilerplate(name, setup_command):
|
def boilerplate(name, setup_command):
|
||||||
|
|
||||||
|
stamp = datetime.datetime.fromtimestamp(time.time()).strftime('%Y-%m-%d-%H:%M:%S')
|
||||||
|
|
||||||
os.chdir(os.path.join(HERE, name, 'cmake'))
|
os.chdir(os.path.join(HERE, name, 'cmake'))
|
||||||
shutil.copy(os.path.join('..', '..', '..', 'update.py'), 'update.py')
|
shutil.copy(os.path.join('..', '..', '..', 'update.py'), 'update.py')
|
||||||
if not os.path.exists('lib'):
|
if not os.path.exists('lib'):
|
||||||
@ -80,9 +84,12 @@ def boilerplate(name, setup_command):
|
|||||||
|
|
||||||
if sys.platform == 'win32':
|
if sys.platform == 'win32':
|
||||||
setup_command += ' --generator="MinGW Makefiles"'
|
setup_command += ' --generator="MinGW Makefiles"'
|
||||||
|
|
||||||
|
setup_command += ' build-%s' % stamp
|
||||||
|
|
||||||
stdout, stderr = exe(setup_command)
|
stdout, stderr = exe(setup_command)
|
||||||
|
|
||||||
os.chdir(os.path.join(HERE, name, 'build'))
|
os.chdir(os.path.join(HERE, name, 'build-%s' % stamp))
|
||||||
|
|
||||||
if sys.platform == 'win32':
|
if sys.platform == 'win32':
|
||||||
stdout, stderr = exe('mingw32-make')
|
stdout, stderr = exe('mingw32-make')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user