class ECFileTests(autograde.FileTests): def make_test(self, prog, arg, ref): return self.Test(cmd=[prog, '-h', arg], input_file=arg, ref_file=ref, max_output=self.max_output) max_out = 50 * 1024 * 1024 assignment = autograde.Project( 'truthtable', autograde.FileTests(name='1', id='1.1', weight=2.5, max_output=max_out), autograde.StdinFileTests(name='1', id='1.2', weight=2.5, max_output=max_out), autograde.FileTests(name='2', id='2.1', weight=2.5), autograde.StdinFileTests(name='2', id='2.2', weight=2.5), ECFileTests(name='3', id='3', weight=1, category=autograde.EXTRA, max_output=max_out), ) if __name__ == '__main__': autograde.set_asan_symbolizer() autograde.main(assignment_name, assignment, release)
continue ref = os.path.join(data_dir, ref_name) yield autograde.FileTest( cmd=[prog, steps, file], input_file=file, ref_file=ref) assignment = autograde.MultiProject( autograde.StdinFileTests.Project("llist", weight=4), autograde.FileTests.Project("mexp", weight=4), autograde.StdinFileTests.Project("stddev", weight=4), autograde.Project("bst", autograde.StdinFileTests(id="1", weight=4), autograde.StdinFileTests(id="2", weight=2), ), LifeTests.Project("life", weight=2), autograde.Project("queens", autograde.FileTests(id="1", weight=4), autograde.FileTests(id="2", weight=4, make_cmd=lambda prog,arg: [prog, "+2", arg]), autograde.FileTests(id="3", category=autograde.EXTRA, make_cmd=lambda prog,arg: [prog, "-w", arg]), autograde.FileTests(id="4", name="3", category=autograde.EXTRA, make_cmd=lambda prog,arg: [prog, "+2", "-w", arg]), autograde.FileTests(id="1", category=autograde.USER), autograde.FileTests(id="2", category=autograde.USER, make_cmd=lambda prog,arg: [prog, "+2", arg]), autograde.FileTests(id="3", category=autograde.USER, make_cmd=lambda prog,arg: [prog, "-w", arg]),
id = ref_name[len(self.ref_prefix):-len(self.suffix)] trace, csize, assoc, bsize = id.split('.') tracefile = os.path.join(data_dir, f'trace{trace}.txt') if not os.path.exists(tracefile): autograde.logger.warning('Missing trace file for %r: %r', ref_name, tracefile) continue ref = os.path.join(data_dir, ref_name) yield autograde.FileRefTest( cmd = ['./' + prog, csize, assoc, self.repl, bsize, tracefile], ref_file = ref, category = self.category, group = test_group, weight = self.weight, dir = build_dir, ) assignment = autograde.Project('cachesim', CacheTests(id='fifo', weight=2, ref_prefix='test.'), CacheTests(id='lru', category=autograde.EXTRA, ref_prefix='test.'), user_class=None, ) if __name__ == '__main__': autograde.main(assignment_name, assignment, release)
#!/usr/bin/env python3 import autograde import os, os.path assignment_name = 'PA4' release = 1 autograde.Test.output_limit = 50 * 1024 * 1024 autograde.Test.time_limit = 60 autograde.Test.error_limit = 5 assignment = autograde.Project( "truthtable", autograde.FileTests(id="1", weight=5), autograde.FileTests(id="2", category=autograde.EXTRA)) if __name__ == '__main__': # autograde.set_asan_symbolizer() autograde.main(assignment_name, assignment, release)
#!/usr/bin/env python3 import autograde name = 'PA1' release = 2 assignment = autograde.MultiProject( autograde.StringTests.Project('roman', weight=0.625), autograde.StringTests.Project('palindrome', weight=0.625), autograde.StringTests.Project('rle', weight=0.625), autograde.StdinFileTests.Project('list', weight=2), autograde.FileTests.Project('mexp', weight=2), autograde.Project('bst', autograde.StdinFileTests(id='1', weight=1.5), autograde.StdinFileTests(id='2', weight=1.5))) if __name__ == '__main__': autograde.main(name, assignment, release)
#!/usr/bin/python import autograde import os, os.path assignment_name = 'PA4' release = 1 autograde.Test.output_limit = 50*1024*1024 autograde.Test.time_limit = 60 autograde.Test.error_limit = 5 assignment = autograde.Project("truthtable", autograde.FileTests(id="1", weight=5), autograde.FileTests(id="2", weight=5), autograde.FileTests(id="3", weight=5) ) if __name__ == '__main__': autograde.set_asan_symbolizer() autograde.main(assignment_name, assignment, release)
tracefile = os.path.join(data_dir, 'trace' + trace + '.txt') if not os.path.exists(tracefile): autograde.logger.warning('Unmatched reference file: %r', ref_name) continue ref = os.path.join(data_dir, ref_name) yield autograde.FileRefTest( cmd=[ prog, csize, assoc, self.pref, self.repl, bsize, tracefile ], ref_file=ref, ) assignment = autograde.Project( 'cachesim', CacheTests(id='fifo.p0', weight=2.5), CacheTests(id='fifo.p1', weight=2.5), CacheTests(id='lru.p0', category=autograde.EXTRA), CacheTests(id='lru.p1', category=autograde.EXTRA), user_class=None, ) if __name__ == '__main__': autograde.set_asan_symbolizer() autograde.main(assignment_name, assignment, release)