Граф коммитов

19 Коммитов

Автор SHA1 Сообщение Дата
Nicholas Nethercote d088f9e9e0 Change `FileInfo` field order.
Because I decided I prefer it this way.
2019-12-04 13:25:33 +11:00
Nicholas Nethercote e134f416cc Split up `build_file_info`.
This makes it easier to read, and will be helpful for adding Mac
support.
2019-12-04 13:16:41 +11:00
Nicholas Nethercote a28cb41769 Improve how input lines with bad files are handled.
For the reasons explained in the new comment.
2019-12-04 13:16:37 +11:00
Nicholas Nethercote 97cb23ef0b Eliminate the `msg` closure from `Fixer::build_file_info`.
This makes the code a little simpler, and will also make it easier to
split `build_file_info` into more functions.
2019-12-04 12:01:17 +11:00
Nicholas Nethercote 5f60163542
Merge pull request #9 from nnethercote/two-clean-ups
Two clean-ups
2019-12-03 12:15:30 +11:00
Nicholas Nethercote f5c0c05db2 Introduce `FuncInfo::new` and `LineInfo::new`. 2019-11-27 10:29:18 +11:00
Nicholas Nethercote 17f45a8cca Introduce `PRINT_LINES_AND_FUNCS`.
This is a nicer way of controlling the test-generating `eprintln!`
calls.
2019-11-27 10:12:51 +11:00
Nicholas Nethercote 29d5832809
Merge pull request #8 from nnethercote/add-windows-support
Add windows support
2019-11-27 09:55:58 +11:00
Nicholas Nethercote 2a25267ace Split `FileInfo::new` off from `Fixer::build_file_info`. 2019-11-27 09:47:07 +11:00
Nicholas Nethercote ce889579f8 Add windows support.
The commit also removes the JSON test, because JSON escaping is now done
with the Windows test due to the use of backslashes in Windows path
names.

And it adds some documentation about how the test inputs were created,
because it's not obvious and worth recording.

Fixes #4.
2019-11-25 14:22:13 +11:00
Nicholas Nethercote 6a6f574b4e Sort func_infos when they are constructed.
They're mostly in order, but not entirely. This is important because we
later do binary search on them!
2019-11-22 15:13:39 +11:00
Nicholas Nethercote c6c9464211
Merge pull request #7 from nnethercote/fix-windows-test-problem
Fix a Windows-only problem with the test.
2019-11-22 09:44:06 +11:00
Nicholas Nethercote e7e135a920 Fix a Windows-only problem with the test.
Git on Windows can't handle the filename `example\"json.c`! Sigh.
2019-11-22 09:37:57 +11:00
Nicholas Nethercote 3a1c46bdf8
Merge pull request #6 from nnethercote/json-escaping
Add the ability to do JSON escaping of printed file and function names.
2019-11-22 08:58:46 +11:00
Nicholas Nethercote 6ac6cbdc27 Add the ability to do JSON escaping of printed file and function names.
This is necessary for DMD, which puts file names and function names
within JSON strings.

For testing I had to add a new test binary with the awkward name of
`example"json`, which requires escaping of the '"' char.
2019-11-22 08:55:51 +11:00
Nicholas Nethercote 311b2dafed
Merge pull request #5 from nnethercote/overhaul-test
Overhaul the test.
2019-11-20 08:51:16 +11:00
Nicholas Nethercote c13897f4fa Overhaul the test.
- Change the test to use C binary, which is 17 KB, compared to 2.6 MB
  for the Rust binary. (Due to Rust's use of static linking.)

- Rename the binary from `example` to `example-linux`, to allow for
  other platforms in the future. Likewise renames the test function from
  `test1` to `test_linux`.

- Add (commented out) the `eprintln!` statements from which I
  constructed the test.

- Change the `tests/EXAMPLE` entry to `tests/no-such-file`. On Windows
  and Mac this test was failing because those OSes have case-insensitive
  filenames, and so `EXAMPLE` was matching the existing `example` file!
  (The abovementioned renaming of `example` to `example-linux` would
  have been enough, but `no-such-file` is clearer in general.)

- Add a license notice to `src/tests.rs`.
2019-11-19 13:42:33 +11:00
Nicholas Nethercote 6c28eb0788 Initial Linux support.
Mac and Windows are to be done later.
2019-11-18 10:33:41 +11:00
Nicholas Nethercote 128b5d5c07
Initial commit 2019-11-15 08:46:01 +11:00