u/Entire-Comment8241

googletest: Test project /home/andrew/x86/win32/p2pClient/buildNo tests were found!!!

I coded this p2p client application with librats and now I want to test it with googletest but after running ctest into the build directory I got this exception:

Test project /home/andrew/x86/win32/p2pClient/build

No tests were found!!!

My cMakeLists.txt:

cmake_minimum_required(
VERSION
 3.14)
project(p2pClient)


# GoogleTest requires at least C++17
set(
CMAKE_CXX_STANDARD
 17)
set(
CMAKE_CXX_STANDARD_REQUIRED
 ON)


include(FetchContent)
enable_testing()
FetchContent_Declare(
  googletest
  URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)cmake_minimum_required(VERSION 3.14)
project(p2pClient)


# GoogleTest requires at least C++17
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)


include(FetchContent)
enable_testing()
FetchContent_Declare(
  googletest
  URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)

and this is the result after running cmake -S . -B build:

cmake -S . -B build

-- The C compiler identification is GNU 16.2.0

-- The CXX compiler identification is GNU 16.2.0

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

-- Check for working C compiler: /usr/bin/cc - skipped

-- Detecting C compile features

-- Detecting C compile features - done

-- Detecting CXX compiler ABI info

-- Detecting CXX compiler ABI info - done

-- Check for working CXX compiler: /usr/bin/c++ - skipped

-- Detecting CXX compile features

-- Detecting CXX compile features - done

CMake Warning (dev) at /usr/share/cmake-4.3/Modules/FetchContent.cmake:1386 (message):

The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is

not set. The policy's OLD behavior will be used. When using a URL

download, the timestamps of extracted files should preferably be that of

the time of extraction, otherwise code that depends on the extracted

contents might not be rebuilt if the URL changes. The OLD behavior

preserves the timestamps from the archive instead, but this is usually not

what you want. Update your project to the NEW behavior or specify the

DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this

robustness issue.

Call Stack (most recent call first):

CMakeLists.txt:10 (FetchContent_Declare)

This warning is for project developers. Use -Wno-dev to suppress it.

-- Configuring done (0.3s)

-- Generating done (0.0s)

-- Build files have been written to: /home/andrew/x86/win32/p2pClient/build

reddit.com
u/Entire-Comment8241 — 4 days ago

is there a way to redirect argparse commands to a network socket?

I've doing some networking on which I'd kind need to redirect all my commands sent from my python server script to my client python script but without stdout only to a socket. I've been googling about and one frustrating options that I thought it could work was contextlib redirect_stdout but it redirects to stdout it won't work with sockets. Does anyone know if its feasible to parse argparse to a socket connection?

reddit.com
u/Entire-Comment8241 — 3 months ago

is it supposed to take this long when getting inputs from sockets in a multithreading object?

I've made a server socket in python so that I can see all subprocess thats running in my VPS so that I don't need to use Putty everytime to log on since putty closes the connection when it's idle. but the weird thing that's giving me headaches is that when run the server, ok it's running completely fine I get my true shell but when I run commands like whoami it's taking soooooo long it keeps processing and never return my output it just keeps in a running state. And I'm using multithreading. are python sockets really this damn long?

reddit.com
u/Entire-Comment8241 — 3 months ago

some possible remediations for variable name is not accessed

I've been facing some weird behavior in my vscode. Below code is what giving me nightmares. I have coded this function that basically do some data extraction from my VPS to my pc. and the thing which is causing problems is the variable name 'dirs' which vscode is pointing as "not accessed". But I know that one of the remediations to fix this is by returning that variable but in this kind of situation it doesn't seem right logic way.

def downloader(directory='C:\\users'):
  for root, dirs, files in os.walk(directory): # dirs is not accessed
    for file in files:
      if file.endswith('.html'):
         try:
            with open(os.path.join(root, file), 'rb') as f:
              f.sendall(host)
         except Exception as e:
           print(f'Oops something nasty happened here: {e})
reddit.com
u/Entire-Comment8241 — 3 months ago