add first test
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -30,3 +30,6 @@
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
||||
|
||||
build/
|
||||
.venv/
|
||||
|
||||
35
.vscode/pyenv.bat
vendored
Normal file
35
.vscode/pyenv.bat
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
@echo off
|
||||
|
||||
:: get the project root directory
|
||||
set PROJECT_ROOT_DIR=%~dp0\..\
|
||||
|
||||
pushd .
|
||||
cd %PROJECT_ROOT_DIR%
|
||||
set PROJECT_ROOT_DIR=%CD%
|
||||
popd
|
||||
|
||||
:: make sure python 3.8.6 is installed in the default location
|
||||
set PROJECT_PYTHON_BASE_EXE=C:\Python\3.8.6_x64\python.exe
|
||||
|
||||
if not exist "%PROJECT_PYTHON_BASE_EXE%" (
|
||||
echo BUILD ERROR: Cannot find python installation: "%PROJECT_PYTHON_BASE_EXE%"
|
||||
exit 1
|
||||
)
|
||||
|
||||
:: create/activate python virtual env for development
|
||||
set PROJECT_PY_VER_ENV_DIR=%PROJECT_ROOT_DIR%\.venv\
|
||||
set PROJECT_PY_VER_ENV_ACTIVATE=%PROJECT_PY_VER_ENV_DIR%Scripts\activate.bat
|
||||
|
||||
echo Using python dev env "%PROJECT_PY_VER_ENV_DIR%"
|
||||
|
||||
if exist "%PROJECT_PY_VER_ENV_ACTIVATE%" (
|
||||
call "%PROJECT_PY_VER_ENV_ACTIVATE%"
|
||||
exit 0
|
||||
)
|
||||
|
||||
"%PROJECT_PYTHON_BASE_EXE%" -m pip install -U pip setuptools wheel
|
||||
"%PROJECT_PYTHON_BASE_EXE%" -m venv %PROJECT_PY_VER_ENV_DIR%
|
||||
call "%PROJECT_PY_VER_ENV_ACTIVATE%"
|
||||
python -m pip install -U pip setuptools wheel --no-warn-script-location
|
||||
python -m pip install -U -r "%PROJECT_ROOT_DIR%\requirements_windows.txt" --no-warn-script-location
|
||||
python -m pip uninstall pathlib -y
|
||||
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools"
|
||||
}
|
||||
12
.vscode/vsc.bat
vendored
Normal file
12
.vscode/vsc.bat
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
@echo off
|
||||
|
||||
:: get the project root directory
|
||||
set PROJECT_ROOT_DIR=%~dp0\..\
|
||||
|
||||
pushd .
|
||||
cd %PROJECT_ROOT_DIR%
|
||||
set PROJECT_ROOT_DIR=%CD%
|
||||
popd
|
||||
|
||||
:: start VS Code: assume it is installed
|
||||
Start "" /D %PROJECT_ROOT_DIR% "Code" .
|
||||
16
CMakeLists.txt
Normal file
16
CMakeLists.txt
Normal file
@@ -0,0 +1,16 @@
|
||||
cmake_minimum_required(VERSION 3.0.0)
|
||||
project(Sandbox VERSION 0.1.0)
|
||||
|
||||
include(CTest)
|
||||
enable_testing()
|
||||
|
||||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
||||
conan_basic_setup()
|
||||
|
||||
add_executable(testMain src/test.cpp)
|
||||
target_link_libraries(testMain ${CONAN_LIBS})
|
||||
add_test(NAME testMain COMMAND testMain)
|
||||
|
||||
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
|
||||
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
|
||||
include(CPack)
|
||||
5
conanfile.txt
Normal file
5
conanfile.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
[requires]
|
||||
gtest/1.10.0
|
||||
|
||||
[generators]
|
||||
cmake
|
||||
1
requirements.txt
Normal file
1
requirements.txt
Normal file
@@ -0,0 +1 @@
|
||||
conan
|
||||
1
requirements_windows.txt
Normal file
1
requirements_windows.txt
Normal file
@@ -0,0 +1 @@
|
||||
-r requirements.txt
|
||||
@@ -1,7 +1,9 @@
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <iostream>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "hi there" << std::endl;
|
||||
TEST(Array, test){
|
||||
std::cout << "g" << std::endl;
|
||||
EXPECT_EQ(1, 1);
|
||||
}
|
||||
|
||||
|
||||
22
vsc.vbs
Normal file
22
vsc.vbs
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
Option Explicit
|
||||
|
||||
Dim fsObj
|
||||
Dim wshShell
|
||||
Dim scriptDir
|
||||
Dim strCommand1
|
||||
Dim strCommand2
|
||||
|
||||
Set fsObj = CreateObject("Scripting.FileSystemObject")
|
||||
Set wshShell = WScript.CreateObject("WScript.Shell")
|
||||
|
||||
scriptDir = fsObj.GetParentFolderName(WScript.ScriptFullName)
|
||||
|
||||
strCommand1 = Chr(34) & scriptDir & "\.vscode\pyenv.bat" & Chr(34)
|
||||
strCommand2 = Chr(34) & scriptDir & "\.vscode\vsc.bat" & Chr(34)
|
||||
|
||||
' x = msgbox(strCommand1,0, "Launch Command")
|
||||
' x = msgbox(strCommand2,0, "Launch Command")
|
||||
|
||||
Call wshShell.Run(strCommand1, 1, True)
|
||||
Call wshShell.Run(strCommand2, 0, True)
|
||||
Reference in New Issue
Block a user