Deleted Added
sdiff udiff text old ( 4936:b05a404dce16 ) new ( 4937:04ace9ab855e )
full compact
1# -*- mode:python -*-
2
3# Copyright (c) 2004-2006 The Regents of The University of Michigan
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

--- 88 unchanged lines hidden (view full) ---

97testAction = env.Action(check_test, check_test_string)
98
99def print_test(target, source, env):
100 print '***** ' + contents(source[0])
101 return 0
102
103printAction = env.Action(print_test, strfunction = None)
104
105def update_test(target, source, env):
106 """Update reference test outputs.
107
108 Target is phony. First two sources are the ref & new m5stats.txt
109 files, respectively. We actually copy everything in the
110 respective directories except the status & diff output files.
111
112 """
113 dest_dir = str(source[0].get_dir())
114 src_dir = str(source[1].get_dir())
115 dest_files = os.listdir(dest_dir)
116 src_files = os.listdir(src_dir)
117 for f in ('stdout', 'stderr', 'm5stats.txt', 'config.ini'):
118 if f in dest_files:
119 print " Replacing file", f
120 dest_files.remove(f)
121 else:
122 print " Creating new file", f
123 copyAction = Copy(os.path.join(dest_dir, f), os.path.join(src_dir, f))
124 copyAction.strfunction = None
125 Execute(copyAction)
126 # warn about any files in dest not overwritten (other than SCCS dir)
127 if 'SCCS' in dest_files:
128 dest_files.remove('SCCS')
129 if dest_files:
130 print "Warning: file(s) in", dest_dir, "not updated:",
131 print ', '.join(dest_files)
132 return 0
133
134def update_test_string(target, source, env):
135 return env.subst("Updating ${SOURCES[0].dir} from ${SOURCES[1].dir}",
136 target=target, source=source)
137
138updateAction = env.Action(update_test, update_test_string)
139

--- 80 unchanged lines hidden ---