mirror of
https://github.com/godotengine/godot-tests.git
synced 2026-01-04 06:10:18 +03:00
Merge pull request #7 from Calinou/add-test-project
Add a minimal test project
This commit is contained in:
25
tests/project_export/export_presets.cfg
Normal file
25
tests/project_export/export_presets.cfg
Normal file
@@ -0,0 +1,25 @@
|
||||
[preset.0]
|
||||
|
||||
name="Linux/X11"
|
||||
platform="Linux/X11"
|
||||
runnable=true
|
||||
custom_features=""
|
||||
export_filter="all_resources"
|
||||
include_filter=""
|
||||
exclude_filter=""
|
||||
export_path=""
|
||||
patch_list=PoolStringArray( )
|
||||
script_export_mode=1
|
||||
script_encryption_key=""
|
||||
|
||||
[preset.0.options]
|
||||
|
||||
texture_format/bptc=false
|
||||
texture_format/s3tc=true
|
||||
texture_format/etc=false
|
||||
texture_format/etc2=false
|
||||
texture_format/no_bptc_fallbacks=true
|
||||
binary_format/64_bits=true
|
||||
binary_format/embed_pck=false
|
||||
custom_template/release=""
|
||||
custom_template/debug=""
|
||||
BIN
tests/project_export/icon.png
Normal file
BIN
tests/project_export/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
34
tests/project_export/icon.png.import
Normal file
34
tests/project_export/icon.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://icon.png"
|
||||
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
20
tests/project_export/project.godot
Normal file
20
tests/project_export/project.godot
Normal file
@@ -0,0 +1,20 @@
|
||||
; Engine configuration file.
|
||||
; It's best edited using the editor UI and not directly,
|
||||
; since the parameters that go here are not all obvious.
|
||||
;
|
||||
; Format:
|
||||
; [section] ; section goes between []
|
||||
; param=value ; assign values to parameters
|
||||
|
||||
config_version=4
|
||||
|
||||
_global_script_classes=[ ]
|
||||
_global_script_class_icons={
|
||||
|
||||
}
|
||||
|
||||
[application]
|
||||
|
||||
config/name="Test Project"
|
||||
run/main_scene="res://scene.tscn"
|
||||
config/icon="res://icon.png"
|
||||
3
tests/project_export/scene.tscn
Normal file
3
tests/project_export/scene.tscn
Normal file
@@ -0,0 +1,3 @@
|
||||
[gd_scene format=2]
|
||||
|
||||
[node name="Scene" type="Node"]
|
||||
5
tests/project_export/script.gd
Normal file
5
tests/project_export/script.gd
Normal file
@@ -0,0 +1,5 @@
|
||||
extends SceneTree
|
||||
|
||||
func _init() -> void:
|
||||
print("Test project: The script was run successfully.")
|
||||
quit()
|
||||
56
tests/project_export/test_project.sh
Executable file
56
tests/project_export/test_project.sh
Executable file
@@ -0,0 +1,56 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This script tests command-line editor functionality:
|
||||
# - Exporting a project
|
||||
# - Running a standalone script
|
||||
#
|
||||
# For exporting to work, a release export template for 64-bit Linux/X11
|
||||
# must be installed.
|
||||
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
if [[ "$#" == 0 ]]; then
|
||||
echo "Usage: test_project.sh <path to Godot binary>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
print_header() {
|
||||
printf "\n"
|
||||
printf -- "-%.0s" {0..72}
|
||||
printf "\n%s\n" "$1"
|
||||
printf -- "-%.0s" {0..72}
|
||||
printf "\n\n"
|
||||
}
|
||||
|
||||
# The absolute path to the Godot binary
|
||||
GODOT_BIN="$(readlink -e "$1")"
|
||||
|
||||
# The output filename relative to the project directory (without an extension)
|
||||
OUTPUT_PATH="/tmp/project_export"
|
||||
|
||||
# Change to the directory where the script is located,
|
||||
# so it can be run from any location
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||
|
||||
print_header "Testing command-line project exporting..."
|
||||
|
||||
# Export the project to test headless exporting functionality.
|
||||
# This must be done *before* running the script, as assets need to be imported
|
||||
# (exporting the project will automatically import assets).
|
||||
"$GODOT_BIN" --export "Linux/X11" "$OUTPUT_PATH.x86_64"
|
||||
|
||||
if [[ ! -f "$OUTPUT_PATH.pck" ]]; then
|
||||
print_header "ERROR: No PCK file was created while exporting the project."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$(wc -c < "$OUTPUT_PATH.pck")" -lt 1000 ]]; then
|
||||
print_header "ERROR: The PCK file was created but its size is lower than 1 KB, which hints at a bug in the exporting process."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
print_header "Testing command-line script running..."
|
||||
|
||||
# Run a script to test script running functionality
|
||||
"$GODOT_BIN" -s script.gd
|
||||
Reference in New Issue
Block a user