test: Update 3 files
Some checks failed
Build-Test-Publish / build (linux/arm64) (push) Failing after 13s
Build-Test-Publish / build (linux/amd64) (push) Failing after 20s
Build-Test-Publish / test-install-from-scratch (linux/amd64) (push) Has been skipped
Build-Test-Publish / test-install-from-scratch (linux/arm64) (push) Has been skipped
Some checks failed
Build-Test-Publish / build (linux/arm64) (push) Failing after 13s
Build-Test-Publish / build (linux/amd64) (push) Failing after 20s
Build-Test-Publish / test-install-from-scratch (linux/amd64) (push) Has been skipped
Build-Test-Publish / test-install-from-scratch (linux/arm64) (push) Has been skipped
This commit is contained in:
parent
31dcb29555
commit
6e920bd236
@ -3,15 +3,13 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||||
|
PROJECT="dehydrate"
|
||||||
|
|
||||||
export CMAKE_BUILD_TYPE="Debug"
|
export CMAKE_BUILD_TYPE="Debug"
|
||||||
|
|
||||||
rm -rf "${SCRIPT_DIR}/output"
|
rm -rf "${SCRIPT_DIR}/output"
|
||||||
mkdir -p "${SCRIPT_DIR}/output"
|
mkdir -p "${SCRIPT_DIR}/output"
|
||||||
|
|
||||||
PROJECT="dehydrate"
|
|
||||||
|
|
||||||
# make sure we have the latest base image.
|
# make sure we have the latest base image.
|
||||||
docker pull gitea.jde.nz/public/dropshell-build-base:latest
|
docker pull gitea.jde.nz/public/dropshell-build-base:latest
|
||||||
|
|
||||||
|
@ -71,8 +71,10 @@ int main(int argc, char* argv[]) {
|
|||||||
return update();
|
return update();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show version for normal operations
|
// Show version for normal operations (unless silent)
|
||||||
std::cout << "Dehydrate version " << VERSION << std::endl;
|
if (!args.silent) {
|
||||||
|
std::cout << "Dehydrate version " << VERSION << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
std::filesystem::path src(args.source);
|
std::filesystem::path src(args.source);
|
||||||
if (!std::filesystem::exists(src)) {
|
if (!std::filesystem::exists(src)) {
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Don't use set -e because we want to continue even if tests fail
|
set -euo pipefail
|
||||||
set -uo pipefail
|
|
||||||
|
|
||||||
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
PROJECT="dehydrate"
|
PROJECT="dehydrate"
|
||||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
|
||||||
DEHYDRATE="${SCRIPT_DIR}/output/${PROJECT}"
|
DEHYDRATE="${SCRIPT_DIR}/output/${PROJECT}"
|
||||||
TEST_DIR="${SCRIPT_DIR}/test_temp"
|
TEST_DIR="${SCRIPT_DIR}/test_temp"
|
||||||
|
|
||||||
@ -24,10 +23,10 @@ print_test_result() {
|
|||||||
local result="$2"
|
local result="$2"
|
||||||
if [ "$result" -eq 0 ]; then
|
if [ "$result" -eq 0 ]; then
|
||||||
echo -e "${GREEN}✓${NC} $test_name"
|
echo -e "${GREEN}✓${NC} $test_name"
|
||||||
((TESTS_PASSED++))
|
TESTS_PASSED=$((TESTS_PASSED + 1))
|
||||||
else
|
else
|
||||||
echo -e "${RED}✗${NC} $test_name"
|
echo -e "${RED}✗${NC} $test_name"
|
||||||
((TESTS_FAILED++))
|
TESTS_FAILED=$((TESTS_FAILED + 1))
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,7 +70,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Test 2: Help command (shows help when no args provided)
|
# Test 2: Help command (shows help when no args provided)
|
||||||
echo -e "\nTest 2: Help command"
|
printf "\nTest 2: Help command\n"
|
||||||
HELP_OUTPUT=$("$DEHYDRATE" 2>&1 || true)
|
HELP_OUTPUT=$("$DEHYDRATE" 2>&1 || true)
|
||||||
if [[ "$HELP_OUTPUT" =~ "Usage: dehydrate" ]] && [[ "$HELP_OUTPUT" =~ "Converts existing files" ]]; then
|
if [[ "$HELP_OUTPUT" =~ "Usage: dehydrate" ]] && [[ "$HELP_OUTPUT" =~ "Converts existing files" ]]; then
|
||||||
print_test_result "Help command output" 0
|
print_test_result "Help command output" 0
|
||||||
@ -88,7 +87,7 @@ echo "int main() { return 0; }" > "$TEST_SRC_DIR/main.cpp"
|
|||||||
echo "#include <iostream>" > "$TEST_SRC_DIR/header.hpp"
|
echo "#include <iostream>" > "$TEST_SRC_DIR/header.hpp"
|
||||||
|
|
||||||
# Run dehydrate on the test source
|
# Run dehydrate on the test source
|
||||||
DEHYDRATE_OUTPUT=$("$DEHYDRATE" "$TEST_SRC_DIR" "$TEST_DIR" 2>&1 || true)
|
"$DEHYDRATE" -s "$TEST_SRC_DIR" "$TEST_DIR"
|
||||||
# Dehydrate creates files with pattern _<source_dir_name>.{cpp,hpp}
|
# Dehydrate creates files with pattern _<source_dir_name>.{cpp,hpp}
|
||||||
if [ -f "$TEST_DIR/_test_src.hpp" ] && [ -f "$TEST_DIR/_test_src.cpp" ]; then
|
if [ -f "$TEST_DIR/_test_src.hpp" ] && [ -f "$TEST_DIR/_test_src.cpp" ]; then
|
||||||
print_test_result "Basic dehydration creates output files" 0
|
print_test_result "Basic dehydration creates output files" 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user