Skip to content
Snippets Groups Projects
Verified Commit 9760eccc authored by Recolic Keghart's avatar Recolic Keghart
Browse files

update scrilpts

parent cd1244cb
No related branches found
No related tags found
1 merge request!4HUST codebase improvement suggestions
Pipeline #818 canceled with stages
...@@ -11,3 +11,4 @@ build ...@@ -11,3 +11,4 @@ build
.idea .idea
.vscode .vscode
nemu/*.txt
image: recolic/cxx-toolkit
stages:
- build
- test
build:
stage: build
script:
- pacman -Sy && pacman -S --noconfirm bison flex gettext sdl2 lib32-glibc grep
- export AM_HOME=$(pwd)/nexus-am/
- cd nemu && make EXTRA_FLAGS='-DDISABLE_MMIO'
- show_log=1 ./runall.sh &> testcases.log ; echo $? > testres.log
artifacts:
paths:
- nemu/testres.log
- nemu/testcases.log
expire_in: 1 week
build-icc-pgo:
stage: build
script:
- pacman -Sy && pacman -S --noconfirm bison flex gettext sdl2 lib32-glibc grep
- export AM_HOME=$(pwd)/nexus-am/
- cd nemu && ./icc-build.sh
test:
stage: test
script:
- test 0 = $(<nemu/testres.log) || cat nemu/testcases.log
- test 0 = $(<nemu/testres.log)
...@@ -11,13 +11,13 @@ clean: ...@@ -11,13 +11,13 @@ clean:
submit: clean submit: clean
git gc git gc
STUID=$(STUID) STUNAME=$(STUNAME) hust_submit_server_host=cernet.cnm.cool bash submit.sh STUID=$(STUID) STUNAME=$(STUNAME) hust_submit_server_host=$(SUBMIT_HOST) bash submit.sh
setup: setup:
STUID=$(STUID) STUNAME=$(STUNAME) hust_submit_server_host=cernet.cnm.cool bash setup.sh STUID=$(STUID) STUNAME=$(STUNAME) hust_submit_server_host=$(SUBMIT_HOST) bash setup.sh
recover: recover:
STUID=$(STUID) STUNAME=$(STUNAME) hust_submit_server_host=cernet.cnm.cool bash recover.sh STUID=$(STUID) STUNAME=$(STUNAME) hust_submit_server_host=$(SUBMIT_HOST) bash recover.sh
.PHONY: default clean submit .PHONY: default clean submit
...@@ -21,6 +21,7 @@ LD = $(CC) ...@@ -21,6 +21,7 @@ LD = $(CC)
INCLUDES = $(addprefix -I, $(INC_DIR)) INCLUDES = $(addprefix -I, $(INC_DIR))
CFLAGS += -O2 -MMD -Wall -ggdb3 $(INCLUDES) -fomit-frame-pointer CFLAGS += -O2 -MMD -Wall -ggdb3 $(INCLUDES) -fomit-frame-pointer
CFLAGS += -DDIFF_TEST_QEMU CFLAGS += -DDIFF_TEST_QEMU
CFLAGS += $(EXTRA_FLAGS)
# Files to be compiled # Files to be compiled
SRCS = $(shell find src/ -name "*.c") SRCS = $(shell find src/ -name "*.c")
......
STUID = U201614531 STUID = U201614531
STUNAME = 刘本嵩 STUNAME = 刘本嵩
# Set to dssl.cun.io if you're not willing to use Recolic Reverse Proxy Service.
SUBMIT_HOST = cernet.cnm.cool
# DO NOT modify the following code!!! # DO NOT modify the following code!!!
......
nemu/runall.sh 100644 → 100755
#!/bin/bash #!/bin/bash
nemu=build/nemu nemu=build/nemu
[[ $show_log = 1 ]] && g_logfile=/tmp/nemu.test.log || g_logfile=/dev/null
echo "compiling NEMU..." echo "compiling NEMU..."
if make &> /dev/null; then if make &> "$g_logfile"; then
echo "NEMU compile OK" echo "NEMU compile OK"
else else
echo "testcases compile error... exit..." echo "NEMU compile error... exit..."
exit cat "$g_logfile"
exit 1
fi fi
echo "compiling testcases..." echo "compiling testcases..."
if make -C $AM_HOME/tests/cputest ARCH=x86-nemu &> /dev/null; then if make -C $AM_HOME/tests/cputest ARCH=x86-nemu &> "$g_logfile"; then
echo "testcases compile OK" echo "testcases compile OK"
cat "$g_logfile"
else else
echo "testcases compile error... exit..." echo "testcases compile error... exit..."
exit cat "$g_logfile"
exit 1
fi fi
[[ $show_log = 1 ]] && rm $g_logfile
files=`ls $AM_HOME/tests/cputest/build/*-x86-nemu.bin` files=`ls $AM_HOME/tests/cputest/build/*-x86-nemu.bin`
ori_log="build/nemu-log.txt" ori_log="build/nemu-log.txt"
has_fail=0
for file in $files; do for file in $files; do
base=`basename $file | sed -e 's/-x86-nemu.bin//'` base=`basename $file | sed -e 's/-x86-nemu.bin//'`
printf "[%14s] " $base printf "[%14s] " $base
...@@ -29,12 +36,17 @@ for file in $files; do ...@@ -29,12 +36,17 @@ for file in $files; do
if (grep 'nemu: HIT GOOD TRAP' $logfile > /dev/null) then if (grep 'nemu: HIT GOOD TRAP' $logfile > /dev/null) then
echo -e "\033[1;32mPASS!\033[0m" echo -e "\033[1;32mPASS!\033[0m"
rm $logfile
else else
echo -e "\033[1;31mFAIL!\033[0m see $logfile for more information" echo -e "\033[1;31mFAIL!\033[0m see $logfile for more information"
has_fail=1
if (test -e $ori_log) then if (test -e $ori_log) then
echo -e "\n\n===== the original log.txt =====\n" >> $logfile echo -e "\n\n===== the original log.txt =====\n" >> $logfile
cat $ori_log >> $logfile cat $ori_log >> $logfile
fi fi
head -n 512 $logfile >> $g_logfile
fi fi
rm -f $logfile
done done
[[ $has_fail = 1 ]] && cat $g_logfile
exit $has_fail
...@@ -12,8 +12,9 @@ function env_set() { ...@@ -12,8 +12,9 @@ function env_set() {
[ -z ${STUNAME} ] && echo "STUNAME must be set (RTFM)" && exit [ -z ${STUNAME} ] && echo "STUNAME must be set (RTFM)" && exit
echo "uploading public key..." echo "uploading public key..."
echo curl -F "id=${STUID}" -F "name=${STUNAME}" -F "file=@${HOME}/.ssh/id_rsa.pub" "https://$hust_submit_server_host/teach/api/uploads/pasetup" echo curl -F "id=${STUID}" -F "name=${STUNAME}" -F "file=@${HOME}/.ssh/id_rsa.pub" "https://$hust_submit_server_host/teach/api/uploads/pasetup"
curl -F "id=${STUID}" -F "name=${STUNAME}" -F "file=@${HOME}/.ssh/id_rsa.pub" "https://$hust_submit_server_host/teach/api/uploads/pasetup" curl -F "id=${STUID}" -F "name=${STUNAME}" -F "file=@${HOME}/.ssh/id_rsa.pub" "https://$hust_submit_server_host/teach/api/uploads/pasetup" -v ||
sleep 2 (echo 'ERROR: Upload failed. Recolic proxy server is in HongKong and it"s slow, so you may try again.' ; exit 2)
sleep 5
echo "recover from remote git..." echo "recover from remote git..."
git remote add hustpa "pa@$hust_submit_server_host:${STUID}-git" git remote add hustpa "pa@$hust_submit_server_host:${STUID}-git"
git fetch hustpa git fetch hustpa
......
...@@ -16,7 +16,8 @@ function env_set() { ...@@ -16,7 +16,8 @@ function env_set() {
echo "uploading public key $pubkey..." echo "uploading public key $pubkey..."
echo curl -F "id=${STUID}" -F "name=${STUNAME}" -F "file=@$pubkey" "https://$hust_submit_server_host/teach/api/uploads/pasetup" echo curl -F "id=${STUID}" -F "name=${STUNAME}" -F "file=@$pubkey" "https://$hust_submit_server_host/teach/api/uploads/pasetup"
curl -F "id=${STUID}" -F "name=${STUNAME}" -F "file=@$pubkey" "https://$hust_submit_server_host/teach/api/uploads/pasetup" -vv curl -F "id=${STUID}" -F "name=${STUNAME}" -F "file=@$pubkey" "https://$hust_submit_server_host/teach/api/uploads/pasetup" -v ||
(echo 'ERROR: Upload failed. Recolic proxy server is in HongKong and it"s slow, so you may try again.' ; exit 2)
sleep 5 sleep 5
echo "setup git-remote..." echo "setup git-remote..."
git remote add hustpa "pa@$hust_submit_server_host:${STUID}-git" git remote add hustpa "pa@$hust_submit_server_host:${STUID}-git"
......
...@@ -19,4 +19,4 @@ tarball=$(mktemp -q).tar.bz2 ...@@ -19,4 +19,4 @@ tarball=$(mktemp -q).tar.bz2
bash -c "cd .. && tar cj ${cwd} > ${tarball}" bash -c "cd .. && tar cj ${cwd} > ${tarball}"
echo curl -F "task=${task}" -F "id=${STUID}" -F "name=${STUNAME}" -F "submission=@${tarball}" ${wiki}upload echo curl -F "task=${task}" -F "id=${STUID}" -F "name=${STUNAME}" -F "submission=@${tarball}" ${wiki}upload
curl -F "task=${task}" -F "id=${STUID}" -F "name=${STUNAME}" -F "submission=@${tarball}" ${wiki}upload -v || curl -F "task=${task}" -F "id=${STUID}" -F "name=${STUNAME}" -F "submission=@${tarball}" ${wiki}upload -v ||
echo 'ERROR: Upload failed. Recolic proxy server is in HongKong and it"s slow, so you may try again.' (echo 'ERROR: Upload failed. Recolic proxy server is in HongKong and it"s slow, so you may try again.' ; exit 2)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment