diff --git a/.gitignore b/.gitignore index 259148f..5b69f17 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,6 @@ *.exe *.out *.app + +build/ +.venv/ diff --git a/.vscode/pyenv.bat b/.vscode/pyenv.bat new file mode 100644 index 0000000..050449a --- /dev/null +++ b/.vscode/pyenv.bat @@ -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 diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..b4d8c35 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools" +} \ No newline at end of file diff --git a/.vscode/vsc.bat b/.vscode/vsc.bat new file mode 100644 index 0000000..cb98c02 --- /dev/null +++ b/.vscode/vsc.bat @@ -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" . diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..c19238d --- /dev/null +++ b/CMakeLists.txt @@ -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) diff --git a/README.md b/README.md index 1ccb7ad..b137547 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ -# sandbox +# Sandbox + A sandbox area for learning new things diff --git a/conanfile.txt b/conanfile.txt new file mode 100644 index 0000000..43beb06 --- /dev/null +++ b/conanfile.txt @@ -0,0 +1,5 @@ +[requires] +gtest/1.10.0 + +[generators] +cmake diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..77d8d38 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +conan diff --git a/requirements_windows.txt b/requirements_windows.txt new file mode 100644 index 0000000..bc04b49 --- /dev/null +++ b/requirements_windows.txt @@ -0,0 +1 @@ +-r requirements.txt diff --git a/src/test.cpp b/src/test.cpp index aa31a2c..2e8a167 100644 --- a/src/test.cpp +++ b/src/test.cpp @@ -1,7 +1,9 @@ +#include #include -int main() -{ - std::cout << "hi there" << std::endl; +TEST(Array, test){ + std::cout << "g" << std::endl; + EXPECT_EQ(1, 1); } + diff --git a/vsc.vbs b/vsc.vbs new file mode 100644 index 0000000..9f199db --- /dev/null +++ b/vsc.vbs @@ -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)