switched build and test scripts to a makefile
parent
72d9d73f57
commit
1caccffa5b
6
.nvimrc
6
.nvimrc
|
@ -1,3 +1,3 @@
|
|||
noremap <F4> :!./build.sh<CR>
|
||||
noremap <F5> :!./run.sh<CR>
|
||||
noremap <F6> :!./test.sh<CR>
|
||||
noremap <F4> :!make build<CR>
|
||||
noremap <F5> :!make build && bin/kwil test_files/*.h<CR>
|
||||
noremap <F6> :!make test<CR>
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
build:
|
||||
##### Compile kwil #####
|
||||
gcc -o bin/kwil src/**.c -g -Itest_include -Wall
|
||||
|
||||
run:
|
||||
|
||||
test: build
|
||||
##### Run kwil on test files #####
|
||||
bin/kwil test_files/*.h
|
||||
|
||||
##### Compile test files #####
|
||||
gcc -g -o bin/test test_files/*.c -Itest_include -Wall
|
||||
|
||||
##### Run test program #####
|
||||
bin/test
|
||||
|
||||
debug: build
|
||||
ugdb -- bin/kwil test_files/**.h
|
||||
|
||||
clean:
|
||||
rm bin/**
|
4
build.sh
4
build.sh
|
@ -1,4 +0,0 @@
|
|||
#!/bin/bash
|
||||
echo "Beginning build"
|
||||
bear -- \
|
||||
gcc -o bin/kwil src/**.c -g -Itest_include -Wall
|
19
test.sh
19
test.sh
|
@ -1,19 +0,0 @@
|
|||
#!/bin/bash
|
||||
echo ""
|
||||
echo "Beginning test"
|
||||
echo ""
|
||||
|
||||
echo "" && echo "---- Running kwil ----" && \
|
||||
./run.sh && \
|
||||
echo "" && echo "---- Compiling test program ----" && \
|
||||
gcc -g -o bin/test test_files/*.c -Itest_include -Wall && \
|
||||
echo "" && echo "---- Running test program ----" && \
|
||||
bin/test
|
||||
|
||||
if [[ $? == 0 ]]; then
|
||||
echo ""
|
||||
echo "Test succeeded"
|
||||
else
|
||||
echo ""
|
||||
echo "Test failed"
|
||||
fi
|
Loading…
Reference in New Issue