\
'
"
tree -I 'venv|build'
: display all directories execpt venv
and build
.alias ccg="gcc -Wall -Wextra -Werror -pedantic -std=c99 -g -fsanitize=address -o out"
bash --posix
in terminal.command
_XOPEN_SOURCE >= 500
)
gcc -Isrc
)
conftest.py
(Renamed if needed) and move it to test folder. (not needed as pierre did it for us)python -m venv venv
to create env. ( in root of dir)source venv/bin/activate
pip install pytest pyyaml
pip install cmake-format
(cmake-format -i CMakeLists.txt
)pytest
.yaml
file (see conftest.py
for syntax).deactivate
source venv/bin/activate
pytest
deactivate
To run criterion testsuite:
ctest --verbose
ormake check
(if implemented).
CMakeLists.txt (1)
, make sure to have:
add_subdirectory(src/lexer)
CMakeLists.txt (2)
, make sure to have:
target_link_libraries(42sh PRIVATE ${READLINE_LIB} common_options lexer)
CMakeLists.txt (3)
, make sure to have:CMakeLists.txt (4)
, make sure to have:lexer/lexer_1.c
, only need to include #include "token.h"
.git/config
git tree
: view commit in tree-like view.git config --global pull.rebase true
: Enable pull rebase.git branch
: Display all existing branches.git checkout <branch>
: switch branchgit checkout -b <branch>
: create branch + switch branchgit push --set-upstream origin <branch>
: Tells git to push to <branch>
and not master.git checkout master
git pull
git merge <name_branch>
Test(....)
by int main(void)
make debug
, an executable named utest_criterion
will be created.gdb utest_criterion
.make clean
+ rm utest_criterion
utest_criterion
at the root is a copy from the one in test. Thus make clean
won't see it.mkdir build/
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
(This should run version without fsanitize=address)mkdir debug/
cd debug
cmake .. -DCMAKE_BUILD_TYPE=Debug
(This should run version with fsanitize=address)-Wl,--start-group
and -Wl,--end-group
to stop worrying about libraries ordering.groff -man -Tascii doc/42sh.man | less
Token Recogntion
&& Shell Grammar
sections