equal
deleted
inserted
replaced
141 dest='regression_tests', type="string") |
141 dest='regression_tests', type="string") |
142 opt.add_option('--enable-sudo', |
142 opt.add_option('--enable-sudo', |
143 help=('Use sudo to setup suid bits on ns3 executables.'), |
143 help=('Use sudo to setup suid bits on ns3 executables.'), |
144 dest='enable_sudo', action='store_true', |
144 dest='enable_sudo', action='store_true', |
145 default=False) |
145 default=False) |
|
146 opt.add_option('--with-regression-traces', |
|
147 help=('Path to the regression reference traces directory'), |
|
148 default=None, |
|
149 dest='regression_traces', type="string") |
146 |
150 |
147 # options provided in a script in a subdirectory named "src" |
151 # options provided in a script in a subdirectory named "src" |
148 opt.sub_options('src') |
152 opt.sub_options('src') |
149 opt.sub_options('bindings/python') |
153 opt.sub_options('bindings/python') |
150 opt.sub_options('src/internet-stack') |
154 opt.sub_options('src/internet-stack') |
190 variant_name = 'debug' |
194 variant_name = 'debug' |
191 else: |
195 else: |
192 variant_name = debug_level |
196 variant_name = debug_level |
193 |
197 |
194 variant_env['INCLUDEDIR'] = os.path.join(variant_env['PREFIX'], 'include') |
198 variant_env['INCLUDEDIR'] = os.path.join(variant_env['PREFIX'], 'include') |
|
199 |
|
200 if Params.g_options.regression_traces is not None: |
|
201 variant_env['REGRESSION_TRACES'] = os.path.join("..", Params.g_options.regression_traces) |
|
202 else: |
|
203 variant_env['REGRESSION_TRACES'] = None |
195 |
204 |
196 if Params.g_options.enable_gcov: |
205 if Params.g_options.enable_gcov: |
197 variant_name += '-gcov' |
206 variant_name += '-gcov' |
198 variant_env.append_value('CCFLAGS', '-fprofile-arcs') |
207 variant_env.append_value('CCFLAGS', '-fprofile-arcs') |
199 variant_env.append_value('CCFLAGS', '-ftest-coverage') |
208 variant_env.append_value('CCFLAGS', '-ftest-coverage') |
461 _run_waf_check() |
470 _run_waf_check() |
462 |
471 |
463 if Params.g_options.regression or Params.g_options.regression_generate: |
472 if Params.g_options.regression or Params.g_options.regression_generate: |
464 if not env['DIFF']: |
473 if not env['DIFF']: |
465 Params.fatal("Cannot run regression tests: the 'diff' program is not installed.") |
474 Params.fatal("Cannot run regression tests: the 'diff' program is not installed.") |
|
475 |
466 _dir = os.getcwd() |
476 _dir = os.getcwd() |
467 os.chdir("regression") |
477 os.chdir("regression") |
|
478 regression_traces = env['REGRESSION_TRACES'] |
|
479 if not regression_traces: |
|
480 regression_traces = None |
468 try: |
481 try: |
469 regression.run_regression() |
482 regression.run_regression(regression_traces) |
470 finally: |
483 finally: |
471 os.chdir(_dir) |
484 os.chdir(_dir) |
472 |
485 |
473 if Params.g_options.lcov_report: |
486 if Params.g_options.lcov_report: |
474 lcov_report() |
487 lcov_report() |