how to run specific file in NX cloud nestjs? - unit-testing

folder structure:
SDK-NODE
-> config
-> libs
-> sample-sdk
-> project1
-> src
-> lib
-> testcase.spec.ts
Solutions Tried:
nx run project1:test --testFile= testcase.spec.ts
ng test project1 --test-name-pattern=testcase.spec.ts
ERROR
NX Cannot find project 'project1'

Related

CMake library subproject

I have the following project structure.
project
-> build
-> sdk
-> calculator
-> include
-> calculator.h
-> calculator_p.h
-> src
-> calculator.cpp
-> calculator_p.cpp
-> interfaces
-> icalculator.h
-> client
-> main.cpp
I want to create a library from sdk and use it in client, so client can see icalculator.h and calculator.h, but not calculator_p.h.
Official cmake documentation has very poor examples, unfortunelly. I digged through a lot of examples and I have to say that I'm even more lost than in the beggining.
Should I create only one CMakeLists.txt in sdk directory or another one in each calculator and interfaces?
EDIT:
This is what I came up with so far.
project/CMakeLists.txt
cmake_minimum_required(VERSION 3.13)
project(test_project)
set(CMAKE_CXX_STANDARD 17)
add_subdirectory(sdk)
add_subdirectory(client)
project/sdk/CMakeLists.txt
add_library(sdk_library SHARED
calculator/src/calculator.cpp
calculator/src/calculator_p.cpp)
target_include_directories(sdk_library PUBLIC interfaces/include)
target_include_directories(sdk_library PUBLIC calculator/include)
project/client/CMakeLists.txt
add_executable(client main.cpp)
target_link_libraries(client sdk_library)
I build and run from the build directory.
cmake ..
make client
./client/client

Changing the launch directory of executable in MSVC

My folder hierarchy looks like this:
bin -> data -> blurf.xml
lib -> blurb.lib
src -> blah.cpp
msvc -> project_name -> project_name.sln ...
....
Here is my issue. This project needs to run on Linux and Windows
So I need that when I build it in MSVC, the exe ends up in ../../bin
This is because my application has a data folder and the application expects to find in the root where the exe is.
Is there a way that when I run a build, it thinks it is (or is) in the ../../bin directory so it accesses the data folder?
If not, is there some other way I can have it know where its data is when I run from MSVC?
Go to project properties, Debugging sheet and set 'Working directory' accordingly

Setting gcc ( gcc-arm-embedded ) in Eclipse IDE for C/C++ Developers Mars in OS X

I am a newbie in Eclipse IDE for C/C++ .
I want to set gcc-arm-embedded in Eclipse IDE for C/C++ Developers Mars Milestone 4 (4.5.0M4), I just downloaded https://launchpad.net/gcc-arm-embedded/+download, and now I guess that I have to set PATH somewhere in Eclipse, as I am experiencing this ERRORs in 1 project
Program "arm-none-eabi-g++" not found in PATH
Program "arm-none-eabi-gcc" not found in PATH
The location of the error is in
Project Properties -> C / C++ General -> Preprocessor Include Paths, Macros, etc -> Languages (GNU C) -> [ CDT GCC Built-in Compiler Settings Cross ARM]
But I can't edit this entry: "Setting entries for this provider are supplied by the system and are not editable"
I've tried with:
export PATH=$PATH:/Users/joanot/Development/gcc-arm-none-eabi-4_9-2014q4/bin
and in
Project Properties -> Paths and Symbols -> adding the directory /Users/joanot/Development/gcc-arm-none-eabi-4_9-2014q4/bin
and
In Eclipse -> Preferences -> C / C++ -> Build -> Build Variables:
Create 1 variable named GCC_EABI, type= Directory, value= /usr/local/gcc-arm-none-eabi-4_9-2014q4/bin
In Eclipse -> Preferences -> C / C++ -> Build -> Environment:
Add -> Name = PATH , value = ${GCC_EABI}
In case someone reads this later (like I just did) this works, however the real answer is here
Essentially you need to go to Eclipse -> Preferences -> C/C++ Build -> Tools Paths
Add the path (in my case /Users/${USER}/armtools/install/bin) to the Toolchain folder

Eclipse content assist doesn't recognize std::thread, but compiles correctly

I am running Ubuntu 14.04.
Steps I took to reproduce:
Create a new C++ project (New -> C++ -> Hello World project), which I called TestStdThread
Change the code in the main file to this:
#include <thread>
#include <iostream>
int main() {
std::cout << "You have " << std::thread::hardware_concurrency() << " cores." << std::endl;
return 0;
}
Go to TestStdThread -> Properties -> C/C++ Build -> Settings -> GCC C++ Compiler, and change the Command options from g++ to g++ -std=c++11
Go to TestStdThread -> Properties -> C/C++ Build -> Settings -> GCC C++ Compiler -> Includes, add /usr/include to the Include paths (-I), and add pthread.h to the Include files (-include)
Go to TestStdThread -> Properties -> C/C++ Build -> Settings -> GCC C++ Linker -> Libraries, add pthread to the Libraries (-l), and add /usr/lib/x86_64-linux-gnu to the Library search path (-L)
TestStdThread -> Build Project
Click "Run"
There were no build errors. Eclipse told me that the project had errors and asked if I wanted to run it anyway, and when I said yes, the output was, correctly: You have 4 cores.. However, Eclipse still underlined the std::thread::hardware_concurrency part in red, and reported it (on hover) as "Function 'hardware_concurrency' could not be resolved," and std::thread didn't show up when typing std:: Ctrl+Space.
This is the bash command I used to find where my pthread files were located within /usr (/usr/share omitted as it contains lots of doc files that I'm not looking for):
llama#llama-Satellite-E55-A:/usr$ find -name "*pthread*" -not -path "./share/*"
./include/pthread.h
./include/x86_64-linux-gnu/bits/pthreadtypes.h
./lib/x86_64-linux-gnu/pkgconfig/pthread-stubs.pc
./lib/x86_64-linux-gnu/libpthread.so
./lib/x86_64-linux-gnu/libpthread_nonshared.a
./lib/x86_64-linux-gnu/libgpgme-pthread.so.11.11.0
./lib/x86_64-linux-gnu/libgpgme-pthread.so.11
./lib/x86_64-linux-gnu/libpthread.a
./lib/perl/5.18.2/bits/pthreadtypes.ph
./lib/debug/lib/x86_64-linux-gnu/libpthread-2.19.so
Go to Project -> Properties -> C/C++ General -> Preprocessor include paths, etc -> Providers -> CDT GCC Builtin Compiler Settings and append -std=c++11 to the compiler specs.
You can also do this for all projects going to Window -> Preferences -> C/C++ -> Build -> Settings -> Discovery and append -std=c++11 to the CDT GCC Builtin Compiler Settings specs.
Make sure to reindex your project afterwards.
These instructions are for Eclipse Luna (4.4.0), for previous versions the paths are similar.

Set project configurations using Visual Studios custom template wizard

I am trying to create a C++ project template using the custom project wizard. I just need a simple template for an empty C++ CLI application that uses an external library, i.e I need the wizard to set the following settings found under Project -> Properties:
Configaration Setting -> VC++ Directories -> Executable Directories
Configaration Setting -> VC++ Directories -> Include Directories
Configaration Setting -> VC++ Directories -> Library Directories
Configaration Setting -> Linker -> Input -> Additional Dependencies
It seems I need to modify default.js more specifically the function AddConfig which contains:
function AddConfig(proj, strProjectName)
{
var config = proj.Object.Configurations('Debug');
var CLTool = config.Tools('VCCLCompilerTool');
// TODO: Add compiler settings
var LinkTool = config.Tools('VCLinkerTool');
// TODO: Add linker settings
}
I need help in setting the project settings here.