Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,23 @@ jobs:
name: "Install coreutils (for md5sum)"
run: "brew install coreutils"

- if: "matrix.os == 'ubuntu-20.04'"
name: "Install gcc-10 (for c++20)"
run: |-
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
g++-10 \
gcc-10
sudo ln --symbolic --force /usr/bin/gcc-10 /usr/bin/cc
sudo ln --symbolic --force /usr/bin/g++-10 /usr/bin/c++
sudo ln --symbolic --force /usr/bin/cpp-10 /usr/bin/cpp

- name: "Log tool versions"
run: |-
md5sum --version
python --version
tar --version
task --version
command -v md5sum
command -v python
command -v tar
command -v task

# TODO: Change the task to run all unittests once any unittest is added. Until then we check
# that building the project succeeds.
Expand Down
11 changes: 10 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
#include <concepts>
#include <iostream>
#include <ystdlib/testlib/hello.hpp>

namespace {
template <typename T>
requires std::integral<T>
[[nodiscard]] auto square(T x) -> T {
return x * x;
}
}; // namespace

[[nodiscard]] auto main() -> int {
std::cout << ystdlib::testlib::hello() << '\n';
std::cout << square(ystdlib::testlib::hello().size()) << '\n';
return 0;
}