summaryrefslogtreecommitdiff
path: root/testapp/test_server.py
diff options
context:
space:
mode:
authorprathamesh2013-06-05 17:26:50 +0530
committerprathamesh2013-06-05 17:26:50 +0530
commitfc40c033a083e2a4027fdbeecfb5853e6770a7c6 (patch)
tree97c47083dd1318536d4c3722214992e0b8f2bf37 /testapp/test_server.py
parent6667efae7acb86f60b0ebd4dabb959bed759bc16 (diff)
downloadonline_test-fc40c033a083e2a4027fdbeecfb5853e6770a7c6.tar.gz
online_test-fc40c033a083e2a4027fdbeecfb5853e6770a7c6.tar.bz2
online_test-fc40c033a083e2a4027fdbeecfb5853e6770a7c6.zip
c and cpp files isolated
Diffstat (limited to 'testapp/test_server.py')
-rw-r--r--testapp/test_server.py54
1 files changed, 9 insertions, 45 deletions
diff --git a/testapp/test_server.py b/testapp/test_server.py
index fc6ec56..c63ee4b 100644
--- a/testapp/test_server.py
+++ b/testapp/test_server.py
@@ -47,14 +47,14 @@ def test_c():
int ad(int a, int b)
{return a+b;}
"""
- result = code_server.run_code(src, '/tmp/main.c', '/tmp', language="C")
+ result = code_server.run_code(src, 'c_cpp_files/main.cpp', '/tmp', language="C")
check_result(result)
src = """
int add(int a, int b)
{return a+b}
"""
- result = code_server.run_code(src, '/tmp/main.c', '/tmp', language="C")
+ result = code_server.run_code(src, 'c_cpp_files/main.cpp', '/tmp', language="C")
check_result(result)
src = """
@@ -62,14 +62,14 @@ def test_c():
{while(1>0){}
return a+b;}
"""
- result = code_server.run_code(src, '/tmp/main.c', '/tmp', language="C")
+ result = code_server.run_code(src, 'c_cpp_files/main.cpp', '/tmp', language="C")
check_result(result)
src = """
int add(int a, int b)
{return a+b;}
"""
- result = code_server.run_code(src, '/tmp/main.c', '/tmp', language="C")
+ result = code_server.run_code(src, 'c_cpp_files/main.cpp', '/tmp', language="C")
check_result(result)
src = """
@@ -77,7 +77,7 @@ def test_c():
int add(int a, int b)
{printf("All Correct");}
"""
- result = code_server.run_code(src, '/tmp/main.c', '/tmp', language="C")
+ result = code_server.run_code(src, 'c_cpp_files/main.cpp', '/tmp', language="C")
check_result(result)
@@ -89,7 +89,7 @@ def test_cpp():
return a+b
}
"""
- result = code_server.run_code(src, 'docs/main.cpp', '/tmp', language="C++")
+ result = code_server.run_code(src, 'c_cpp_files/main.cpp', '/tmp', language="C++")
check_result(result)
src = """
@@ -98,7 +98,7 @@ def test_cpp():
return a+b;
}
"""
- result = code_server.run_code(src, 'docs/main.cpp', '/tmp', language="C++")
+ result = code_server.run_code(src, 'c_cpp_files/main.cpp', '/tmp', language="C++")
check_result(result)
src = """
@@ -107,7 +107,7 @@ def test_cpp():
return a+b;
}
"""
- result = code_server.run_code(src, 'docs/main.cpp', '/tmp', language="C++")
+ result = code_server.run_code(src, 'c_cpp_files/main.cpp', '/tmp', language="C++")
check_result(result)
src = """
@@ -118,43 +118,9 @@ def test_cpp():
return a+b;
}
"""
- result = code_server.run_code(src, 'docs/main.cpp', '/tmp', language="C++")
+ result = code_server.run_code(src, 'c_cpp_files/main.cpp', '/tmp', language="C++")
check_result(result)
-
-def test_java():
- """Test if server runs c code as expected."""
- src = """class Test
-{
- public static void main(String arg[])
- {
- int sum =Integer.parseInt(arg[0])+Integer.parseInt(arg[1]);
- System.out.print(sum);
- }
-}
- """
-
-# result = code_server.run_code(src, 'docs/sample.java',\
-# '/tmp', language="Java")
-# check_result(result)
-
-
-def test_scilab():
- """Test if server runs c code as expected."""
- src = """
-
-A=sciargs(
-a=strtod(A(6))
-b=strtod(A(7))
-c=a+b
-disp(c)
-exit()
- """
-# result = code_server.run_code(src, '/tmp/sample.sce',\
-# '/tmp', language="Scilab")
-# check_result(result)
-
-
def test_bash():
"""Test if server runs Bash code as expected."""
src = """
@@ -202,5 +168,3 @@ if __name__ == '__main__':
test_bash()
test_c()
test_cpp()
- test_java()
- test_scilab()