Skip to content

Commit

Permalink
Build release statically on macos (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
MasloMaslane authored Sep 10, 2024
1 parent 04fdbf3 commit cbef5ab
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
uses: Homebrew/actions/setup-homebrew@master
- name: Install dependencies
run: |
brew install meson ninja gcc@13
brew install meson ninja
- name: Build
run: |
LDFLAGS='-static' CXX=g++-13 meson setup build --debug --warnlevel 3 --werror -Dcpp_debugstl=true
LDFLAGS='-static' meson setup build --debug --warnlevel 3 --werror -Dcpp_debugstl=true
ninja -C build
- name: Test
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
uses: Homebrew/actions/setup-homebrew@master
- name: Install dependencies
run: |
brew install meson ninja gcc@13
brew install meson ninja
- name: Build
run: |
CXX=g++-13 meson setup build --debug --warnlevel 3 --werror -Dcpp_debugstl=true
meson setup build --debug --warnlevel 3 --werror -Dcpp_debugstl=true
ninja -C build
- name: Test
run: |
Expand Down
37 changes: 19 additions & 18 deletions tests.hh
Original file line number Diff line number Diff line change
Expand Up @@ -67,47 +67,48 @@ struct test_translation_case

constexpr auto test_cases = std::array{
// Identical
test_case{success{}, ""sv, ""sv},
test_case{success{}, "ABC"sv, "ABC"sv},
test_case{success{}, "ABC\nDEF\n"sv, "ABC\nDEF\n"sv},
test_case{{success{}}, ""sv, ""sv},
test_case{{success{}}, "ABC"sv, "ABC"sv},
test_case{{success{}}, "ABC\nDEF\n"sv, "ABC\nDEF\n"sv},

// Equivalent whitespace
test_case{success{}, "A B C D E"sv, "A B\tC\0D\rE"sv},
test_case{{success{}}, "A B C D E"sv, "A B\tC\0D\rE"sv},

// Excessive whitespace
test_case{success{}, "A B"sv, "A B \t\0\r"sv},
test_case{success{}, "A\0B"sv, "\0\t A \r \0B\t\t\t"sv},
test_case{{success{}}, "A B"sv, "A B \t\0\r"sv},
test_case{{success{}}, "A\0B"sv, "\0\t A \r \0B\t\t\t"sv},

// Trailing newlines
test_case{success{}, "A\nB\nC"sv, "A\nB\nC\n\n\n\n\n\n\n\n\n\n"sv},
test_case{success{}, "A\n\n\n"sv, "A\n\n\n\n\n"sv},
test_case{{success{}}, "A\nB\nC"sv, "A\nB\nC\n\n\n\n\n\n\n\n\n\n"sv},
test_case{{success{}}, "A\n\n\n"sv, "A\n\n\n\n\n"sv},

// Simply wrong
test_case{failure{1, {token_type::eof, 0, 0}, {token_type::word, 0, 8}},
test_case{{failure{1, {token_type::eof, 0, 0}, {token_type::word, 0, 8}}},
""sv, "NONEMPTY"sv},
test_case{failure{1, {token_type::word, 0, 3}, {token_type::word, 0, 2}},
test_case{{failure{1, {token_type::word, 0, 3}, {token_type::word, 0, 2}}},
"YES"sv, "NO"sv},
test_case{failure{1, {token_type::word, 0, 3}, {token_type::word, 0, 3}},
test_case{{failure{1, {token_type::word, 0, 3}, {token_type::word, 0, 3}}},
"TAK"sv, "NIE"sv},
test_case{failure{1, {token_type::word, 0, 1}, {token_type::word, 0, 1}},
test_case{{failure{1, {token_type::word, 0, 1}, {token_type::word, 0, 1}}},
"0"sv, "1"sv},
test_case{failure{1, {token_type::word, 0, 4}, {token_type::word, 0, 2}},
test_case{{failure{1, {token_type::word, 0, 4}, {token_type::word, 0, 2}}},
"NONE"sv, "-1"sv},
test_case{failure{1, {token_type::word, 0, 3}, {token_type::word, 0, 3}},
test_case{{failure{1, {token_type::word, 0, 3}, {token_type::word, 0, 3}}},
"123"sv, "456"sv},
test_case{failure{1, {token_type::word, 0, 1}, {token_type::word, 0, 32}},
test_case{
{failure{1, {token_type::word, 0, 1}, {token_type::word, 0, 32}}},
"1"sv, "1.000000000000000000000000000001"sv},
test_case{failure{1, {token_type::word, 4, 5}, {token_type::word, 4, 5}},
test_case{{failure{1, {token_type::word, 4, 5}, {token_type::word, 4, 5}}},
"1 2 3 4"sv, "1 2 4 3"sv},

// Different arrangement of lines
test_case{
failure{1, {token_type::word, 2, 3}, {token_type::newline, 1, 2}},
{failure{1, {token_type::word, 2, 3}, {token_type::newline, 1, 2}}},
"A B"sv, "A\nB"sv},

// Bug of original compare which would consider these equal
test_case{
failure{1, {token_type::word, 0, 101}, {token_type::word, 0, 100}},
{failure{1, {token_type::word, 0, 101}, {token_type::word, 0, 100}}},
REP100 ("A"sv) "B"sv, REP100 ("A"sv) " B"sv},
};

Expand Down

0 comments on commit cbef5ab

Please sign in to comment.