资源简介
MIT JOS Lab2: Memory Management,上海交通大学最新版本的JOS Lab2完整版代码,80分测试满分
详细解析地址:https://blog.csdn.net/qq_32473685/article/details/99625128
代码片段和文件信息
from __future__ import print_function
import sys os re time socket select subprocess errno shutil traceback
from subprocess import check_call Popen
from optparse import OptionParser
__all__ = []
##################################################################
# Test structure
#
__all__ += [“test“ “end_part“ “run_tests“ “get_current_test“]
TESTS = []
TOTAL = POSSIBLE = 0
PART_TOTAL = PART_POSSIBLE = 0
CURRENT_TEST = None
def test(points title=None parent=None):
“““Decorator for declaring test functions. If title is None the
title of the test will be derived from the function name by
stripping the leading “test_“ and replacing underscores with
spaces.“““
def register_test(fn title=title):
if not title:
assert fn.__name__.startswith(“test_“)
title = fn.__name__[5:].replace(“_“ “ “)
if parent:
title = “ “ + title
def run_test():
global TOTAL POSSIBLE CURRENT_TEST
# Handle test dependencies
if run_test.complete:
return
run_test.complete = True
if parent:
parent()
# Run the test
fail = None
start = time.time()
CURRENT_TEST = run_test
sys.stdout.write(“%s: “ % title)
sys.stdout.flush()
try:
fn()
except Assertionerror as e:
fail = ““.join(traceback.format_exception_only(type(e) e))
# Display and handle test result
POSSIBLE += points
if points:
print(“%s“ % \
(color(“red“ “FAIL“) if fail else color(“green“ “OK“)) end=‘ ‘)
if time.time() - start > 0.1:
print(“(%.1fs)“ % (time.time() - start) end=‘ ‘)
print()
if fail:
print(“ %s“ % fail.replace(“\n“ “\n “))
else:
TOTAL += points
for callback in run_test.on_finish:
callback(fail)
CURRENT_TEST = None
# Record test metadata on the test wrapper function
run_test.__name__ = fn.__name__
run_test.title = title
run_test.complete = False
run_test.on_finish = []
TESTS.append(run_test)
return run_test
return register_test
def end_part(name):
def show_part():
global PART_TOTAL PART_POSSIBLE
print(“Part %s score: %d/%d“ % \
(name TOTAL - PART_TOTAL POSSIBLE - PART_POSSIBLE))
print()
PART_TOTAL PART_POSSIBLE = TOTAL POSSIBLE
show_part.title = ““
TESTS.append(show_part)
def run_tests():
“““Set up for testing and run the registered test functions.“““
# Handle command line
global options
parser = OptionParser(usage=“usage: %prog [-v] [filters...]“)
parser.add_option(“-v“ “--verbose“ action=“store_true“
help=“prin
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-08-21 18:52 jos_lab2\
文件 6799 2019-08-21 18:51 jos_lab2\GNUmakefile
目录 0 2019-08-21 18:52 jos_lab2\obj\
目录 0 2019-08-21 18:51 jos_lab2\obj\kern\
文件 12948 2019-08-21 18:51 jos_lab2\obj\kern\console.o
文件 5120000 2019-08-21 18:52 jos_lab2\obj\kern\kernel.img
文件 10124 2019-08-21 18:51 jos_lab2\obj\kern\printfmt.o
文件 3388 2019-08-21 18:51 jos_lab2\obj\kern\readline.o
文件 36340 2019-08-21 18:51 jos_lab2\obj\kern\pmap.o
文件 38104 2019-08-21 18:51 jos_lab2\obj\kern\entry.o
文件 3184 2019-08-21 18:51 jos_lab2\obj\kern\kclock.o
文件 2238 2019-08-21 18:51 jos_lab2\obj\kern\kernel.sym
文件 7748 2019-08-21 18:51 jos_lab2\obj\kern\kdebug.o
文件 11444 2019-08-21 18:51 jos_lab2\obj\kern\monitor.o
文件 16532 2019-08-21 18:51 jos_lab2\obj\kern\entrypgdir.o
文件 3688 2019-08-21 18:51 jos_lab2\obj\kern\printf.o
文件 332069 2019-08-21 18:51 jos_lab2\obj\kern\kernel.asm
文件 6896 2019-08-21 18:51 jos_lab2\obj\kern\init.o
文件 108616 2019-08-21 18:51 jos_lab2\obj\kern\kernel
文件 8904 2019-08-21 18:51 jos_lab2\obj\kern\string.o
文件 40 2019-08-21 18:52 jos_lab2\obj\.vars.KERN_LDFLAGS
目录 0 2019-08-21 18:52 jos_lab2\obj\boot\
文件 5680 2019-08-21 18:52 jos_lab2\obj\boot\main.o
文件 512 2019-08-21 18:52 jos_lab2\obj\boot\boot
文件 1780 2019-08-21 18:52 jos_lab2\obj\boot\boot.o
文件 14003 2019-08-21 18:52 jos_lab2\obj\boot\boot.asm
文件 5825 2019-08-21 18:52 jos_lab2\obj\boot\boot.out
文件 1 2019-08-21 18:52 jos_lab2\obj\.vars.INIT_CFLAGS
文件 1490 2019-08-21 18:52 jos_lab2\obj\.deps
文件 177 2019-08-21 18:52 jos_lab2\obj\.vars.KERN_CFLAGS
文件 214 2019-08-21 18:52 jos_lab2\.dir-locals.el
............此处省略112个文件信息
相关资源
- 连接二值图像中断开的点
- 基于LabView的摄像采集和图像处理程序
- 车牌倾斜校正
- 卷积编解码,实现了2/33/4删余卷积
- labview 实现变声功能
- labview实现录音的程序
- 有源电力滤波器APF
- RBF神经网络预测
- labview把图片转halcon图片
- 基于LabVIEW快速傅立叶变换
- 显示图像的LABVIEW上位机
- labview ni-visa usb通讯
- labview 电子签名画板
- labview虚拟心电采集系统设计
- 基于labview的温度采集vi
- labview编写的串口调试助手
- 振动信号数据采集
- 多标签图割算法
- OMRON PLC LabVIEW Driver
- Labview 读取DXF文本
- Labview局域网UDP通讯-发送接收数组字符
- 【转】基于labview的扫雷小游戏53152
- 基于模糊控制和PID结合的倒立摆仿真
- labview官方链接
- labview带通滤波
- 基于LabVIEW的数据库管理系统.pdf
- 基本风+阵风+噪声风+渐变风联合仿真
- LabVIEW的图形控件中游标与曲线的交点
- perflab实验报告
- 图像二值化labview
评论
共有 条评论