2023-11-23 11:09:32 +00:00
|
|
|
#include "sput.h"
|
|
|
|
#include "test_config.h"
|
2023-11-23 14:40:17 +00:00
|
|
|
#include "test_dyn_array.h"
|
2023-11-24 16:09:18 +00:00
|
|
|
#include "test_parser.h"
|
2023-11-25 03:29:24 +00:00
|
|
|
#include "test_string_buf.h"
|
2023-11-25 22:29:35 +00:00
|
|
|
#include "test_string_utils.h"
|
2023-11-24 17:27:44 +00:00
|
|
|
#include "test_validator.h"
|
2023-11-23 11:09:32 +00:00
|
|
|
|
|
|
|
int main(int argc, char *argv[]) {
|
|
|
|
sput_start_testing();
|
|
|
|
|
2023-11-23 14:40:17 +00:00
|
|
|
sput_enter_suite("config");
|
2023-11-25 18:51:42 +00:00
|
|
|
sput_run_test(test_config_new_invalid_args);
|
|
|
|
sput_run_test(test_config_new_spec_not_found);
|
|
|
|
sput_run_test(test_config_new_spec_not_dir);
|
|
|
|
sput_run_test(test_config_new_success);
|
2023-11-23 14:40:17 +00:00
|
|
|
|
|
|
|
sput_enter_suite("dyn_array");
|
2023-11-24 18:47:23 +00:00
|
|
|
sput_run_test(test_dyn_array_zero_capacity);
|
2023-11-23 14:40:17 +00:00
|
|
|
sput_run_test(test_dyn_array_nonzero_capacity);
|
2023-11-23 11:09:32 +00:00
|
|
|
|
2023-11-25 03:29:24 +00:00
|
|
|
sput_enter_suite("string_buf");
|
|
|
|
sput_run_test(test_string_buf_sappend);
|
|
|
|
sput_run_test(test_string_buf_cappend);
|
|
|
|
|
2023-11-25 22:29:35 +00:00
|
|
|
sput_enter_suite("string_utils");
|
|
|
|
sput_run_test(test_join_single);
|
|
|
|
sput_run_test(test_join_multiple);
|
2023-11-25 22:47:47 +00:00
|
|
|
sput_run_test(test_strcmp_ci);
|
2023-11-30 16:33:25 +00:00
|
|
|
sput_run_test(test_trim_leading);
|
|
|
|
sput_run_test(test_trim_trailing);
|
2023-11-23 20:31:54 +00:00
|
|
|
|
2023-11-24 16:09:18 +00:00
|
|
|
sput_enter_suite("parser");
|
2023-11-25 02:29:14 +00:00
|
|
|
sput_run_test(test_parser_missing);
|
|
|
|
sput_run_test(test_parser_minimal);
|
|
|
|
sput_run_test(test_parser_invalid);
|
2023-11-23 20:31:54 +00:00
|
|
|
|
2023-11-24 17:27:44 +00:00
|
|
|
sput_enter_suite("validator");
|
2023-11-25 02:29:14 +00:00
|
|
|
sput_run_test(test_validator_toplevel_not_object);
|
|
|
|
sput_run_test(test_validator_field_not_object);
|
2023-11-25 22:58:13 +00:00
|
|
|
sput_run_test(test_validator_field_name_leading_digit);
|
|
|
|
sput_run_test(test_validator_field_name_non_alnum);
|
2023-11-25 02:29:14 +00:00
|
|
|
sput_run_test(test_validator_field_type_invalid);
|
|
|
|
sput_run_test(test_validator_field_type_unknown);
|
2023-11-25 22:47:47 +00:00
|
|
|
sput_run_test(test_validator_valid_type_ci);
|
2023-11-30 16:33:25 +00:00
|
|
|
sput_run_test(test_validator_field_required_invalid);
|
|
|
|
sput_run_test(test_validator_field_required_valid);
|
2023-11-25 02:29:14 +00:00
|
|
|
sput_run_test(test_validator_field_prompt_invalid);
|
2023-11-30 16:33:25 +00:00
|
|
|
sput_run_test(test_validator_valid_no_required);
|
2023-11-24 17:27:44 +00:00
|
|
|
|
2023-11-23 11:09:32 +00:00
|
|
|
sput_finish_testing();
|
|
|
|
|
|
|
|
return sput_get_return_value();
|
|
|
|
}
|