Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
+ Start porting auto tests to git
  • Loading branch information
Calvin1602 committed Oct 19, 2015
1 parent 0ed4fe7 commit 1b4b4e9
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 9 deletions.
6 changes: 6 additions & 0 deletions distrib/screenshot.h
@@ -1,3 +1,6 @@
#ifndef DISTRIB_SCREENSHOT_INTERNAL_H
#define DISTRIB_SCREENSHOT_INTERNAL_H


void TakeScreenshot(){
char * buffer = new char[54 + 1024*768*3];
Expand Down Expand Up @@ -40,3 +43,6 @@ void callGlfwWindowHint(int target, int hint){
#define glfwSwapBuffers(a) TakeScreenshot(); break;
#define glfwGetTime() Zero()
#define glfwWindowHint(a,b) callGlfwWindowHint(a,b)


#endif
10 changes: 6 additions & 4 deletions distrib/tests_potiron.py
Expand Up @@ -2,22 +2,24 @@

Clean()

HgUpdate33()
GitUpdate33()
PatchAll()
Build_VC11Express_64()
RunAll()
Build_VC14Express_64()
RunAll()
Build_CodeBlocks()
RunAll()

Clean()

HgUpdate21()
GitUpdate21()
PatchAll()
Build_VC11Express_64()
Build_VC14Express_64()
RunAll()

Clean()
HgUpdate33()
GitUpdate33()



Expand Down
48 changes: 43 additions & 5 deletions distrib/utils.py
Expand Up @@ -8,9 +8,10 @@
import math
from time import sleep

CMakePath = r'C:\Program Files (x86)\CMake 2.8\bin\cmake.exe'
CMakePath = r'C:\Program Files (x86)\CMake\bin\cmake.exe'
VisualStudio10Path = r'C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.com'
VisualStudio11ExpressPath = r'C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\WDExpress.exe'
VisualStudio14ExpressPath = r'C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\WDExpress.exe'
CodeBlocksPath = r'C:\Program Files (x86)\CodeBlocks\codeblocks.exe'

def SetCMakePath(path):
Expand Down Expand Up @@ -78,12 +79,19 @@ def InsertScreenshotCode(path):
for line in fileinput.input(path, inplace = 1): # Does a list of files, and writes redirects STDOUT to the file in question
print line.replace("#include <glfw3.h>", "#include <glfw3.h>\n#include \"distrib/screenshot.h\" // added by insertscreenshot.py; should NOT be committed !"),

def HgUpdate21():
def __HgUpdate21():
os.system('hg update --clean "2.1 branch"')

def HgUpdate33():
def GitUpdate21():
os.system('git checkout -f origin/2.1_branch')

def __HgUpdate33():
os.system('hg update --clean "default"')

def GitUpdate33():
os.system('git checkout -f origin/master')


def Build_VC10_32():
print "Building with Visual Studio 10, 32 bits"
global CMakePath
Expand Down Expand Up @@ -118,7 +126,7 @@ def Build_VC11Express_32():
global CMakePath
global VisualStudio11ExpressPath
if os.path.exists("build_VC11_32") == False:
os.makedirs("build_VC110_32")
os.makedirs("build_VC11_32")
os.chdir("build_VC11_32")
with open(os.devnull, "w") as fnull:
print "Running CMake..."
Expand All @@ -142,6 +150,36 @@ def Build_VC11Express_64():
os.chdir("..")


def Build_VC14Express_32():
print "Building with Visual Studio 14 Express Desktop, 32 bits"
global CMakePath
global VisualStudio14ExpressPath
if os.path.exists("build_VC14_32") == False:
os.makedirs("build_VC14_32")
os.chdir("build_VC14_32")
with open(os.devnull, "w") as fnull:
print "Running CMake..."
subprocess.call( [CMakePath, '-G', 'Visual Studio 14', '-D', 'INCLUDE_DISTRIB:bool=true', '../../'], stdout=fnull, stderr=fnull )
print "Compiling everything..."
subprocess.call( [VisualStudio14ExpressPath, '/build', 'RelWithDebInfo', 'Tutorials.sln'], stdout=fnull, stderr=fnull )
os.chdir("..")

def Build_VC14Express_64():
print "Building with Visual Studio 14 Express Desktop, 64 bits"
global CMakePath
global VisualStudio14ExpressPath
if os.path.exists("build_VC14_64") == False:
os.makedirs("build_VC14_64")
os.chdir("build_VC14_64")
with open(os.devnull, "w") as fnull:
print "Running CMake..."
subprocess.call( [CMakePath, '-G', 'Visual Studio 14 Win64', '-D', 'INCLUDE_DISTRIB:bool=true', '../../'], stdout=fnull, stderr=fnull )
print "Compiling everything..."
subprocess.call( [VisualStudio14ExpressPath, '/build', 'RelWithDebInfo', 'Tutorials.sln'], stdout=fnull, stderr=fnull )
os.chdir("..")



def Build_CodeBlocks():
print "Building with Code::Blocks, ?? bits"
global CMakePath
Expand Down Expand Up @@ -267,7 +305,7 @@ def OptimusForceNVIDIA():
print "Forcing NVidia GPU (on Optimus system)..."
subprocess.call(["selectoptimus.exe", "NVIDIA"])

def Package(path):
def __Package(path):
print "Packaging into " + path + " ..."
cwd = os.getcwd()
os.chdir("..");
Expand Down

0 comments on commit 1b4b4e9

Please sign in to comment.