[retro-gtk] flatpak: Don't diff the test output



commit 16066f27a04c3593cdc063712d406276e49bd6b4
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Wed Jan 8 15:09:38 2020 +0500

    flatpak: Don't diff the test output
    
    The output is not guaranteed to be stable and has changed recently, causing
    every test to fail. Hence don't try to diff it and instead just check exit
    code instead and show the whole output if it's not 0. If it's 0, assume the
    test passed. Get rid of expected files as they aren't used anymore.

 flatpak/org.gnome.Retro.UnitTests.json             | 12 +----
 flatpak/tests/advanced_tests.reftest.expected      |  5 --
 flatpak/tests/button_test.reftest.expected         | 53 -------------------
 flatpak/tests/cruzes.reftest.expected              |  5 --
 flatpak/tests/test-data.json                       | 60 ----------------------
 flatpak/tests/test.reftest.expected                |  5 --
 flatpak/tests/testaudio_callback.reftest.expected  |  5 --
 .../tests/testaudio_no_callback.reftest.expected   |  5 --
 .../tests/testaudio_playback_wav.reftest.expected  |  5 --
 flatpak/tests/testgl.reftest.expected              |  6 ---
 .../tests/testgl_compute_shaders.reftest.expected  |  4 --
 flatpak/tests/testgl_ff.reftest.expected           |  6 ---
 flatpak/tests/testsw.reftest.expected              |  5 --
 flatpak/tests/testsw_vram.reftest.expected         |  5 --
 14 files changed, 2 insertions(+), 179 deletions(-)
---
diff --git a/flatpak/org.gnome.Retro.UnitTests.json b/flatpak/org.gnome.Retro.UnitTests.json
index efa9e7f..bc4c05b 100644
--- a/flatpak/org.gnome.Retro.UnitTests.json
+++ b/flatpak/org.gnome.Retro.UnitTests.json
@@ -62,20 +62,12 @@
                         "  $@",
                         "  if [ $? -ne '0' ]; then RETURN=1; fi",
                         "}",
-                        "retro_reftest_expect()",
-                        "{",
-                        "  TEST=\"$1\"",
-                        "  if test \"$2\"; then EXPECTED=\"$2\"; else EXPECTED=\"$1\".expected; fi",
-                        "  shift; shift;",
-                        "  # Run the tests | Append a new line if needed | Compare with the expected 
results.",
-                        "  retro-reftest \"$TEST\" 2>&1 | sed -e '$a\\' | diff -u \"$EXPECTED\" -",
-                        "}",
                         "retro_reftest_test()",
                         "{",
                         "  RESULT=$(mktemp /tmp/retro_reftest.XXXXXX)",
                         "  for TEST in $@; do",
-                        "    retro_reftest_expect \"$TEST\" > \"$RESULT\"",
-                        "    if test -s \"$RESULT\"; then",
+                        "    retro-reftest \"$TEST\" 2>&1 > \"$RESULT\"",
+                        "    if [ \"$?\" != '0' ]; then",
                         "      echo \"$TEST\": FAIL",
                         "      cat \"$RESULT\"",
                         "      RETURN=1",
diff --git a/flatpak/tests/test-data.json b/flatpak/tests/test-data.json
index 9d76791..02cbe4b 100644
--- a/flatpak/tests/test-data.json
+++ b/flatpak/tests/test-data.json
@@ -16,11 +16,6 @@
                     "path" : "advanced_tests.reftest",
                     "dest-filename" : "advanced_tests.reftest"
                 },
-                {
-                    "type" : "file",
-                    "path" : "advanced_tests.reftest.expected",
-                    "dest-filename" : "advanced_tests.reftest.expected"
-                },
                 {
                     "type" : "file",
                     "url" : "https://upload.wikimedia.org/wikipedia/commons/7/74/BAK_1.wav";,
@@ -37,11 +32,6 @@
                     "path" : "button_test.reftest",
                     "dest-filename" : "button_test.reftest"
                 },
-                {
-                    "type" : "file",
-                    "path" : "button_test.reftest.expected",
-                    "dest-filename" : "button_test.reftest.expected"
-                },
                 {
                     "type" : "file",
                     "path" : "button_test_a.png",
@@ -132,11 +122,6 @@
                     "path" : "cruzes.reftest",
                     "dest-filename" : "cruzes.reftest"
                 },
-                {
-                    "type" : "file",
-                    "path" : "cruzes.reftest.expected",
-                    "dest-filename" : "cruzes.reftest.expected"
-                },
                 {
                     "type" : "file",
                     "path" : "testaudio_callback.png",
@@ -147,11 +132,6 @@
                     "path" : "testaudio_callback.reftest",
                     "dest-filename" : "testaudio_callback.reftest"
                 },
-                {
-                    "type" : "file",
-                    "path" : "testaudio_callback.reftest.expected",
-                    "dest-filename" : "testaudio_callback.reftest.expected"
-                },
                 {
                     "type" : "file",
                     "path" : "testaudio_no_callback.png",
@@ -162,11 +142,6 @@
                     "path" : "testaudio_no_callback.reftest",
                     "dest-filename" : "testaudio_no_callback.reftest"
                 },
-                {
-                    "type" : "file",
-                    "path" : "testaudio_no_callback.reftest.expected",
-                    "dest-filename" : "testaudio_no_callback.reftest.expected"
-                },
                 {
                     "type" : "file",
                     "path" : "testaudio_playback_wav.png",
@@ -177,41 +152,21 @@
                     "path" : "testaudio_playback_wav.reftest",
                     "dest-filename" : "testaudio_playback_wav.reftest"
                 },
-                {
-                    "type" : "file",
-                    "path" : "testaudio_playback_wav.reftest.expected",
-                    "dest-filename" : "testaudio_playback_wav.reftest.expected"
-                },
                 {
                     "type" : "file",
                     "path" : "testgl.reftest",
                     "dest-filename" : "testgl.reftest"
                 },
-                {
-                    "type" : "file",
-                    "path" : "testgl.reftest.expected",
-                    "dest-filename" : "testgl.reftest.expected"
-                },
                 {
                     "type" : "file",
                     "path" : "testgl_compute_shaders.reftest",
                     "dest-filename" : "testgl_compute_shaders.reftest"
                 },
-                {
-                    "type" : "file",
-                    "path" : "testgl_compute_shaders.reftest.expected",
-                    "dest-filename" : "testgl_compute_shaders.reftest.expected"
-                },
                 {
                     "type" : "file",
                     "path" : "testgl_ff.reftest",
                     "dest-filename" : "testgl_ff.reftest"
                 },
-                {
-                    "type" : "file",
-                    "path" : "testgl_ff.reftest.expected",
-                    "dest-filename" : "testgl_ff.reftest.expected"
-                },
                 {
                     "type" : "file",
                     "path" : "test.png",
@@ -222,11 +177,6 @@
                     "path" : "test.reftest",
                     "dest-filename" : "test.reftest"
                 },
-                {
-                    "type" : "file",
-                    "path" : "test.reftest.expected",
-                    "dest-filename" : "test.reftest.expected"
-                },
                 {
                     "type" : "file",
                     "path" : "testsw.png",
@@ -237,11 +187,6 @@
                     "path" : "testsw.reftest",
                     "dest-filename" : "testsw.reftest"
                 },
-                {
-                    "type" : "file",
-                    "path" : "testsw.reftest.expected",
-                    "dest-filename" : "testsw.reftest.expected"
-                },
                 {
                     "type" : "file",
                     "path" : "testsw_vram.png",
@@ -251,11 +196,6 @@
                     "type" : "file",
                     "path" : "testsw_vram.reftest",
                     "dest-filename" : "testsw_vram.reftest"
-                },
-                {
-                    "type" : "file",
-                    "path" : "testsw_vram.reftest.expected",
-                    "dest-filename" : "testsw_vram.reftest.expected"
                 }
             ]
         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]