### Building obs-studio-node for Tests (CMake) Source: https://github.com/streamlabs/obs-studio-node/blob/staging/README.md Command-line steps to build the obs-studio-node library specifically for running tests. Uses CMake and includes setting the CMAKE_INSTALL_PREFIX variable to specify the installation location required by the test runner. ```Shell yarn install git submodule update --init --recursive --force mkdir build cmake -Bbuild -H. -G"Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX="path_of_your_choosing" cmake --build build --target install ``` -------------------------------- ### Running cppcheck Static Analysis with CMake Source: https://github.com/streamlabs/obs-studio-node/blob/staging/README.md Commands to execute the cppcheck static analysis target within the CMake build system. Requires cppcheck to be installed and in the system's PATH. ```Shell cd build cmake --build . --target CPPCHECK ``` -------------------------------- ### Setting up and Running Clang Analyzer with CMake and Ninja Source: https://github.com/streamlabs/obs-studio-node/blob/staging/README.md Detailed steps for configuring and running Clang Analyzer on the project. Involves setting up the environment with Visual Studio variables, configuring CMake with Ninja and Clang, building, cleaning, and finally running the scan-build command. ```Shell mkdir build_clang cd build_clang "c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat" set CCC_CC=clang-cl set CCC_CXX=clang-cl set CC=ccc-analyzer.bat set CXX=c++-analyzer.bat #set CCC_ANALYZER_VERBOSE=1 #make ninja project cmake -G "Ninja" -DCLANG_ANALYZE_CONFIG=1 -DCMAKE_INSTALL_PREFIX:PATH="" -DCMAKE_LINKER=lld-link -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_SYSTEM_NAME="Generic" -DCMAKE_MAKE_PROGRAM=ninja.exe .. #try to build and "fix" errors ninja.exe #clean build to scan ninja.exe clean scan-build --keep-empty -internal-stats -stats -v -v -v -o check ninja.exe ``` -------------------------------- ### Building obs-studio-node with CMake and Yarn Source: https://github.com/streamlabs/obs-studio-node/blob/staging/README.md Provides the standard command-line steps to build the obs-studio-node library using Yarn for dependencies and CMake for the build process. It initializes submodules, creates a build directory, configures CMake, and builds/installs the project. ```Shell yarn install git submodule update --init --recursive mkdir build cd build cmake .. -G"Visual Studio 17 2022" -A x64 -DCMAKE_PREFIX_PATH=%CD%/libobs-src/cmake/ cmake --build . --target install --config RelWithDebInfo ``` -------------------------------- ### Building obs-studio-node for Tests (Yarn Scripts) Source: https://github.com/streamlabs/obs-studio-node/blob/staging/README.md Alternative method to build the project for testing purposes using predefined Yarn package.json scripts (`local:config`, `local:build`). Includes creating the build directory. ```Shell mkdir build yarn local:config yarn local:build Optional: To clean build folder to repeat the steps 2 to 3 again do `yarn local:clean` ``` -------------------------------- ### Run All Tests Source: https://github.com/streamlabs/obs-studio-node/blob/staging/README.md Execute all available tests for the project using the yarn package manager. Ensure the SLOBS_BE_STREAMKEY environment variable is set for tests interacting with Twitch. ```Shell yarn run test ``` -------------------------------- ### VS Code Launch Configuration for Debugging Tests Source: https://github.com/streamlabs/obs-studio-node/blob/staging/README.md Configure Visual Studio Code to debug Electron-Mocha tests. This configuration specifies the program to launch, arguments for test execution, working directory, environment variables, and files to skip during debugging. ```JSON { "version": "0.2.0", "configurations": [ { "type": "node", "request": "launch", "name": "Debug Electron-Mocha Tests", "program": "${workspaceFolder}/node_modules/electron-mocha/bin/electron-mocha", "args": [ "-r", "ts-node/register", "${workspaceFolder}/tests/osn-tests/src/*.ts" ], "cwd": "${workspaceFolder}", "env": { "ELECTRON_ENABLE_LOGGING": "true" }, "outputCapture": "std", "internalConsoleOptions": "openOnSessionStart", "skipFiles": ["/**"] } ] } ``` -------------------------------- ### Run Specific Test by Name Source: https://github.com/streamlabs/obs-studio-node/blob/staging/README.md Execute a single test or a group of tests matching a specific name using the yarn command with the --grep flag. Replace `describe_name_value` with the actual name used in the test's `describe` call. ```Shell yarn run test --grep describe_name_value ``` -------------------------------- ### Run Dependency Check Target with CMake Source: https://github.com/streamlabs/obs-studio-node/blob/staging/dependency_checker/README.md This command executes a specific CMake build target named `check_dependencies` with the `RelWithDebInfo` configuration. This method is used when the dependency check is configured as a separate build target, typically for projects with many binaries. ```Shell cmake --build build --target check_dependencies --config RelWithDebInfo ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.