Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
bisqwit committed Jun 14, 2022
1 parent d0914a6 commit ab644f3
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 13 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ compress3:

$(GTEST):
cmake -S googletest -B googletest/build
- $(MAKE) -C googletest/build
$(MAKE) -C googletest/build

-include $(addprefix .deps/,$(subst /,_,$(OBJS_BUILD:.o=.d)))
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Check out the code from Git:

git clone https://github.com/bisqwit/that_terminal
cd that_terminal
git checkout origin/hy -b hy
git submodule update --init --recursive # Do not forget this step!

To compile, type `make -j4`. To run, type `./term` after compiling.
Expand All @@ -66,12 +67,12 @@ significantly.
## Documentation

* [Doxygen autogenerated documentation](https://bisqwit.github.io/that_terminal/)
* [Architectural description](doc/architecture.md)
* [Working time log](doc/timeusage.md)
* [Supported keyboard inputs](doc/inputs.md)
* [Supported fonts](doc/fonts.md)
* [Supported escape codes](doc/escapes.md)
* [Testing](doc/testing.md)
* [Working time log](doc/timeusage.md)
* [Architecture](doc/architecture.md)
* [Testing](doc/testing.md) ([test results](doc/test-report.txt), [coverage](https://bisqwit.github.io/that_terminal/cov/index.html))

## Instructions of use

Expand Down
26 changes: 26 additions & 0 deletions doc/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,32 @@ and it uses libSDL2 for rendering and for event handling.

## Application logic

```mermaid
classDiagram
class ForkPTY
class TerminalWindow
class Window
class UI
class FontPlan
ForkPTY : Open(width, height)
ForkPTY : Send(string)
ForkPTY : Recv() string
TerminalWindow : Write(string)
Window : cells
Window : blank
Window : Render(fontwidth,fontheight, pixels)
FontPlan : Create(fontwidth,fontheight, firstchar, numchars)
FontPlan : LoadGlyph(index, scanline, renderwidth) Glyph
Window <-- FontPlan
UI <--> ForkPTY
ForkPTY --> TerminalWindow
TerminalWindow --> Window
Window --> UI
FontsInfo --> FontPlan
ParseSimilarities --> FontPlan
GlyphList --> FontsInfo
```

The core of the application is founded upon three classes:
[ForkPTY](../src/tty/forkpty.cc),
[TerminalWindow](../src/tty/terminal.cc)
Expand Down
4 changes: 4 additions & 0 deletions doc/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Summary:
[==========] 65 tests from 16 test suites ran. (142382 ms total)
[ PASSED ] 65 tests.

To redo tests, do `make test`. The output will be saved to `doc/test-report.txt`.

## Coverage testing

Coverage testing is performed using a GCOV.
Expand All @@ -26,6 +28,8 @@ Additionally, coverage-testing is performed for the unit-testing binary.
The testing results can be found here:
* [Test results](https://bisqwit.github.io/that_terminal/cov/index.html)

To redo tests, do `make test`. The output will be saved to `doc/doxygen/docs/cov/`.

## Practical testing

This software is used for video making purposes by the author from time to time.
Expand Down
16 changes: 8 additions & 8 deletions src/ctype.cc
Original file line number Diff line number Diff line change
Expand Up @@ -619,13 +619,13 @@ TEST(ctype, charconv_tests)
}
TEST(ctype, count_indent)
{
EXPECT_EQ(CountIndent(U""), 0);
EXPECT_EQ(CountIndent(U"s t "), 0);
EXPECT_EQ(CountIndent(U" s t "), 4);
EXPECT_EQ(CountIndent(U" "), 4);
EXPECT_EQ(CountIndent(U" ", 1), 3);
EXPECT_EQ(CountIndent(U" s t ", 5), 4);
EXPECT_EQ(CountIndent(U" s t ", 7), 2);
EXPECT_EQ(CountIndent(std::u32string(150000, U' ')), 150000);
EXPECT_EQ(CountIndent(U""), 0u);
EXPECT_EQ(CountIndent(U"s t "), 0u);
EXPECT_EQ(CountIndent(U" s t "), 4u);
EXPECT_EQ(CountIndent(U" "), 4u);
EXPECT_EQ(CountIndent(U" ", 1), 3u);
EXPECT_EQ(CountIndent(U" s t ", 5), 4u);
EXPECT_EQ(CountIndent(U" s t ", 7), 2u);
EXPECT_EQ(CountIndent(std::u32string(150000, U' ')), 150000u);
}
#endif
1 change: 1 addition & 0 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ namespace
int main(int argc, char** argv)
{
/* Set up */
argc=argc;
SaveArg0(argv[0]);
SetTimeFactor(TimeFactor);

Expand Down
2 changes: 1 addition & 1 deletion src/rendering/cset.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ TEST(TranslateCSet, one_ok)
for(unsigned a=0; a<0x5F; ++a) EXPECT_EQ(TranslateCSet(a,1), a);
for(unsigned a=0x7F; a<512; ++a) EXPECT_EQ(TranslateCSet(a,1), a);
for(unsigned a=0x5F; a<0x7E; ++a) EXPECT_NE(TranslateCSet(a,1), a);
EXPECT_EQ(TranslateCSet(0x61, 1), 0x2592);
EXPECT_EQ(TranslateCSet(0x61, 1), 0x2592u);
}
#endif
2 changes: 1 addition & 1 deletion src/rendering/person.cc
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,6 @@ TEST(person, pose_varies)
frames.insert( PersonFrame() );
AdvanceTime(1.0 / 32.0);
}
EXPECT_EQ(frames.size(), 2);
EXPECT_EQ(frames.size(), 2u);
}
#endif

0 comments on commit ab644f3

Please sign in to comment.