diff --git a/build/choose-tests-locale.sh b/build/choose-tests-locale.sh index ded42b9938e8ebf1cc3cf944f4275cb5f42f6218..73b273b8122650f55804e23e5b9f3d2f9942cbed 100755 --- a/build/choose-tests-locale.sh +++ b/build/choose-tests-locale.sh @@ -1,5 +1,9 @@ #!/bin/sh +if ! which locale > /dev/null; then + exit 1 +fi + locales=$(locale -a | xargs -n1) case $locales in diff --git a/installed-tests/scripts/common.sh b/installed-tests/scripts/common.sh index 7ffdb7652e3ed801211b6f9a342e644980b650b3..8f228194cbc0fcdc407d173a38217cf43024c8ba 100755 --- a/installed-tests/scripts/common.sh +++ b/installed-tests/scripts/common.sh @@ -1,9 +1,9 @@ #!/bin/sh if test "$GJS_USE_UNINSTALLED_FILES" = "1"; then - gjs="$LOG_COMPILER $LOG_FLAGS $TOP_BUILDDIR/gjs-console" + gjs="$TOP_BUILDDIR/gjs-console" else - gjs="$LOG_COMPILER $LOG_FLAGS gjs-console" + gjs="gjs-console" fi # Avoid interference in the profiler tests from stray environment variable diff --git a/installed-tests/scripts/testCommandLine.sh b/installed-tests/scripts/testCommandLine.sh index b50194176daf862baa1a676b576933563440f4de..1c9ab29f54609ef1dffc5651161ed96a130175f2 100755 --- a/installed-tests/scripts/testCommandLine.sh +++ b/installed-tests/scripts/testCommandLine.sh @@ -1,9 +1,9 @@ #!/bin/sh if test "$GJS_USE_UNINSTALLED_FILES" = "1"; then - gjs="$LOG_COMPILER $LOG_FLAGS $TOP_BUILDDIR/gjs-console" + gjs="$TOP_BUILDDIR/gjs-console" else - gjs="$LOG_COMPILER $LOG_FLAGS gjs-console" + gjs="gjs-console" fi # Avoid interference in the profiler tests from stray environment variable diff --git a/installed-tests/scripts/testWarnings.sh b/installed-tests/scripts/testWarnings.sh index 9cbaed8494a3eebc0527b6b139d301cabc79e818..30ca082f1424c0ec8ee78244f6b087ec238af73d 100755 --- a/installed-tests/scripts/testWarnings.sh +++ b/installed-tests/scripts/testWarnings.sh @@ -1,9 +1,9 @@ #!/bin/sh if test "$GJS_USE_UNINSTALLED_FILES" = "1"; then - gjs="$LOG_COMPILER $LOG_FLAGS $TOP_BUILDDIR/gjs-console" + gjs="$TOP_BUILDDIR/gjs-console" else - gjs="$LOG_COMPILER $LOG_FLAGS gjs-console" + gjs="gjs-console" fi total=0 diff --git a/meson.build b/meson.build index 0d8db4823e6fb7dd2a94867fa35837e67e733d35..383d7e406ddf0210c233943cd13cefce69b83938 100644 --- a/meson.build +++ b/meson.build @@ -300,13 +300,6 @@ configure_file(output: 'config.h', configuration: header_conf) ### Check for environment ###################################################### -if cxx.get_id() == 'msvc' - tests_locale = 'C.UTF-8' -else - # Not applicable for cmd.exe shells that MSVC uses - tests_locale = run_command('build/choose-tests-locale.sh').stdout().strip() -endif - gjsjsdir = get_option('datadir') / api_name pkglibexecdir = get_option('libexecdir') / meson.project_name() abs_pkglibexecdir = get_option('prefix') / pkglibexecdir @@ -583,10 +576,18 @@ tests_environment.set('G_FILENAME_ENCODING', 'latin1') tests_environment.set('LSAN_OPTIONS', 'exitcode=23,suppressions=@0@'.format( meson.current_source_dir() / 'installed-tests' / 'extra' / 'lsan.supp')) tests_environment.set('NO_AT_BRIDGE', '1') -tests_environment.set('LC_ALL', tests_locale) tests_environment.set('GSETTINGS_SCHEMA_DIR', js_tests_builddir) tests_environment.set('G_DEBUG', 'fatal-warnings,fatal-criticals') +tests_locale = 'N/A' +if cxx.get_id() != 'msvc' + result = run_command('build/choose-tests-locale.sh') + if result.returncode() == 0 + tests_locale = result.stdout().strip() + tests_environment.set('LC_ALL', tests_locale) + endif +endif + if not get_option('skip_gtk_tests') tests_environment.set('ENABLE_GTK', 'yes') endif @@ -650,7 +651,7 @@ gobject-introspection to run the tests. You can still build GJS, but some tests will fail.''') endif -if tests_locale == 'C' +if tests_locale == 'C' or tests_locale == 'N/A' warning('''Your libc does not have the C.UTF-8 locale and no other suitable UTF-8 fallback locale could be found. You can still build GJS, but some tests will fail.''') diff --git a/test/run-test b/test/run-test deleted file mode 100755 index 75f62cf68172cd6aa665c5f032473d3cb97ce53a..0000000000000000000000000000000000000000 --- a/test/run-test +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -e -# Run a GTester binary with TAP output - -if test -z "$1"; then - echo "Need a test-binary filename!" - exit 1 -fi - -$LOG_COMPILER $LOG_FLAGS "$1" --tap --keep-going --verbose