Commit 7e9ba875 authored by Thomas Dupriez's avatar Thomas Dupriez

Merge remote-tracking branch 'origin/master'

parents aff59b9b f6518b39
#!/usr/bin/python3
#-*- coding: utf-8 -*-
PIDFILE = '/var/run/CI_the_dungeon_project.pid'
......@@ -6,20 +6,23 @@ make clean
if ! make; then
echo 'Compilation error in the master branch.' > CI/msg
echo 'Result of make :\n' >> CI/msg
make 2>> CI/msgerror
cat CI/msgerror >> CI/msg
make 2>> CI/msg
echo '\n-- \nCI script' >> CI/msg
# Kludge : pas de serveur smtp accessible depuis la salle.
scp CI/msg fardale@crash-test.crans.org:the_dungeon_project/
ssh fardale@crash-test.crans.org './the_dungeon_project/mailci.py "ens-info-genielog-2015@lists.crans.org" ./the_dungeon_project/msg'
rm -f CI/msg
echo 'It seems that your commit breaks the compilation of the project.' > CI/msg
echo 'Result of make :\n' >> CI/msg
cat CI/msgerror >> CI/msg
fi
if ! make test; then
echo 'Test error in the master branch.' > CI/msg
echo 'Result of make test :\n' >> CI/msg
make test 2>> CI/msg
echo '\n-- \nCI script' >> CI/msg
# Kludge : pas de serveur smtp accessible depuis la salle.
scp CI/msg fardale@crash-test.crans.org:the_dungeon_project/
ssh fardale@crash-test.crans.org "./the_dungeon_project/mailci.py $(git log -n 1 | grep Author | sed "s/.*<\(.*\)>/\1/g") ./the_dungeon_project/msg"
ssh fardale@crash-test.crans.org './the_dungeon_project/mailci.py "ens-info-genielog-2015@lists.crans.org" ./the_dungeon_project/msg'
rm -f CI/msg
fi
exit 0
#!/usr/bin/python3
import common
import http.server
import subprocess
import sys
import sys,os,pwd,grp
import argparse
def ssh(host, command):
cossh = subprocess.Popen(["ssh", "%s" % host, command], shell=False, stdout=subprocess.PIPE)
print(cossh.stdout.readlines())
PORT = 8080
server_address = ("", PORT)
server = http.server.HTTPServer
handler = http.server.SimpleHTTPRequestHandler
print("Serveur actif sur le port :", PORT)
def run():
PORT = 8080
server_address = ("", PORT)
server = http.server.HTTPServer
handler = http.server.SimpleHTTPRequestHandler
print("Serveur actif sur le port :", PORT)
httpd = server(server_address, handler)
while True:
httpd.handle_request()
ssh("01.dptinfo.ens-cachan.fr", "cd projet_genielog/the_dungeon_project/; git pull")
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-fg", help="run the server in foreground", action="store_true")
args = parser.parse_args()
if args.fg:
run()
exit()
# do the UNIX double-fork magic, see Stevens' "Advanced
# Programming in the UNIX Environment" for details (ISBN 0201563177)
try:
pid = os.fork()
if pid > 0:
# exit first parent
sys.exit(0)
except OSError as e:
print("fork #1 failed: %d (%s)" % (e.errno, e.strerror),file=sys.stderr)
sys.exit(1)
# decouple from parent environment
os.chdir("/") #don't prevent unmounting....
os.setsid()
os.umask(0)
# do second fork
try:
pid = os.fork()
if pid > 0:
# exit from second parent, print eventual PID before
#print "Daemon PID %d" % pid
open(common.PIDFILE, 'w').write("%d" % pid)
sys.exit(0)
except OSError as e:
print("fork #2 failed: %d (%s)" % (e.errno, e.strerror),file=sys.stderr)
sys.exit(1)
httpd = server(server_address, handler)
while True:
httpd.handle_request()
ssh("01.dptinfo.ens-cachan.fr", "cd projet_genielog/the_dungeon_project/; git pull")
#main loop
run()
......@@ -5,7 +5,7 @@
PACKAGEDIRS = ${shell find . -iname '*.java' | sed 's/\.\/\|[^/]*.java//g' | sort -g | uniq}
#TESTCLASS = ${shell find . -name *Test.java | sed 's/.\/src\/\|.java//g' | sed 's/\//./g'}
TESTPACKAGE = ${shell find . -name *Tests.java | sed 's/.\/src\/\|.java//g' | sed 's/\//./g'}
PARSER = src/ingame_programming/Script.jj
......@@ -75,6 +75,9 @@ buildplay-term: all
genpars: $(PARSER)
@cd `dirname $<` ;find . -name *.jj | while read i; do java -cp lib/javacc-6.1.2.jar javacc $$i; done
test : all
cd $(BIN); java -cp lib/*:. org.junit.runner.JUnitCore $(TESTPACKAGE)
clean :
rm -rf $(BIN)
......
......@@ -29,6 +29,10 @@ To compile and run:
Terminal version :
make buildplay-term
To launch test :
make test
################### HOW TO PLAY ###################
1)Launch the game.
......
package core.zone;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
/**
* TestSuite for the core package.
* Will launch automatically all the JUnits tests.
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({
PointTest.class,
RectangleTest.class,
TranslationTest.class
})
public class CoreTests{}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment