mirror of https://github.com/vitalif/openscad
polish up so its easier to run under Windows(TM)
parent
90c549ad0a
commit
97ebae9f78
|
@ -13,7 +13,7 @@
|
||||||
# -mingw32 Cross-compile for win32 using MXE
|
# -mingw32 Cross-compile for win32 using MXE
|
||||||
# -mingw64 Cross-compile for win64 using MXE
|
# -mingw64 Cross-compile for win64 using MXE
|
||||||
# -snapshot Build a snapshot binary (make e.g. experimental features available, build with commit info)
|
# -snapshot Build a snapshot binary (make e.g. experimental features available, build with commit info)
|
||||||
# -tests Build package containing the regression tests
|
# -tests Build additional package containing the regression tests
|
||||||
#
|
#
|
||||||
# If no version string or version date is given, todays date will be used (YYYY-MM-DD)
|
# If no version string or version date is given, todays date will be used (YYYY-MM-DD)
|
||||||
# If only version date is given, it will be used also as version string.
|
# If only version date is given, it will be used also as version string.
|
||||||
|
@ -101,6 +101,10 @@ fi
|
||||||
export VERSIONDATE
|
export VERSIONDATE
|
||||||
export VERSION
|
export VERSION
|
||||||
|
|
||||||
|
if [ $FAKEMAKE ]; then
|
||||||
|
echo 'fake make on:' $FAKEMAKE
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Checking pre-requisites..."
|
echo "Checking pre-requisites..."
|
||||||
|
|
||||||
case $OS in
|
case $OS in
|
||||||
|
@ -207,6 +211,8 @@ case $OS in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
echo "Building GUI binary..."
|
||||||
|
|
||||||
case $OS in
|
case $OS in
|
||||||
UNIX_CROSS_WIN)
|
UNIX_CROSS_WIN)
|
||||||
# make main openscad.exe
|
# make main openscad.exe
|
||||||
|
@ -229,6 +235,13 @@ case $OS in
|
||||||
fi
|
fi
|
||||||
cd $OPENSCADDIR
|
cd $OPENSCADDIR
|
||||||
;;
|
;;
|
||||||
|
LINUX)
|
||||||
|
if [ $FAKEMAKE ]; then
|
||||||
|
echo "notexe. debugging build process" > $TARGET/openscad
|
||||||
|
else
|
||||||
|
make $TARGET -j$NUMCPU
|
||||||
|
fi
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
make -j$NUMCPU $TARGET
|
make -j$NUMCPU $TARGET
|
||||||
;;
|
;;
|
||||||
|
@ -248,16 +261,17 @@ if [ $BUILD_TESTS ]; then
|
||||||
TESTBUILD_MACHINE=x86_64-w64-mingw32
|
TESTBUILD_MACHINE=x86_64-w64-mingw32
|
||||||
# dont use build-machine trilpe in TESTBINDIR because the 'mingw32'
|
# dont use build-machine trilpe in TESTBINDIR because the 'mingw32'
|
||||||
# will confuse people who are on 64 bit machines
|
# will confuse people who are on 64 bit machines
|
||||||
TESTBINDIR=build-mingw$ARCH
|
TESTBINDIR=tests-build
|
||||||
export TESTBUILD_MACHINE
|
export TESTBUILD_MACHINE
|
||||||
export TESTBINDIR
|
export TESTBINDIR
|
||||||
if [[ $ARCH == 32 ]]; then
|
if [[ $ARCH == 32 ]]; then
|
||||||
TESTBUILD_MACHINE=i686-pc-mingw32
|
TESTBUILD_MACHINE=i686-pc-mingw32
|
||||||
fi
|
fi
|
||||||
cd $OPENSCADDIR
|
cd $DEPLOYDIR
|
||||||
mkdir $TESTBINDIR
|
mkdir $TESTBINDIR
|
||||||
cd $TESTBINDIR
|
cd $TESTBINDIR
|
||||||
cmake ../tests/ -DCMAKE_TOOLCHAIN_FILE=../tests/CMingw-cross-env.cmake \
|
cmake $OPENSCADDIR/tests/ \
|
||||||
|
-DCMAKE_TOOLCHAIN_FILE=../tests/CMingw-cross-env.cmake \
|
||||||
-DMINGW_CROSS_ENV_DIR=$MXEDIR \
|
-DMINGW_CROSS_ENV_DIR=$MXEDIR \
|
||||||
-DMACHINE=$TESTBUILD_MACHINE
|
-DMACHINE=$TESTBUILD_MACHINE
|
||||||
if [ $FAKEMAKE = "tests" ]; then
|
if [ $FAKEMAKE = "tests" ]; then
|
||||||
|
@ -412,9 +426,9 @@ esac
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo "Creating regression tests package..."
|
|
||||||
|
|
||||||
if [ $BUILD_TESTS ]; then
|
if [ $BUILD_TESTS ]; then
|
||||||
|
echo "Creating regression tests package..."
|
||||||
case $OS in
|
case $OS in
|
||||||
MACOSX)
|
MACOSX)
|
||||||
echo 'building regression test package on OSX not implemented'
|
echo 'building regression test package on OSX not implemented'
|
||||||
|
@ -433,38 +447,41 @@ if [ $BUILD_TESTS ]; then
|
||||||
# as above, we use tar as a somewhat portable way to do 'exclude'
|
# as above, we use tar as a somewhat portable way to do 'exclude'
|
||||||
# while copying.
|
# while copying.
|
||||||
rm -f ./ostests.tar
|
rm -f ./ostests.tar
|
||||||
for subdir in tests testdata libraries examples $TESTBINDIR; do
|
for subdir in tests testdata libraries examples; do
|
||||||
tar prvf ./ostests.tar --exclude=.git* --exclude=*/mingw64/* --exclude=*/mingw32/* --exclude=*.cc.obj --exclude=*.a $subdir
|
tar prvf ./ostests.tar --exclude=.git* --exclude=*/mingw64/* --exclude=*/mingw32/* --exclude=*.cc.obj --exclude=*.a $subdir
|
||||||
done
|
done
|
||||||
|
cd $DEPLOYDIR
|
||||||
|
tar prvf $OPENSCADDIR/ostests.tar --exclude=.git* --exclude=*/mingw* --exclude=*.cc.obj --exclude=*.a $TESTBINDIR
|
||||||
|
|
||||||
|
cd $DEPLOYDIR
|
||||||
if [ -e ./OpenSCAD-Tests-$VERSION ]; then
|
if [ -e ./OpenSCAD-Tests-$VERSION ]; then
|
||||||
rm -rf ./OpenSCAD-Tests-$VERSION
|
rm -rf ./OpenSCAD-Tests-$VERSION
|
||||||
fi
|
fi
|
||||||
mkdir OpenSCAD-Tests-$VERSION
|
mkdir OpenSCAD-Tests-$VERSION
|
||||||
cd OpenSCAD-Tests-$VERSION
|
cd OpenSCAD-Tests-$VERSION
|
||||||
tar pxf ../ostests.tar
|
tar pxf $OPENSCADDIR/ostests.tar
|
||||||
cd ..
|
rm -f $OPENSCADDIR/ostests.tar
|
||||||
rm -f ostests.tar
|
|
||||||
|
|
||||||
# Now we have the basic files copied into our tree that will become
|
# Now we have the basic files copied into our tree that will become
|
||||||
# our .zip file. We also want to move some files around for easier
|
# our .zip file. We also want to move some files around for easier
|
||||||
# access for the user:
|
# access for the user:
|
||||||
cd $OPENSCADDIR
|
cd $DEPLOYDIR
|
||||||
cd ./OpenSCAD-Tests-$VERSION
|
cd ./OpenSCAD-Tests-$VERSION
|
||||||
echo "Copying files for ease of use when running from cmdline"
|
echo "Copying files for ease of use when running from cmdline"
|
||||||
cp -v ./tests/OpenSCAD_Test_Console.py .
|
cp -v ./tests/OpenSCAD_Test_Console.py .
|
||||||
cp -v ./tests/mingw_convert_ctest.py ./$TESTBINDIR
|
cp -v ./tests/mingw_convert_ctest.py ./$TESTBINDIR
|
||||||
|
cp -v ./tests/mingwcon.bat ./$TESTBINDIR
|
||||||
|
|
||||||
echo "Creating mingw_cross_info.py file"
|
echo "Creating mingw_cross_info.py file"
|
||||||
cd $OPENSCADDIR
|
cd $DEPLOYDIR
|
||||||
cd OpenSCAD-Tests-$VERSION
|
cd ./OpenSCAD-Tests-$VERSION
|
||||||
cd $TESTBINDIR
|
cd $TESTBINDIR
|
||||||
if [ -e ./mingw_cross_info.py ]; then
|
if [ -e ./mingw_cross_info.py ]; then
|
||||||
rm -f ./mingw_cross_info.py
|
rm -f ./mingw_cross_info.py
|
||||||
fi
|
fi
|
||||||
echo "# created automatically by release-common.sh from within linux " >> mingw_cross_info.py
|
echo "# created automatically by release-common.sh from within linux " >> mingw_cross_info.py
|
||||||
echo "linux_abs_basedir='"$OPENSCADDIR"'" >> mingw_cross_info.py
|
echo "linux_abs_basedir='"$OPENSCADDIR"'" >> mingw_cross_info.py
|
||||||
echo "linux_abs_builddir='"$OPENSCADDIR/$TESTBINDIR"'" >> mingw_cross_info.py
|
echo "linux_abs_builddir='"$DEPLOYDIR/$TESTBINDIR"'" >> mingw_cross_info.py
|
||||||
echo "bindir='"$TESTBINDIR"'" >> mingw_cross_info.py
|
echo "bindir='"$TESTBINDIR"'" >> mingw_cross_info.py
|
||||||
# fixme .. parse CTestTestfiles to find linux+convert python strings
|
# fixme .. parse CTestTestfiles to find linux+convert python strings
|
||||||
# or have CMake itself dump them during it's cross build cmake call
|
# or have CMake itself dump them during it's cross build cmake call
|
||||||
|
@ -479,8 +496,8 @@ if [ $BUILD_TESTS ]; then
|
||||||
# By default, we strip that. In most cases we wont need it if
|
# By default, we strip that. In most cases we wont need it if
|
||||||
# the files are too big it will drive away potential users.
|
# the files are too big it will drive away potential users.
|
||||||
echo "stripping .exe binaries"
|
echo "stripping .exe binaries"
|
||||||
cd $OPENSCADDIR
|
cd $DEPLOYDIR
|
||||||
cd OpenSCAD-Tests-$VERSION
|
cd ./OpenSCAD-Tests-$VERSION
|
||||||
cd $TESTBINDIR
|
cd $TESTBINDIR
|
||||||
if [ "`command -v $TESTBUILD_MACHINE'-strip' `" ]; then
|
if [ "`command -v $TESTBUILD_MACHINE'-strip' `" ]; then
|
||||||
for exefile in *exe; do
|
for exefile in *exe; do
|
||||||
|
@ -492,7 +509,7 @@ if [ $BUILD_TESTS ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Build the actual .zip archive based on the file tree we've built above
|
# Build the actual .zip archive based on the file tree we've built above
|
||||||
cd $OPENSCADDIR
|
cd $DEPLOYDIR
|
||||||
ZIPFILE=OpenSCAD-Tests-$VERSION-x86-$ARCH.zip
|
ZIPFILE=OpenSCAD-Tests-$VERSION-x86-$ARCH.zip
|
||||||
echo "Creating binary zip package for Tests:" $ZIPFILE
|
echo "Creating binary zip package for Tests:" $ZIPFILE
|
||||||
rm -f ./$ZIPFILE
|
rm -f ./$ZIPFILE
|
||||||
|
@ -510,4 +527,7 @@ if [ $BUILD_TESTS ]; then
|
||||||
echo 'building regression test package on linux not implemented'
|
echo 'building regression test package on linux not implemented'
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
else
|
||||||
|
echo "Not building regression tests package"
|
||||||
fi # BUILD_TESTS
|
fi # BUILD_TESTS
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
import os,sys
|
||||||
|
|
||||||
|
thisfile_abspath=os.path.abspath(__file__)
|
||||||
|
thisdir_abspath=os.path.abspath(os.path.dirname(thisfile_abspath))
|
||||||
|
|
||||||
|
starting_dir=os.path.join(thisdir_abspath,'tests-build')
|
||||||
|
print 'changing current folder to '+starting_dir
|
||||||
|
os.chdir(starting_dir)
|
||||||
|
|
||||||
|
print 'adding ',starting_dir,'folder to sys.path'
|
||||||
|
sys.path.append(starting_dir)
|
||||||
|
build_dir=os.path.join(starting_dir,'tests-build')
|
||||||
|
print 'adding ',build_dir,'folder to sys.path'
|
||||||
|
sys.path.append(build_dir)
|
||||||
|
|
||||||
|
print 'converting CTestTestfile.cmake by calling mingw_convert_test.py'
|
||||||
|
import mingw_convert_ctest
|
||||||
|
mingw_convert_ctest.run()
|
||||||
|
|
||||||
|
#cmd = 'start "OpenSCAD Test console" /wait /d c:\\temp cmd.exe'
|
||||||
|
#cmd = 'start /d "'+starting_dir+'" cmd.exe "OpenSCAD Test Console"'
|
||||||
|
cmd = 'start /d "'+starting_dir+'" cmd.exe mingwcon.bat'
|
||||||
|
print 'opening console: running ',cmd
|
||||||
|
os.system( cmd )
|
||||||
|
|
||||||
|
# figure out how to run convert script
|
||||||
|
# dont use mingw64 in linbuild path?
|
||||||
|
|
||||||
|
# run a batch file with greeting
|
||||||
|
|
||||||
|
# auto find 'ctest' binary and add to path?
|
||||||
|
# auto find 'python' binary and add to path?
|
||||||
|
|
||||||
|
# info on running ctest
|
||||||
|
# and link to doc/testing.txt and ctest website
|
||||||
|
#
|
||||||
|
# figure out better windows prompt, can it be set?
|
||||||
|
|
|
@ -37,7 +37,8 @@
|
||||||
import mingw_cross_info
|
import mingw_cross_info
|
||||||
|
|
||||||
import sys,os,string
|
import sys,os,string
|
||||||
_debug=False
|
#_debug=False
|
||||||
|
_debug=True
|
||||||
_undo=False
|
_undo=False
|
||||||
def debug(*args):
|
def debug(*args):
|
||||||
global _debug
|
global _debug
|
||||||
|
@ -132,8 +133,9 @@ def processfile(infilename):
|
||||||
debug('outputname',outfilename)
|
debug('outputname',outfilename)
|
||||||
|
|
||||||
for line in lines:
|
for line in lines:
|
||||||
debug('input:',line)
|
#debug('input:',line)
|
||||||
|
|
||||||
|
line=line.replace(linbuild,winbuild)
|
||||||
line=line.replace(lintct,wintct)
|
line=line.replace(lintct,wintct)
|
||||||
line=line.replace(linpy,winpy)
|
line=line.replace(linpy,winpy)
|
||||||
line=line.replace(linosng,winosng)
|
line=line.replace(linosng,winosng)
|
||||||
|
@ -148,7 +150,7 @@ def processfile(infilename):
|
||||||
# Fixme - how do we escape spaces in cmake?
|
# Fixme - how do we escape spaces in cmake?
|
||||||
#line=line.replace('Program Files','Progra~1')
|
#line=line.replace('Program Files','Progra~1')
|
||||||
|
|
||||||
debug('output:',line)
|
#debug('output:',line)
|
||||||
|
|
||||||
fout.write(line)
|
fout.write(line)
|
||||||
|
|
||||||
|
@ -159,6 +161,10 @@ def processfile(infilename):
|
||||||
open(infilename,'wb').write(open(outfilename,'rb').read())
|
open(infilename,'wb').write(open(outfilename,'rb').read())
|
||||||
print 'new version of',infilename,'written'
|
print 'new version of',infilename,'written'
|
||||||
|
|
||||||
|
def run():
|
||||||
processfile('CTestTestfile.cmake')
|
processfile('CTestTestfile.cmake')
|
||||||
processfile('CTestCustom.cmake')
|
processfile('CTestCustom.cmake')
|
||||||
|
|
||||||
|
if __name__=='__main__':
|
||||||
|
run()
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
@echo off
|
||||||
|
@echo Welcome to the OpenSCAD test console. Please see ..\doc\testing.txt
|
||||||
|
@echo for full instructions. Usage examples:
|
||||||
|
@echo off
|
||||||
|
@echo ctest ::# run standard set of tests
|
||||||
|
@echo ctest -C All ::# run all tests
|
||||||
|
@echo ctest -R cgal.*circle ::# run all tests named 'cgal ... circle'
|
||||||
|
@echo on
|
||||||
|
|
Loading…
Reference in New Issue