This is a repo of homework -- Operating System - File System -- project
sudo apt update
sudo apt upgrade
# check if you have those
gcc --version
g++ --version
cmake --version
# install gcc, g++, cmake, readline
sudo apt install build-essential
sudo apt install cmake
sudo apt install libreadline-dev
sudo apt install libssl-dev
cd OS_FileSystem
mkdir build
cd build
cmake ..
cmake --build . --config Release
cd build
cd test
# if run unit test
cd <folder>
./test
# else run main
./main
- cd to certain folder, for example test/User
- add a new cpp file, for example UserTest.cpp
- if you need extra header files only for testing, add them to test/include
- add the following code to CMakeLists.txt
add_executable(target_name src0.cpp src1.cpp ...)
target_link_libraries(target_name PUBLIC library_name)
target_name is the name of the executable file, you can name it whatever you want, for example, UserTest
src0.cpp... those are source codes for compiling. for example, UserTest.cpp
library_name is the name of the library you want to link. for example, User(you can find libs in src/CMakeLists.txt)