Skip to content

Commit 3ea3abf

Browse files
committed
builder: Remove use of oUnit
1 parent b3b44ec commit 3ea3abf

File tree

2 files changed

+11
-25
lines changed

2 files changed

+11
-25
lines changed

builder/Makefile.am

+5-13
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,6 @@ OCAMLPACKAGES_TESTS =
192192
if HAVE_OCAML_PKG_GETTEXT
193193
OCAMLPACKAGES += -package gettext-stub
194194
endif
195-
if HAVE_OCAML_PKG_OUNIT
196-
OCAMLPACKAGES_TESTS += -package ounit2
197-
endif
198195

199196
OCAMLCLIBS = \
200197
-pthread -lpthread \
@@ -358,17 +355,12 @@ TESTS = \
358355
test-virt-builder-cacheall.sh \
359356
test-virt-builder-list.sh \
360357
test-virt-index-validate.sh \
361-
$(SLOW_TESTS)
362-
check_PROGRAMS =
363-
364-
TESTS += \
365358
test-virt-builder-list-simplestreams.sh \
366-
test-virt-builder.sh
367-
368-
if HAVE_OCAML_PKG_OUNIT
369-
check_PROGRAMS += index_parser_tests
370-
TESTS += index_parser_tests
371-
endif
359+
test-virt-builder.sh \
360+
index_parser_tests \
361+
$(SLOW_TESTS)
362+
check_PROGRAMS = \
363+
index_parser_tests
372364

373365
check-valgrind:
374366
$(MAKE) VG="@VG@" check

builder/index_parser_tests.ml

+6-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
(* builder
22
* Copyright (C) 2017 SUSE Inc.
3+
* Copyright (C) 2025 Red Hat
34
*
45
* This program is free software; you can redistribute it and/or modify
56
* it under the terms of the GNU General Public License as published by
@@ -20,8 +21,6 @@
2021

2122
open Printf
2223

23-
open OUnit2
24-
2524
open Std_utils
2625
open Unix_utils
2726
open Tools_utils
@@ -68,14 +67,18 @@ let format_entries entries =
6867
read_file "out" in
6968
List.map format_entry entries
7069

70+
let assert_equal ~printer a b =
71+
if a <> b then
72+
failwithf "FAIL: %s <> %s" (printer a) (printer b)
73+
7174
let assert_equal_string = assert_equal ~printer:(fun x -> sprintf "\"%s\"" x)
7275
let assert_equal_list formatter =
7376
let printer = (
7477
fun x -> "(" ^ (String.escaped (String.concat "," (formatter x))) ^ ")"
7578
) in
7679
assert_equal ~printer
7780

78-
let test_write_complete ctx =
81+
let () =
7982
let entry =
8083
("test-id", { Index.printable_name = Some "test_name";
8184
osinfo = Some "osinfo_data";
@@ -122,12 +125,3 @@ aliases=alias1 alias2
122125

123126
let parsed_entries = parse_file "out" in
124127
assert_equal_list format_entries [entry] parsed_entries
125-
126-
let suite =
127-
"builder Index_parser" >:::
128-
[
129-
"write.complete" >:: test_write_complete;
130-
]
131-
132-
let () =
133-
run_test_tt_main suite

0 commit comments

Comments
 (0)