增加版本号

This commit is contained in:
LiYang 2016-08-26 21:50:45 +08:00
parent b3fc087c8f
commit be50b98f66
5 changed files with 8 additions and 3 deletions

View File

@ -109,6 +109,7 @@ static PyMethodDef judger_methods[] = {
PyMODINIT_FUNC init_judger(void) {
PyObject *module = Py_InitModule3("_judger", judger_methods, NULL);
PyModule_AddIntConstant(module, "VERSION", VERSION);
PyModule_AddIntConstant(module, "UNLIMITED", UNLIMITED);
PyModule_AddIntConstant(module, "SUCCESS", SUCCESS);
PyModule_AddIntConstant(module, "CPU_TIME_LIMIT_EXCEEDED", CPU_TIME_LIMITED);

View File

@ -3,5 +3,5 @@ import platform
from distutils.core import setup, Extension
setup(name='_judger',
version='1.0',
version='2.0',
ext_modules=[Extension('_judger', sources=['_judger.c'], libraries=["dl"])])

View File

@ -1,7 +1,6 @@
#define _GNU_SOURCE
#define _POSIX_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <sched.h>

View File

@ -4,8 +4,10 @@
#include <sys/types.h>
#include <stdio.h>
#define UNLIMITED -1
// (ver >> 16) & 0xff, (ver >> 8) & 0xff, ver & 0xff -> real version
#define VERSION 0x020000
#define UNLIMITED -1
#define LOG_ERROR(error_code) LOG_FATAL(log_fp, "Error: "#error_code);

View File

@ -1,8 +1,11 @@
# coding=utf-8
import _judger
from unittest import TestCase, main
from testcase.integration.test import IntegrationTest
from testcase.c_cpp.test import C_CPPJudgeTestCase
from testcase.seccomp.test import SeccompTest
ver = _judger.VERSION
print "Judger version", (ver >> 16) & 0xff, (ver >> 8) & 0xff, ver & 0xff
main()