提交 2d5115dd 创建 作者: demo10's avatar demo10

modify

上级 1e1a03ef
流水线 #892 已失败 于阶段
用时 35 秒
image: "registry.cn-hangzhou.aliyuncs.com/engintime/ubuntu_16.04_program:latest"
stages:
- make
- code-analysis
- case1
- case2
- case3
variables:
TEACHERCHECK_REPO: "engintime/cp-lab/teachers-packet/Lab03.git"
before_script:
- flex -b -omain.c scan.txt
- make
.codecode-runner: &codecode-runner
tags:
- ubuntu-16.04
- short-job
make:
stage: make
<<: *codecode-runner
script:
- ./app input0.txt
- execscore.sh 60
only:
- master
code-analysis:
stage: code-analysis
<<: *codecode-runner
script:
- mkdir -p build
- cppcheck -v --force --enable=all --xml -I./ ./ 2> ./build/cppcheck-report.xml
- bash -c 'find ./ -regex ".*\.c\|.*\.h" | vera++ -S -s -d -c ./build/vera-report.xml'
- valgrind --xml=yes --xml-file=./build/valgrind-report.xml ./app input1.txt
- sonar-scanner -Dsonar.projectKey=ProjectKey-$CI_PROJECT_ID -Dsonar.projectName=$CI_PROJECT_NAME -Dsonar.links.homepage=$CI_PROJECT_URL -Dsonar.host.url=$SONAR_URL -Dsonar.login=$SONAR_LOGIN -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME -Dsonar.gitlab.project_id=$CI_PROJECT_ID -Dsonar.gitlab.url=$CODECODE_PROTOCOL$CODECODE_DOMAIN
allow_failure: true
only:
- master
case1:
stage: case1
<<: *codecode-runner
script:
- ./app input1.txt > user_output1.txt
- diff output1.txt user_output1.txt -b -B -y -i --suppress-common-lines
- execscore.sh 50
only:
- master
teacher-check1:
stage: case1
<<: *codecode-runner
script:
- ./app input1.txt
- git clone ${CODECODE_PROTOCOL}gitlab-ci-token:${CI_JOB_TOKEN}@${CODECODE_DOMAIN}/${CI_PROJECT_FORKSOURCE} template
- diff template/.gitlab-ci.yml .gitlab-ci.yml -b -B -y -i --suppress-common-lines
- diff template/input1.txt input1.txt -b -B -y -i --suppress-common-lines
- diff template/output1.txt output1.txt -b -B -y -i --suppress-common-lines
- fileidentity.sh
- git clone ${CODECODE_PROTOCOL}gitlab-ci-token:${CI_JOB_TOKEN}@${CODECODE_DOMAIN}/${TEACHERCHECK_REPO} teacher_check
- ./app teacher_check/input1.txt > user_output1.txt
- diff teacher_check/output1.txt user_output1.txt -b -B -y -i --suppress-common-lines
- extracase.sh
only:
- master
when: manual
allow_failure: true
case2:
stage: case2
<<: *codecode-runner
script:
- ./app input2.txt > user_output2.txt
- diff output2.txt user_output2.txt -b -B -y -i --suppress-common-lines
- execscore.sh 60
only:
- master
teacher-check2:
stage: case2
<<: *codecode-runner
script:
- ./app input2.txt
- git clone ${CODECODE_PROTOCOL}gitlab-ci-token:${CI_JOB_TOKEN}@${CODECODE_DOMAIN}/${CI_PROJECT_FORKSOURCE} template
- diff template/.gitlab-ci.yml .gitlab-ci.yml -b -B -y -i --suppress-common-lines
- diff template/input2.txt input2.txt -b -B -y -i --suppress-common-lines
- diff template/output2.txt output2.txt -b -B -y -i --suppress-common-lines
- fileidentity.sh
- git clone ${CODECODE_PROTOCOL}gitlab-ci-token:${CI_JOB_TOKEN}@${CODECODE_DOMAIN}/${TEACHERCHECK_REPO} teacher_check
- ./app teacher_check/input2.txt > user_output2.txt
- diff teacher_check/output2.txt user_output2.txt -b -B -y -i --suppress-common-lines
- extracase.sh
only:
- master
when: manual
allow_failure: true
case3:
stage: case3
<<: *codecode-runner
script:
- ./app input3.txt > user_output3.txt
- diff output3.txt user_output3.txt -b -B -y -i --suppress-common-lines
- execscore.sh 65
only:
- master
teacher-check3:
stage: case3
<<: *codecode-runner
script:
- ./app input3.txt
- git clone ${CODECODE_PROTOCOL}gitlab-ci-token:${CI_JOB_TOKEN}@${CODECODE_DOMAIN}/${CI_PROJECT_FORKSOURCE} template
- diff template/.gitlab-ci.yml .gitlab-ci.yml -b -B -y -i --suppress-common-lines
- diff template/input3.txt input3.txt -b -B -y -i --suppress-common-lines
- diff template/output3.txt output3.txt -b -B -y -i --suppress-common-lines
- fileidentity.sh
- git clone ${CODECODE_PROTOCOL}gitlab-ci-token:${CI_JOB_TOKEN}@${CODECODE_DOMAIN}/${TEACHERCHECK_REPO} teacher_check
- ./app teacher_check/input3.txt > user_output3.txt
- diff teacher_check/output3.txt user_output3.txt -b -B -y -i --suppress-common-lines
- extracase.sh
only:
- master
when: manual
allow_failure: true
a b c d e ok 2 3 4 5 6 7
\ No newline at end of file
read x;
if 0 < x then
fact := 1;
repeat
fact := fact * x;
x := x - 1
until
x = 0;
write fact
end
\ No newline at end of file
read x; /* input an integer */
if 0 < x then /* don't compute if x <= 0 */
fact := 1;
repeat
fact := fact * x;
x := x - 1
until
x = 0;
write fact // output factorial of x
end
DIR_INC = .
DIR_SRC = .
DIR_OBJ = .
DIR_BIN = .
SRC = $(wildcard ${DIR_SRC}/*.c)
OBJ = $(patsubst %.c,${DIR_OBJ}/%.o,$(notdir ${SRC}))
TARGET = app
BIN_TARGET = ${DIR_BIN}/${TARGET}
CC = gcc
CFLAGS = -g -w -fmax-errors=10 -std=c99 -fsigned-char -I${DIR_INC} -D CODECODE_CI
${BIN_TARGET}:${OBJ}
$(CC) $(OBJ) -l"fl" -o $@
${DIR_OBJ}/%.o:${DIR_SRC}/%.c
$(CC) $(CFLAGS) -c $< -o $@
\ No newline at end of file
if: 0
then: 0
else: 0
end: 0
repeat: 0
until: 0
read: 0
write: 0
id: 0
num: 0
assign: 0
eq: 0
lt: 0
plus: 0
minus: 0
times: 0
over: 0
lparen: 0
rparen: 0
semi: 0
comment: 0
error: 0
line: 0
if: 0
then: 0
else: 0
end: 0
repeat: 0
until: 0
read: 0
write: 0
id: 6
num: 6
assign: 0
eq: 0
lt: 0
plus: 0
minus: 0
times: 0
over: 0
lparen: 0
rparen: 0
semi: 0
comment: 0
error: 0
line: 0
if: 1
then: 1
else: 0
end: 1
repeat: 1
until: 1
read: 1
write: 1
id: 10
num: 4
assign: 3
eq: 1
lt: 1
plus: 0
minus: 1
times: 1
over: 0
lparen: 0
rparen: 0
semi: 4
comment: 0
error: 0
line: 9
if: 1
then: 1
else: 0
end: 1
repeat: 1
until: 1
read: 1
write: 1
id: 10
num: 4
assign: 3
eq: 1
lt: 1
plus: 0
minus: 1
times: 1
over: 0
lparen: 0
rparen: 0
semi: 4
comment: 3
error: 0
line: 9
# required metadata
sonar.language=c
# path to source directories (required)
sonar.sources=./
# path to the build artifact
sonar.artifact.path=build/app
# paths to the reports
sonar.c.cppcheck.reportPath=./build/cppcheck-report.xml
#sonar.c.pclint.reportPath=./build/pclint-report.xml
#sonar.c.coverage.reportPath=./build/gcovr-report*.xml
#sonar.c.coverage.itReportPath=./build/gcovr-report*.xml
#sonar.c.coverage.overallReportPath=./build/gcovr-report*.xml
sonar.c.valgrind.reportPath=./build/valgrind-report.xml
sonar.c.vera.reportPath=./build/vera-report.xml
#sonar.c.rats.reportPath=./build/rats-report.xml
#sonar.c.xunit.reportPath=./build/xunit-report.xml
#sonar.c.drmemory.reportPath=./build/drmemory-logs/**/results.txt
sonar.c.includeDirectories=/usr/include/,/usr/include/linux,/usr/include/x86_64-linux-gnu/bits,/usr/include/x86_64-linux-gnu/sys,/usr/include/c++/5/tr1,./
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论