|
2 | 2 |
|
3 | 3 | This directory contains organized test data for the VortexStepMethod.jl test suite. |
4 | 4 |
|
5 | | -## Structure |
6 | | - |
7 | | -The test data is organized by source module being tested, following the structure of the `src/` directory: |
| 5 | +## Running Tests |
8 | 6 |
|
| 7 | +You can run tests in different ways: |
| 8 | +```bash |
| 9 | +# Run all tests |
| 10 | +julia --project=. test/runtests.jl |
9 | 11 | ``` |
10 | | -test/data/ |
11 | | -├── body_aerodynamics/ # Tests for src/body_aerodynamics.jl |
12 | | -│ ├── wings/ |
13 | | -│ │ └── test_wing.yaml |
14 | | -│ ├── polars/ |
15 | | -│ │ └── simple_polar.csv |
16 | | -│ └── complete_settings.yaml |
17 | | -├── yaml_geometry/ # Tests for src/yaml_geometry.jl |
18 | | -│ ├── wings/ |
19 | | -│ │ ├── simple_wing.yaml |
20 | | -│ │ └── complex_wing.yaml |
21 | | -│ └── polars/ |
22 | | -│ ├── standard_airfoil.csv |
23 | | -│ └── alternate_airfoil.csv |
24 | | -├── solver/ # Tests for src/solver.jl |
25 | | -│ ├── wings/ |
26 | | -│ │ └── solver_test_wing.yaml |
27 | | -│ ├── polars/ |
28 | | -│ │ └── solver_test_polar.csv |
29 | | -│ └── solver_settings.yaml |
30 | | -├── settings/ # Common settings files |
31 | | -│ ├── basic_vsm.yaml |
32 | | -│ └── basic_llt.yaml |
33 | | -└── wing_geometry/ # Tests for src/wing_geometry.jl (future) |
34 | | -``` |
35 | | - |
36 | | -## Usage |
37 | | - |
38 | | -Use the helper functions in `test_data_utils.jl` to access test data: |
39 | | - |
40 | | -### Basic Path Access |
41 | | -```julia |
42 | | -include("test_data_utils.jl") |
43 | | - |
44 | | -# Get paths to test data files |
45 | | -wing_file = test_data_path("yaml_geometry", "wings", "simple_wing.yaml") |
46 | | -polar_file = test_data_path("yaml_geometry", "polars", "standard_airfoil.csv") |
47 | | -settings_file = test_data_path("settings", "basic_vsm.yaml") |
48 | | -``` |
49 | | - |
50 | | -### Module-Specific Convenience Functions |
51 | | -```julia |
52 | | -# Get standard wing file for a module |
53 | | -wing_file = get_standard_wing_file("body_aerodynamics") |
54 | | - |
55 | | -# Get complete settings file for a module |
56 | | -settings_file = get_complete_settings_file("solver") |
57 | | - |
58 | | -# Create temporary settings with custom parameters |
59 | | -temp_settings = create_temp_wing_settings("yaml_geometry", "simple_wing.yaml"; |
60 | | - alpha=15.0, wind_speed=25.0) |
| 12 | +```bash |
| 13 | +# Run specific test files |
| 14 | +julia --project=. test/yaml_geometry/test_yaml_geometry.jl |
| 15 | +julia --project=. test/body_aerodynamics/test_body_aerodynamics.jl |
| 16 | +julia --project=. test/solver/test_solver.jl |
| 17 | +# etc. |
61 | 18 | ``` |
62 | | - |
63 | | -## Design Principles |
64 | | - |
65 | | -1. **Module Isolation**: Each source module has its own test data directory |
66 | | -2. **Consistent Structure**: All modules follow the same subdirectory pattern (wings/, polars/, etc.) |
67 | | -3. **Reusable Components**: Common files (like basic settings) are shared in the `settings/` directory |
68 | | -4. **Clear Naming**: File names clearly indicate their purpose and content |
69 | | -5. **Self-Contained**: Each module's data is independent and can be used in isolation |
70 | | - |
71 | 19 | ## Adding New Test Data |
72 | 20 |
|
73 | 21 | When adding test data for a new source module: |
74 | 22 |
|
75 | | -1. Create a new directory under `test/data/` matching the source file name |
76 | | -2. Add subdirectories as needed (`wings/`, `polars/`, etc.) |
77 | | -3. Update `test_data_utils.jl` to include helper functions for the new module |
| 23 | +1. Create test files in the appropriate module directory under `test/` |
| 24 | +2. Add any required data files (YAML, CSV) in the same directory |
| 25 | +3. Use `test_data_path()` helper function to access files with proper paths |
78 | 26 | 4. Follow the existing naming conventions |
79 | 27 |
|
80 | | -## File Descriptions |
81 | | - |
82 | | -### Wing Geometry Files (.yaml) |
83 | | -- `simple_wing.yaml`: Basic 2-section wing for common tests |
84 | | -- `complex_wing.yaml`: Multi-section wing with multiple airfoil types |
85 | | -- `test_wing.yaml`: Simple wing for body aerodynamics tests |
86 | | -- `solver_test_wing.yaml`: Wing optimized for solver testing |
87 | 28 |
|
88 | | -### Polar Data Files (.csv) |
89 | | -- `standard_airfoil.csv`: Standard 6-point polar data |
90 | | -- `alternate_airfoil.csv`: Alternative airfoil with different coefficients |
91 | | -- `simple_polar.csv`: Minimal 3-point polar for basic tests |
92 | | -- `solver_test_polar.csv`: Polar data for solver tests |
| 29 | +## Structure |
93 | 30 |
|
94 | | -### Settings Files (.yaml) |
95 | | -- `basic_vsm.yaml`: Basic VSM solver settings |
96 | | -- `basic_llt.yaml`: Basic LLT solver settings |
97 | | -- `complete_settings.yaml`: Full wing + solver configuration |
98 | | -- `solver_settings.yaml`: Solver-specific configuration |
| 31 | +The test data is organized by source module being tested, following the structure of the `src/` directory: |
99 | 32 |
|
100 | | -This organization makes it easy to: |
101 | | -- Find test data relevant to specific source modules |
102 | | -- Avoid conflicts between different test requirements |
103 | | -- Maintain and update test data independently |
104 | | -- Add new test cases without affecting existing ones |
| 33 | +``` |
| 34 | +test/ |
| 35 | +├── body_aerodynamics/ # Tests for src/body_aerodynamics.jl |
| 36 | +│ ├── test_body_aerodynamics.jl |
| 37 | +│ ├── test_results.jl |
| 38 | +│ └── test_wing.yaml # Wing geometry for body aero tests |
| 39 | +├── yaml_geometry/ # Tests for src/yaml_geometry.jl |
| 40 | +│ ├── test_yaml_geometry.jl |
| 41 | +│ ├── simple_wing.yaml # Basic 2-section wing |
| 42 | +│ ├── complex_wing.yaml # Multi-section wing |
| 43 | +│ ├── standard_airfoil.csv # Standard polar data |
| 44 | +│ └── alternate_airfoil.csv # Alternative airfoil data |
| 45 | +├── solver/ # Tests for src/solver.jl |
| 46 | +│ ├── test_solver.jl |
| 47 | +│ ├── solver_settings.yaml # Settings for solver tests |
| 48 | +│ ├── solver_test_polar.csv # Polar data for solver tests |
| 49 | +│ └── solver_test_wing.yaml # Wing for solver tests |
| 50 | +├── settings/ # Tests for src/settings.jl |
| 51 | +│ └── test_settings.jl |
| 52 | +├── filament/ # Tests for src/filament.jl |
| 53 | +│ ├── test_bound_filament.jl |
| 54 | +│ └── test_semi_infinite_filament.jl |
| 55 | +├── panel/ # Tests for src/panel.jl |
| 56 | +│ └── test_panel.jl |
| 57 | +├── plotting/ # Tests for src/plotting.jl |
| 58 | +│ └── test_plotting.jl |
| 59 | +├── polars/ # Tests for src/polars.jl |
| 60 | +│ └── test_polars.jl |
| 61 | +├── ram_geometry/ # Tests for src/ram_geometry.jl |
| 62 | +│ └── test_kite_geometry.jl |
| 63 | +├── wake/ # Tests for src/wake.jl |
| 64 | +│ └── test_wake.jl |
| 65 | +├── wing_geometry/ # Tests for src/wing_geometry.jl |
| 66 | +│ └── test_wing_geometry.jl |
| 67 | +├── VortexStepMethod/ # Tests for main module |
| 68 | +│ └── test_VortexStepMethod.jl |
| 69 | +├── test_data_utils.jl # Shared utilities for test data access |
| 70 | +├── runtests.jl # Main test runner |
| 71 | +└── README.md # This file |
| 72 | +``` |
0 commit comments