feat: flemme scripts for building and testing
This commit is contained in:
parent
f1ad31c442
commit
351562bb89
3 changed files with 96 additions and 1 deletions
|
|
@ -19,6 +19,8 @@ then:
|
|||
#### asan
|
||||
run this command:
|
||||
`./configure CFLAGS='-std=c99 -Werror -Wall -Wextra -Wvla -g -fsanitize=address'`
|
||||
or for MacOS (Jean Here):
|
||||
`./configure CFLAGS='-std=c99 -Werror -Wall -Wextra -Wvla -I/opt/homebrew/include' LDFLAGS='-L/opt/homebrew/lib'`
|
||||
|
||||
then:
|
||||
`make check`
|
||||
|
|
@ -26,7 +28,7 @@ then:
|
|||
## Authors
|
||||
|
||||
- Matteo Flebus
|
||||
- Jean Hérail
|
||||
- Jean Herail
|
||||
- William Valenduc
|
||||
- Guillem George
|
||||
|
||||
|
|
|
|||
47
build_flemme.sh
Executable file
47
build_flemme.sh
Executable file
|
|
@ -0,0 +1,47 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# build_only.sh - Automates build for 42sh with pretty output (no tests)
|
||||
|
||||
set -e
|
||||
|
||||
# Colors
|
||||
GREEN="\033[1;32m"
|
||||
RED="\033[1;31m"
|
||||
YELLOW="\033[1;33m"
|
||||
RESET="\033[0m"
|
||||
|
||||
VERBOSE=0
|
||||
if [[ "$1" == "--verbose" ]]; then
|
||||
VERBOSE=1
|
||||
fi
|
||||
|
||||
run_cmd() {
|
||||
local desc="$1"
|
||||
shift
|
||||
if [[ $VERBOSE -eq 1 ]]; then
|
||||
echo -e "${YELLOW}${desc}...${RESET}"
|
||||
"$@"
|
||||
else
|
||||
echo -ne "${YELLOW}${desc}...${RESET}"
|
||||
"$@" &> /dev/null && echo -e " ${GREEN}done${RESET}" || { echo -e " ${RED}failed${RESET}"; exit 1; }
|
||||
fi
|
||||
}
|
||||
|
||||
run_cmd "Running autoreconf" autoreconf --force --verbose --install
|
||||
|
||||
if [[ "$(uname)" == "Darwin" ]]; then
|
||||
run_cmd "Configuring for MacOS" ./configure CFLAGS='-std=c99 -Werror -Wall -Wextra -Wvla -I/opt/homebrew/include' LDFLAGS='-L/opt/homebrew/lib'
|
||||
else
|
||||
run_cmd "Configuring for Linux" ./configure CFLAGS='-std=c99 -Werror -Wall -Wextra -Wvla -g -fsanitize=address'
|
||||
fi
|
||||
|
||||
run_cmd "Cleaning build" make clean
|
||||
|
||||
if [[ $VERBOSE -eq 1 ]]; then
|
||||
echo -e "${YELLOW}Building...${RESET}"
|
||||
make
|
||||
else
|
||||
echo -ne "${YELLOW}Building...${RESET}"
|
||||
echo
|
||||
make
|
||||
fi
|
||||
46
check_flemme.sh
Executable file
46
check_flemme.sh
Executable file
|
|
@ -0,0 +1,46 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# build_and_test.sh - Automates build and test for 42sh with pretty output
|
||||
|
||||
set -e
|
||||
|
||||
# Colors
|
||||
GREEN="\033[1;32m"
|
||||
RED="\033[1;31m"
|
||||
YELLOW="\033[1;33m"
|
||||
RESET="\033[0m"
|
||||
|
||||
VERBOSE=0
|
||||
if [[ "$1" == "--verbose" ]]; then
|
||||
VERBOSE=1
|
||||
fi
|
||||
|
||||
run_cmd() {
|
||||
local desc="$1"
|
||||
shift
|
||||
if [[ $VERBOSE -eq 1 ]]; then
|
||||
echo -e "${YELLOW}${desc}...${RESET}"
|
||||
"$@"
|
||||
else
|
||||
echo -ne "${YELLOW}${desc}...${RESET}"
|
||||
"$@" &> /dev/null && echo -e " ${GREEN}done${RESET}" || { echo -e " ${RED}failed${RESET}"; exit 1; }
|
||||
fi
|
||||
}
|
||||
|
||||
run_cmd "Running autoreconf" autoreconf --force --verbose --install
|
||||
|
||||
if [[ "$(uname)" == "Darwin" ]]; then
|
||||
run_cmd "Configuring for MacOS" ./configure CFLAGS='-std=c99 -Werror -Wall -Wextra -Wvla -I/opt/homebrew/include' LDFLAGS='-L/opt/homebrew/lib'
|
||||
else
|
||||
run_cmd "Configuring for Linux" ./configure CFLAGS='-std=c99 -Werror -Wall -Wextra -Wvla -g -fsanitize=address'
|
||||
fi
|
||||
|
||||
run_cmd "Cleaning build" make clean
|
||||
if [[ $VERBOSE -eq 1 ]]; then
|
||||
echo -e "${YELLOW}Running tests...${RESET}"
|
||||
make check
|
||||
else
|
||||
echo -ne "${YELLOW}Running tests...${RESET}"
|
||||
echo
|
||||
make check
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue