]> Nishi Git Mirror - gwion.git/commitdiff
:white_check_mark: Update tests
authorfennecdjay <astor.jeremie@wanadoo.fr>
Mon, 23 Sep 2019 16:24:39 +0000 (18:24 +0200)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Mon, 23 Sep 2019 16:24:39 +0000 (18:24 +0200)
tests/import/specialid_emit.c [new file with mode: 0644]
tests/import/specialid_emit.gw [new file with mode: 0644]
tests/sh/opt.sh
tests/sh/plugin.sh

diff --git a/tests/import/specialid_emit.c b/tests/import/specialid_emit.c
new file mode 100644 (file)
index 0000000..4069b07
--- /dev/null
@@ -0,0 +1,26 @@
+#include "gwion_util.h"
+#include "gwion_ast.h"
+#include "oo.h"
+#include "vm.h"
+#include "env.h"
+#include "type.h"
+#include "object.h"
+#include "instr.h"
+#include "gwion.h"
+#include "operator.h"
+#include "import.h"
+#include "emit.h"
+#include "specialid.h"
+
+
+static ID_EMIT(spidem) {
+  const Instr instr = emit_add_instr(emit, RegPushImm);
+  instr->m_val = 1234;
+  return instr;
+}
+
+GWION_IMPORT(spid_test) {
+  struct SpecialId_ spid = { .type=t_int, .em=spidem, .is_const = 1 };
+  gwi_specialid(gwi, "testid", &spid);
+  return GW_OK;
+}
diff --git a/tests/import/specialid_emit.gw b/tests/import/specialid_emit.gw
new file mode 100644 (file)
index 0000000..ae20073
--- /dev/null
@@ -0,0 +1 @@
+<<< testid >>>;
index 65c18796e020831b45dfb11653ab9260fd278976..d231dac6a81e0ce92f7030b6ea1924e8377a293f 100644 (file)
@@ -1,5 +1,6 @@
 #!/bin/bash
-# [test] #16
+# [test] #17
+
 n=0
 [ "$1" ] && n="$1"
 [ "$n" -eq 0 ] && n=1
@@ -72,6 +73,10 @@ run "$n" "Kompile time Konfig" "-k" "file"
 n=$((n+1))
 run "$n" "just check" "-g check" "file"
 
+# set compilation passes
+n=$((n+1))
+run "$n" "just check" "-g nopass" "file"
+
 # test signal
 ./gwion -l1 &
 PID=$!
index 122110a7da9df06a24e0ae9f05c32f32b2665033..55b0d43a00133df8799329b50ec79064082fc8e0 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/bash
-# [test] #32
+# [test] #33
 
 n=0
 [ "$1" ] && n="$1"