Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Fix gen-file.sh: it wasn't globbing properly. #1773

Merged
merged 1 commit into from
Dec 14, 2021
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
6 changes: 5 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ jobs:
cppcheck
g++
libconfig-dev
libgtest-dev
libopus-dev
libsodium-dev
libvpx-dev
Expand Down Expand Up @@ -110,4 +111,7 @@ jobs:
libsodium-dev
libvpx-dev
- run: cmake . -B_build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- run: other/analysis/run-clang-tidy
- run:
other/analysis/run-clang-tidy ||
other/analysis/run-clang-tidy ||
other/analysis/run-clang-tidy
5 changes: 3 additions & 2 deletions other/analysis/gen-file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ CPPFLAGS+=("-Itoxcore")
CPPFLAGS+=("-Itoxav")
CPPFLAGS+=("-Itoxencryptsave")

LDFLAGS=("-lopus" "-lsodium" "-lvpx" "-lpthread" "-lconfig")
LDFLAGS=("-lopus" "-lsodium" "-lvpx" "-lpthread" "-lconfig" "-lgtest")
LDFLAGS+=("-fuse-ld=gold")
LDFLAGS+=("-Wl,--detect-odr-violations")
LDFLAGS+=("-Wl,--warn-common")
Expand Down Expand Up @@ -44,12 +44,13 @@ callmain() {

put auto_tests/check_compat.h

FIND_QUERY="find . '-(' -name '*.c' -or -name "*.cc" '-)'"
FIND_QUERY="find . '-(' -name '*.c' -or -name '*.cc' '-)'"
FIND_QUERY="$FIND_QUERY -and -not -wholename './_build/*'"
FIND_QUERY="$FIND_QUERY -and -not -wholename './super_donators/*'"
FIND_QUERY="$FIND_QUERY -and -not -name amalgamation.cc"
FIND_QUERY="$FIND_QUERY -and -not -name av_test.c"
FIND_QUERY="$FIND_QUERY -and -not -name dht_test.c"
FIND_QUERY="$FIND_QUERY -and -not -name trace.cc"
FIND_QUERY="$FIND_QUERY -and -not -name version_test.c"

readarray -t FILES <<<"$(eval "$FIND_QUERY")"
Expand Down
1 change: 1 addition & 0 deletions other/analysis/run-clang
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ clang++ -o /dev/null amalgamation.cc \
-Wno-covered-switch-default \
-Wno-disabled-macro-expansion \
-Wno-documentation-deprecated-sync \
-Wno-global-constructors \
-Wno-missing-field-initializers \
-Wno-old-style-cast \
-Wno-padded \
Expand Down
6 changes: 3 additions & 3 deletions toxcore/crypto_core_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ std::pair<clock_t, clock_t> memcmp_median(uint8_t const *src, uint8_t const *sam
*/
TEST(CryptoCore, MemcmpTimingIsDataIndependent) {
// A random piece of memory.
std::array<uint8_t, CRYPTO_TEST_MEMCMP_SIZE> src;
std::vector<uint8_t> src(CRYPTO_TEST_MEMCMP_SIZE);
random_bytes(src.data(), CRYPTO_TEST_MEMCMP_SIZE);

// A separate piece of memory containing the same data.
std::array<uint8_t, CRYPTO_TEST_MEMCMP_SIZE> same = src;
std::vector<uint8_t> same = src;

// Another piece of memory containing different data.
std::array<uint8_t, CRYPTO_TEST_MEMCMP_SIZE> not_same;
std::vector<uint8_t> not_same(CRYPTO_TEST_MEMCMP_SIZE);
random_bytes(not_same.data(), CRYPTO_TEST_MEMCMP_SIZE);

// Once we have C++17:
Expand Down