Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
akheron committed Mar 21, 2024
1 parent 421da51 commit de07bb9
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,11 @@ if (NOT JANSSON_WITHOUT_TESTS)
if (IS_DIRECTORY ${TESTDIR})
get_filename_component(TNAME ${TESTDIR} NAME)

if ((USE_DTOA AND EXISTS ${TESTDIR}/skip_if_dtoa) OR
(NOT USE_DTOA AND EXISTS ${TESTDIR}/skip_unless_dtoa))
continue()
endif()

if (JANSSON_TEST_WITH_VALGRIND)
add_test(memcheck__${SUITE}__${TNAME}
${MEMCHECK_COMMAND} ${SUITE_TEST_CMD} ${TESTDIR})
Expand Down
1 change: 1 addition & 0 deletions test/suites/valid/real-exponent-no-dtoa/input
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[123e45]
1 change: 1 addition & 0 deletions test/suites/valid/real-exponent-no-dtoa/output
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[1.2299999999999999e47]
Empty file.
2 changes: 1 addition & 1 deletion test/suites/valid/real-exponent/output
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[1.2299999999999999e47]
[1.23e47]
Empty file.
11 changes: 11 additions & 0 deletions test/suites/valid/run
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,22 @@
JSON_SORT_KEYS=1
export JSON_SORT_KEYS

dtoa_enabled() {
grep -q "DTOA_ENABLED 1" $top_builddir/jansson_private_config.h
}

is_test() {
test -d $test_path
}

do_run() {
if [ -f $test_path/skip_unless_dtoa ]; then
dtoa_enabled || return 77
fi
if [ -f $test_path/skip_if_dtoa ]; then
dtoa_enabled && return 77
fi

variant=$1
s=".$1"

Expand Down

0 comments on commit de07bb9

Please sign in to comment.