Using same stdout/stderr files for multiple tests?

I have a test that I want to run with different compile and runtime parameters. I managed to reuse the source file across different tests by adding a extra_files(['source.hs']) to the tests, but I don't know how to do the same for stdout/stderr files. Any ideas? In more details, I have test.hs test.stdout and two tests test('test', [extra_run_opts('...')], compile_and_run, []) test('test_debug', [extra_run_opts('...'), extra_hc_opts('-debug'), extra_files(['test.hs'])], compile_and_run, []) The first test works fine, but the second test fails because I don't know how to tell it to use test.stdout as the stdout file and it looks for test_debug.stdout. Thanks Ömer

Ömer Sinan Ağacan
I have a test that I want to run with different compile and runtime parameters. I managed to reuse the source file across different tests by adding a extra_files(['source.hs']) to the tests, but I don't know how to do the same for stdout/stderr files. Any ideas?
In more details, I have
test.hs test.stdout
and two tests
test('test', [extra_run_opts('...')], compile_and_run, [])
test('test_debug', [extra_run_opts('...'), extra_hc_opts('-debug'), extra_files(['test.hs'])], compile_and_run, [])
The first test works fine, but the second test fails because I don't know how to tell it to use test.stdout as the stdout file and it looks for test_debug.stdout.
This is probably no longer relevant but: I don't believe there is a way to do this. I would likely make test_debug.stdout a symlink to test.stdout. Cheers, - Ben

These days when I need something like this I just use a make rule, which is not
great as you have to run multiple tests in one make rule and you can't run only
one with the TESTS parameter or skip some of the tests.
Another problem is I can't have multiple tests that use single source file,
again I have to use a make rule.
Ömer
Ben Gamari
Ömer Sinan Ağacan
writes: I have a test that I want to run with different compile and runtime parameters. I managed to reuse the source file across different tests by adding a extra_files(['source.hs']) to the tests, but I don't know how to do the same for stdout/stderr files. Any ideas?
In more details, I have
test.hs test.stdout
and two tests
test('test', [extra_run_opts('...')], compile_and_run, [])
test('test_debug', [extra_run_opts('...'), extra_hc_opts('-debug'), extra_files(['test.hs'])], compile_and_run, [])
The first test works fine, but the second test fails because I don't know how to tell it to use test.stdout as the stdout file and it looks for test_debug.stdout.
This is probably no longer relevant but:
I don't believe there is a way to do this. I would likely make test_debug.stdout a symlink to test.stdout.
Cheers,
- Ben

Hi Omer, If you frequently require this it would be a trivial thing to add, it's a small modification to find_expected_file, I can probably find some time next week to do this for you if you want.
I don't believe there is a way to do this. I would likely make test_debug.stdout a symlink to test.stdout.
Please don't, the symlinks won't persist on Windows where we'll end up with
file copies instead, which goes horribly wrong once you modify one of them.
Regards,
Tamar
On Wed, Jan 23, 2019 at 4:44 AM Ömer Sinan Ağacan
These days when I need something like this I just use a make rule, which is not great as you have to run multiple tests in one make rule and you can't run only one with the TESTS parameter or skip some of the tests.
Another problem is I can't have multiple tests that use single source file, again I have to use a make rule.
Ömer
Ben Gamari
, 23 Oca 2019 Çar, 02:44 tarihinde şunu yazdı: Ömer Sinan Ağacan
writes: I have a test that I want to run with different compile and runtime
I managed to reuse the source file across different tests by adding a extra_files(['source.hs']) to the tests, but I don't know how to do
parameters. the same for
stdout/stderr files. Any ideas?
In more details, I have
test.hs test.stdout
and two tests
test('test', [extra_run_opts('...')], compile_and_run, [])
test('test_debug', [extra_run_opts('...'), extra_hc_opts('-debug'), extra_files(['test.hs'])], compile_and_run, [])
The first test works fine, but the second test fails because I don't know how to tell it to use test.stdout as the stdout file and it looks for test_debug.stdout.
This is probably no longer relevant but:
I don't believe there is a way to do this. I would likely make test_debug.stdout a symlink to test.stdout.
Cheers,
- Ben
ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Actually, I had a few minutes to spare on the train so
https://gitlab.haskell.org/ghc/ghc/merge_requests/226 :)
Cheers,
Tamar
On Sun, Jan 27, 2019 at 4:36 PM Phyx
Hi Omer,
If you frequently require this it would be a trivial thing to add, it's a small modification to find_expected_file, I can probably find some time next week to do this for you if you want.
I don't believe there is a way to do this. I would likely make test_debug.stdout a symlink to test.stdout.
Please don't, the symlinks won't persist on Windows where we'll end up with file copies instead, which goes horribly wrong once you modify one of them.
Regards, Tamar
On Wed, Jan 23, 2019 at 4:44 AM Ömer Sinan Ağacan
wrote: These days when I need something like this I just use a make rule, which is not great as you have to run multiple tests in one make rule and you can't run only one with the TESTS parameter or skip some of the tests.
Another problem is I can't have multiple tests that use single source file, again I have to use a make rule.
Ömer
Ben Gamari
, 23 Oca 2019 Çar, 02:44 tarihinde şunu yazdı: Ömer Sinan Ağacan
writes: I have a test that I want to run with different compile and runtime
I managed to reuse the source file across different tests by adding a extra_files(['source.hs']) to the tests, but I don't know how to do
parameters. the same for
stdout/stderr files. Any ideas?
In more details, I have
test.hs test.stdout
and two tests
test('test', [extra_run_opts('...')], compile_and_run, [])
test('test_debug', [extra_run_opts('...'), extra_hc_opts('-debug'), extra_files(['test.hs'])], compile_and_run, [])
The first test works fine, but the second test fails because I don't know how to tell it to use test.stdout as the stdout file and it looks for test_debug.stdout.
This is probably no longer relevant but:
I don't believe there is a way to do this. I would likely make test_debug.stdout a symlink to test.stdout.
Cheers,
- Ben
ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
participants (3)
-
Ben Gamari
-
Phyx
-
Ömer Sinan Ağacan